+ # OFPT_TABLE_STATUS, OFPTR_VACANCY_UP
+ if test X"$1" = X"OFPTR_VACANCY_UP"; then shift;
+ ovs-vsctl -- --id=@t1 create Flow_Table flow-limit=10 -- set bridge br0 flow_tables:1=@t1
+
+ # Turn on vacancy events, then add flows until we're full.
+ # With initial vacancy of 100% and vacancy_up of 80%, so that
+ # vacancy >= vacancy_up, this enables VACANY_DOWN events, so
+ # we get a single such message when vacancy dips below 20%.
+ ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
+ echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_DOWN
+table_desc:-
+ table 1:
+ eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
+ vacancy=on vacancy_down=20% vacancy_up=80% vacancy=10%"
+ # Then delete flows until we're empty. Sending the
+ # VACANCY_DOWN message enabled VACANCY_UP events, so we get a
+ # single such message when vacancy rises above 80%.
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
+ echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
+table_desc:-
+ table 1:
+ eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
+ vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
+
+ # Now approach vacancy from the other direction. First
+ # disable vacancy events. With initial vacancy of 70%, so
+ # that vacancy < vacancy_up, this enables VACANCY_UP events.
+ # That means that filling up the table generates no message,
+ # but deleting all the flows generates VACANCY_UP at the point
+ # vacancy rises above 80%.
+ ovs-ofctl -O OpenFlow14 mod-table br0 1 novacancy
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
+ ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
+ ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
+ ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
+ echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
+table_desc:-
+ table 1:
+ eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
+ vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
+ fi
+