1 AT_BANNER([drop-stats])
3 AT_SETUP([drop-stats - cli tests])
5 OVS_VSWITCHD_START([dnl
6 set bridge br0 datapath_type=dummy \
7 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
8 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
10 AT_DATA([flows.txt], [dnl
11 table=0,in_port=1,actions=drop
15 ovs-ofctl del-flows br0
16 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
17 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions ], [0], [dnl
18 in_port=1 actions=drop
22 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
23 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
24 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
27 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.0/' | sort], [0], [flow-dump from the main thread:
28 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:2, bytes:212, used:0.0, actions:drop
31 ovs-appctl time/warp 5000
34 ovs-appctl coverage/read-counter drop_action_of_pipeline
43 AT_SETUP([drop-stats - pipeline and recurssion drops])
45 OVS_VSWITCHD_START([dnl
46 set bridge br0 datapath_type=dummy \
47 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
48 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
49 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2])
51 AT_DATA([flows.txt], [dnl
52 table=0,in_port=1,actions=drop
56 ovs-ofctl del-flows br0
57 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
58 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions ], [0], [dnl
59 in_port=1 actions=drop
63 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
66 ovs-appctl time/warp 5000
69 ovs-appctl coverage/read-counter drop_action_of_pipeline
75 AT_DATA([flows.txt], [dnl
76 table=0, in_port=1, actions=goto_table:1
77 table=1, in_port=1, actions=goto_table:2
78 table=2, in_port=1, actions=resubmit(,1)
82 ovs-ofctl del-flows br0
83 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
84 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions ], [0], [ignore])
87 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
90 ovs-appctl time/warp 5000
93 ovs-appctl coverage/read-counter drop_action_recursion_too_deep
99 OVS_VSWITCHD_STOP(["/|WARN|/d"])
102 AT_SETUP([drop-stats - too many resubmit])
105 (for i in `seq 1 64`; do
107 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
109 echo "in_port=65, actions=local") > flows.txt
112 ovs-ofctl del-flows br0
113 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt ], [0], [ignore])
115 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
117 ovs-appctl time/warp 5000
120 ovs-appctl coverage/read-counter drop_action_too_many_resubmit
125 OVS_VSWITCHD_STOP(["/|WARN|/d"])
129 AT_SETUP([drop-stats - stack too deep])
132 (for i in `seq 1 12`; do
134 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
136 push="push:NXM_NX_REG0[[]]"
137 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
139 AT_CHECK([ovs-ofctl add-flows br0 flows])
141 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
143 ovs-appctl time/warp 5000
146 ovs-appctl coverage/read-counter drop_action_stack_too_deep
152 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
155 AT_SETUP([drop-stats - too many mpls labels])
157 OVS_VSWITCHD_START([dnl
158 set bridge br0 datapath_type=dummy \
159 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
160 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
161 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2])
163 AT_DATA([flows.txt], [dnl
164 table=0, in_port=1, actions=push_mpls:0x8847, resubmit:3
165 table=0, in_port=3, actions=push_mpls:0x8847, set_field:10->mpls_label, set_field:15->mpls_label, resubmit:4
166 table=0, in_port=4, actions=push_mpls:0x8847, set_field:11->mpls_label, resubmit:5
167 table=0, in_port=5, actions=push_mpls:0x8847, set_field:12->mpls_label, resubmit:6
168 table=0, in_port=6, actions=push_mpls:0x8847, set_field:13->mpls_label, output:2
172 ovs-ofctl del-flows br0
173 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
177 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
180 ovs-appctl time/warp 5000
183 ovs-appctl coverage/read-counter drop_action_too_many_mpls_labels
189 OVS_VSWITCHD_STOP(["/|WARN|/d"])