1 AT_BANNER([ofproto-dpif])
3 m4_divert_push([PREPARE_TESTS])
5 # Helper function to check the spread of dp_hash flows over buckets in the datapath
6 check_dpflow_stats () {
10 if [[ $# -eq 3 ]]; then
11 echo "$dpflows" | grep "actions:hash"
12 n_flows=`echo "$dpflows" | grep -c dp_hash`
13 n_buckets=`echo "$dpflows" | grep dp_hash | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
15 n_flows=`echo "$dpflows" | wc -l`
16 n_buckets=`echo "$dpflows" | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
18 if [[ $n_flows -ge $min_flows ]]; then flows=ok; else flows=nok; fi
19 if [[ $n_buckets -ge $min_buckets ]]; then buckets=ok; else buckets=nok; fi
20 echo "n_flows=$flows n_buckets=$buckets"
23 m4_divert_pop([PREPARE_TESTS])
26 AT_SETUP([ofproto-dpif - revalidator/wait])
28 AT_CHECK([ovs-appctl revalidator/wait])
32 AT_SETUP([ofproto-dpif - active-backup bonding])
33 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
34 # and br1 with interfaces p3, p4 and p8.
35 # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
37 [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
38 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
39 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
40 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
42 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
43 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
45 add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
46 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
47 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
48 WAIT_FOR_DUMMY_PORTS([p3], [p4])
49 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
51 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
52 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
53 ovs-appctl netdev-dummy/set-admin-state up
54 ovs-appctl time/warp 100
55 ovs-appctl netdev-dummy/set-admin-state p2 down
57 ovs-appctl time/warp 100
58 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
59 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
60 ovs-appctl time/warp 100
61 ovs-appctl netdev-dummy/set-admin-state p2 up
62 ovs-appctl netdev-dummy/set-admin-state p1 down
63 ovs-appctl time/warp 100
64 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
65 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
66 ovs-appctl time/warp 200 100
68 AT_CHECK([grep 'in_port([[348]])' ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
69 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
70 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
71 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(frag=no), actions: <del>
72 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(frag=no), actions: <del>
73 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035), actions: <del>
74 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035), actions: <del>
79 AT_SETUP([ofproto-dpif - balance-slb bonding])
80 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
81 # and br1 with interfaces p4, p5, p6 and p8.
82 # p1 <-> p4, p2 <-> p5, p3 <-> p6
83 # Send some traffic, make sure the traffic are spread based on source mac.
85 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
86 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
87 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
88 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
89 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
91 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
92 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
94 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
95 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
96 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
97 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
98 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
99 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
100 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
101 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
104 ovs-appctl time/warp 100
106 for i in `seq 0 100 |xargs printf '%02x\n'`;
108 pkt="in_port(7),eth(src=50:54:00:00:00:$i,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
109 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
112 ovs-appctl time/warp 100
113 AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
114 # Make sure there is resonable distribution to all three ports.
115 # We don't want to make this check precise, in case hash function changes.
116 AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
117 AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
118 AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
122 AT_SETUP([ofproto-dpif - balance-tcp bonding])
123 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
124 # and br1 with interfaces bond1(p4, p5, p6) and p8.
126 # Send some traffic, make sure the traffic are spread based on L4 headers.
128 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
129 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
130 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
131 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
132 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
133 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
135 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
136 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
137 fail-mode=secure -- \
138 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
139 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
140 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
141 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
142 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
143 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
144 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
146 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
147 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
148 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
150 OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
152 ovs-appctl time/warp 100
153 ovs-appctl lacp/show > lacp.txt
154 ovs-appctl bond/show > bond.txt
156 for i in `seq 0 255` ;
158 pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(ack)"
159 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
162 ovs-appctl time/warp 300 100
163 AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
164 AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
165 # Make sure there is resonable distribution to all three ports.
166 # We don't want to make this check precise, in case hash function changes.
167 AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
168 AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
169 AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
174 # Makes sure recirculation does not change the way packet is handled.
175 AT_SETUP([ofproto-dpif - balance-tcp bonding, different recirc flow ])
177 [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
178 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
179 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
180 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
182 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
183 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
184 fail-mode=standalone -- \
185 add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
186 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
187 set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
188 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
189 add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
191 set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
192 set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
193 fail-mode=secure -- \
194 add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
195 add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
197 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
200 # Waits for all ifaces enabled.
201 OVS_WAIT_UNTIL([test `ovs-appctl bond/show | grep -- "may_enable: true" | wc -l` -ge 4])
203 # The dl_vlan flow should not be ever matched,
204 # since recirculation should not change the flow handling.
205 AT_DATA([flows.txt], [dnl
206 table=0 priority=1 in_port=5 actions=mod_vlan_vid:1,output(101)
207 table=0 priority=2 in_port=5 dl_vlan=1 actions=drop
209 AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
211 # Sends a packet to trigger recirculation.
212 AT_CHECK([ovs-appctl netdev-dummy/receive p5 "in_port(5),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1)"])
214 # Collects flow stats.
215 AT_CHECK([ovs-appctl revalidator/purge], [0])
217 # Checks the flow stats in br1, should only be one flow with non-zero
218 # 'n_packets' from internal table.
219 AT_CHECK([ovs-appctl bridge/dump-flows br1 | ofctl_strip | grep -- "n_packets" | grep -- "table_id" | sed -e 's/output:[[0-9]][[0-9]]*/output/'] , [0], [dnl
220 table_id=254, n_packets=1, n_bytes=38, priority=20,recirc_id=0x0,dp_hash=0x0/0xff,actions=output
223 # Checks the flow stats in br-int, should be only one match.
224 AT_CHECK([ovs-ofctl dump-flows br-int | ofctl_strip | sort], [0], [dnl
225 n_packets=1, n_bytes=34, priority=1,in_port=5 actions=mod_vlan_vid:1,output:101
226 priority=2,in_port=5,dl_vlan=1 actions=drop
233 AT_SETUP([ofproto-dpif - resubmit])
235 add_of_ports br0 1 10 11 12 13 14 15 16 17 18 19 20 21
236 AT_DATA([flows.txt], [dnl
237 table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
238 table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
239 table=0 in_port=3 priority=2000 icmp actions=output(20)
240 table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
241 table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
242 table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
244 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
245 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=p1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
246 AT_CHECK([tail -1 stdout], [0],
247 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
252 AT_SETUP([ofproto-dpif - goto table])
254 add_of_ports br0 1 10 11
255 echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
256 for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
257 echo "table=64 actions=output(11)" >> flows.txt
258 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
259 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
260 AT_CHECK([tail -1 stdout], [0],
261 [Datapath actions: 10,11
266 AT_SETUP([ofproto-dpif - write actions])
268 add_of_ports br0 1 10 11 12 13
269 AT_DATA([flows.txt], [dnl
270 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
271 table=1 ip actions=write_actions(output(13)),goto_table(2)
272 table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
274 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
275 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
276 AT_CHECK([tail -2 stdout], [0],
277 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
278 Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
283 AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND)])
285 add_of_ports br0 1 10 11 12 13
286 AT_DATA([flows.txt], [dnl
287 table=0 in_port=1,icmp6,icmpv6_type=135 actions=output(10),write_actions(set_field:fe80::3->nd_target,set_field:aa:aa:aa:aa:aa:aa->nd_sll,output(12)),goto_table(1)
288 table=1 icmp6 actions=write_actions(output(13)),goto_table(2)
289 table=2 in_port=1,icmp6,icmpv6_type=135 actions=set_field:fe80::4->nd_target,set_field:cc:cc:cc:cc:cc:cc->nd_sll,output(11)
291 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
292 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,icmp6,ipv6_src=fe80::1,ipv6_dst=fe80::2,nw_tos=0,nw_ttl=128,icmpv6_type=135,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11'], [0], [stdout])
293 AT_CHECK([tail -4 stdout], [0],
294 [Megaflow: recirc_id=0,eth,icmp6,in_port=1,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11
295 Datapath actions: 10,set(nd(target=fe80::4,sll=cc:cc:cc:cc:cc:cc)),11,set(nd(target=fe80::3,sll=aa:aa:aa:aa:aa:aa)),13
296 This flow is handled by the userspace slow path because it:
297 - Uses action(s) not supported by datapath.
302 AT_SETUP([ofproto-dpif - clear actions])
304 add_of_ports br0 1 10 11 12
305 AT_DATA([flows.txt], [dnl
306 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
307 table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
309 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
310 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=9'], [0], [stdout])
311 AT_CHECK([tail -2 stdout], [0],
312 [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_src=8
313 Datapath actions: 10,set(tcp(src=91)),11
318 AT_SETUP([ofproto-dpif - group chaining])
320 add_of_ports br0 1 10 11
321 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=set_field:192.168.3.90->ip_src,group:123,bucket=output:11'])
322 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=123,type=all,bucket=output:10'])
323 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
324 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
325 AT_CHECK([tail -1 stdout], [0],
326 [Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
331 AT_SETUP([ofproto-dpif - all group in action list])
333 add_of_ports br0 1 10 11
334 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
335 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
336 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
337 # Must match on the source address to be able to restore it's value for
339 AT_CHECK([tail -2 stdout], [0],
340 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
341 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
346 AT_SETUP([ofproto-dpif - indirect group in action list])
348 add_of_ports br0 1 10
349 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
350 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
351 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
352 AT_CHECK([tail -1 stdout], [0],
353 [Datapath actions: 10
358 AT_SETUP([ofproto-dpif - group actions have no effect afterwards])
360 add_of_ports br0 1 10
361 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=set_field:192.168.3.90->ip_src,output:10'])
362 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234,output:10'])
365 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.1.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
366 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
369 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/dp_hash(.*\/0xf)/dp_hash(0xXXXX\/0xf)/' | sed 's/packets.*actions:/actions:/' | strip_ufid | strip_used | sort], [0], [dnl
370 flow-dump from non-dpdk interfaces:
371 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:hash(sym_l4(0)),recirc(0x1)
372 recirc_id(0x1),dp_hash(0xXXXX/0xf),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), actions:set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),10
378 AT_SETUP([ofproto-dpif - all group in action set])
380 add_of_ports br0 1 10 11
381 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
382 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
383 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
384 # Must match on the source address to be able to restore it's value for
386 AT_CHECK([tail -2 stdout], [0],
387 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
388 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
393 AT_SETUP([ofproto-dpif - indirect group in action set])
395 add_of_ports br0 1 10
396 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
397 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
398 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
399 AT_CHECK([tail -1 stdout], [0],
400 [Datapath actions: 10
405 AT_SETUP([ofproto-dpif - patch port with action set])
406 OVS_VSWITCHD_START([ \
408 set bridge br1 datapath-type=dummy fail-mode=secure -- \
409 add-port br0 patch10 -- \
410 set interface patch10 type=patch options:peer=patch20 ofport_request=10 -- \
411 add-port br1 patch20 -- \
412 set interface patch20 type=patch options:peer=patch10 ofport_request=20
416 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br1 'ip actions=write_actions(pop_vlan,output:2)'])
417 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=output:10'])
418 AT_CHECK([ovs-appctl ofproto/trace br1 'in_port=20,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_vlan=100,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
419 AT_CHECK([tail -1 stdout], [0],
420 [Datapath actions: pop_vlan,2
422 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_vlan=100,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
423 AT_CHECK([tail -1 stdout], [0],
424 [Datapath actions: pop_vlan,2
430 AT_SETUP([ofproto-dpif - select group])
433 add_of_ports br0 1 10 11
435 ovs-appctl vlog/set ofproto_dpif:file:dbg
436 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
437 AT_CHECK([grep -A6 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
438 ofproto_dpif|DBG|Constructing select group 1234
439 ofproto_dpif|DBG|No selection method specified. Trying dp_hash.
440 ofproto_dpif|DBG| Minimum weight: 1, total weight: 2
441 ofproto_dpif|DBG| Using 16 hash values:
442 ofproto_dpif|DBG| Bucket 0: weight=1, target=8.00 hits=8
443 ofproto_dpif|DBG| Bucket 1: weight=1, target=8.00 hits=8
444 ofproto_dpif|DBG|Use dp_hash with 16 hash values using algorithm 1.
446 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
448 # Try a bunch of different flows and make sure that they get distributed
449 # # at least somewhat.
451 for s in 1 2 3 4 ; do
452 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.0.$s,dst=192.168.1.$d,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
453 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
457 AT_CHECK([ovs-appctl dpctl/dump-flows | sort | strip_ufid | strip_used | check_dpflow_stats 5 2 dp_hash], [0], [dnl
458 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:15, bytes:1590, used:0.0s, actions:hash(sym_l4(0)),recirc(0x1)
459 n_flows=ok n_buckets=ok
465 AT_SETUP([ofproto-dpif - select group with watch port])
468 add_of_ports br0 1 10 11
469 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
470 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
473 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
474 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
477 AT_CHECK([ovs-appctl dpctl/dump-flows | sort| sed 's/dp_hash(.*\/0xf)/dp_hash(0xXXXX\/0xf)/' | strip_ufid | strip_used], [0], [dnl
478 flow-dump from non-dpdk interfaces:
479 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:3, bytes:318, used:0.0s, actions:hash(sym_l4(0)),recirc(0x1)
480 recirc_id(0x1),dp_hash(0xXXXX/0xf),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:3, bytes:318, used:0.0s, actions:11
486 AT_SETUP([ofproto-dpif - select group with weights])
488 # Helper function to check the accuracy of distribution of packets over buckets
489 check_group_stats () {
490 buckets=`grep -o 'packet_count=[[0-9]]*' | cut -d'=' -f2 | tail -n +2`
492 for bucket in $buckets; do
495 if [[ $bucket -ge $min ]]; then
496 echo "bucket$i >= $min"
498 echo "bucket$i < $min"
501 if [[ $i -ge 4 ]]; then break; fi
506 add_of_ports br0 1 10 11 12 13 14
508 ovs-appctl vlog/set ofproto_dpif:file:dbg
509 AT_CHECK([ovs-ofctl -O OpenFlow13 add-group br0 'group_id=1234,type=select,bucket=weight:5,output:10,bucket=weight:10,output:11,bucket=weight:25,output:12,bucket=weight:60,output:13,bucket=weight:0,output:14'])
510 AT_CHECK([grep -A9 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
511 ofproto_dpif|DBG|Constructing select group 1234
512 ofproto_dpif|DBG|No selection method specified. Trying dp_hash.
513 ofproto_dpif|DBG| Minimum weight: 5, total weight: 100
514 ofproto_dpif|DBG| Using 32 hash values:
515 ofproto_dpif|DBG| Bucket 0: weight=5, target=1.60 hits=2
516 ofproto_dpif|DBG| Bucket 1: weight=10, target=3.20 hits=3
517 ofproto_dpif|DBG| Bucket 2: weight=25, target=8.00 hits=8
518 ofproto_dpif|DBG| Bucket 3: weight=60, target=19.20 hits=19
519 ofproto_dpif|DBG| Bucket 4: weight=0, target=0.00 hits=0
520 ofproto_dpif|DBG|Use dp_hash with 32 hash values using algorithm 1.
522 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
524 # Try 1000 different flows and make sure that they get distributed according to weights
525 for d1 in 0 1 2 3 4 5 6 7 8 9 ; do
526 for d2 in 0 1 2 3 4 5 6 7 8 9 ; do
527 for s in 0 1 2 3 4 5 6 7 8 9 ; do
528 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.1.$s,dst=192.168.$d1.$d2,proto=6,tos=0,ttl=128,frag=no),tcp(src=1000$s,dst=1000)"
529 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
534 # Check balanced distribution over 32 dp_hash values
535 AT_CHECK([ovs-appctl dpctl/dump-flows | sort | strip_ufid | strip_used | check_dpflow_stats 32 4 dp_hash], [0], [dnl
536 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:999, bytes:117882, used:0.0s, actions:hash(sym_l4(0)),recirc(0x1)
537 n_flows=ok n_buckets=ok
540 # Check that actual distribution over the buckets is reasonably accurate:
541 ideal weights dp_hash values
542 # bucket0: 5%*1000 = 50 2/32*1000 = 63
543 # bucket1: 10%*1000 = 100 3/32*1000 = 94
544 # bucket2: 25%*1000 = 250 8/32*1000 = 250
545 # bucket3: 60%*1000 = 600 19/32*1000 = 594
548 ovs-appctl time/warp 1000
549 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-group-stats br0 | sed 's/duration=[[0-9]]\.[[0-9]]*s,//' | check_group_stats 40 80 200 500],
560 AT_SETUP([ofproto-dpif - select group with explicit dp_hash selection method])
563 add_of_ports br0 1 10 11
565 ovs-appctl vlog/set ofproto_dpif:file:dbg
566 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11'])
567 AT_CHECK([grep -A6 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
568 ofproto_dpif|DBG|Constructing select group 1234
569 ofproto_dpif|DBG|Selection method specified: dp_hash.
570 ofproto_dpif|DBG| Minimum weight: 1, total weight: 2
571 ofproto_dpif|DBG| Using 16 hash values:
572 ofproto_dpif|DBG| Bucket 0: weight=1, target=8.00 hits=8
573 ofproto_dpif|DBG| Bucket 1: weight=1, target=8.00 hits=8
574 ofproto_dpif|DBG|Use dp_hash with 16 hash values using algorithm 0.
577 # Fall back to legacy hash with zero buckets
578 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1235,type=select,selection_method=dp_hash'])
579 AT_CHECK([grep -A3 "Constructing select group 1235" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
580 ofproto_dpif|DBG|Constructing select group 1235
581 ofproto_dpif|DBG|Selection method specified: dp_hash.
582 ofproto_dpif|DBG| Don't apply dp_hash method without buckets.
583 ofproto_dpif|DBG|Falling back to default hash method.
586 # Fall back to legacy hash with zero buckets
587 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1236,type=select,selection_method=dp_hash,bucket=weight=1,output:10,bucket=weight=1000,output:11'])
588 AT_CHECK([grep -A4 "Constructing select group 1236" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
589 ofproto_dpif|DBG|Constructing select group 1236
590 ofproto_dpif|DBG|Selection method specified: dp_hash.
591 ofproto_dpif|DBG| Minimum weight: 1, total weight: 1001
592 ofproto_dpif|DBG| Too many hash values required: 1024
593 ofproto_dpif|DBG|Falling back to default hash method.
599 AT_SETUP([ofproto-dpif - select group with legacy hash selection method])
602 add_of_ports br0 1 10 11
604 ovs-appctl vlog/set ofproto_dpif:file:dbg
605 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=hash,bucket=output:10,bucket=output:11'])
606 AT_CHECK([grep -A2 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
607 ofproto_dpif|DBG|Constructing select group 1234
608 ofproto_dpif|DBG|Selection method specified: hash.
609 ofproto_dpif|DBG|No hash fields. Falling back to default hash method.
612 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
614 # Try 16 flows with differing default hash values.
616 for s in 1 2 3 4 ; do
617 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.0.$s,dst=192.168.1.$d,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
618 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
622 # Check that the packets installed 16 data path flows and each of the two
623 # buckets is hit at least once.
624 AT_CHECK([ovs-appctl dpctl/dump-flows | strip_ufid | strip_used | sort | check_dpflow_stats 16 2], [0], [dnl
625 n_flows=ok n_buckets=ok
631 AT_SETUP([ofproto-dpif - select group with custom hash selection method])
634 add_of_ports br0 1 10 11
636 # Check that parse failures after 'fields' parsing work
637 AT_CHECK([ovs-ofctl -O OpenFlow10 add-group br0 'group_id=1,type=select,fields(eth_dst),bukket=output:10'], [1], ,[dnl
638 ovs-ofctl: unknown keyword bukket
641 # Check that fields are rejected without "selection_method=hash".
642 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1235,type=select,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11'], 1, [], [dnl
643 ovs-ofctl: fields may only be specified with "selection_method=hash"
646 # Check that selection_method_param without selection_method is rejected.
647 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1235,type=select,selection_method_param=1,bucket=output:10,bucket=output:11'], 1, [], [dnl
648 ovs-ofctl: selection_method_param is only allowed with "selection_method"
651 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11'])
652 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
654 # Try 16 flows with differing custom hash and check that they give rise to
655 # 16 data path flows and each of the two buckets is hit at least once
656 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
657 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:$d),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
658 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
661 AT_CHECK([ovs-appctl dpctl/dump-flows | strip_ufid | strip_used | sort | check_dpflow_stats 16 2], [0], [dnl
662 n_flows=ok n_buckets=ok
665 AT_CHECK([ovs-appctl revalidator/purge], [0])
667 # Try 16 flows that differ only in fields that are not part of the custom
668 # hash and check that there is only a single datapath flow
669 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
670 pkt="in_port(1),eth(src=50:54:00:00:00:$d,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
671 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
674 AT_CHECK([ovs-appctl dpctl/dump-flows | grep -c recirc_id], [0], [dnl
681 AT_SETUP([ofproto-dpif - fast failover group])
683 add_of_ports br0 1 10 11
684 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=ff,bucket=watch_port:10,output:10,bucket=watch_port:11,output:11'])
685 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
686 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
687 AT_CHECK([tail -1 stdout], [0],
688 [Datapath actions: 10
693 AT_SETUP([ofproto-dpif - group stats single bucket])
695 add_of_ports br0 1 10 11
696 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
697 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
701 pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
702 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
705 AT_CHECK([ovs-appctl revalidator/purge], [0])
706 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
707 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
708 group_id=1234,ref_count=1,packet_count=3,byte_count=318,bucket0:packet_count=3,byte_count=318,bucket1:packet_count=0,byte_count=0
709 OFPST_GROUP reply (OF1.2):
714 AT_SETUP([ofproto-dpif - group stats all buckets])
716 add_of_ports br0 1 10 11
717 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
718 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
722 pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
723 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
726 AT_CHECK([ovs-appctl revalidator/purge], [0])
727 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
728 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
729 group_id=1234,ref_count=1,packet_count=3,byte_count=318,bucket0:packet_count=3,byte_count=318,bucket1:packet_count=3,byte_count=318
730 OFPST_GROUP reply (OF1.2):
735 AT_SETUP([ofproto-dpif - registers])
737 add_of_ports br0 20 21 22 33 90
738 AT_DATA([flows.txt], [dnl
739 in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
740 in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
741 in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
742 in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
744 in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
745 in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
746 in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
747 in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
748 in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
749 in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
750 in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
751 in_port=9,reg0=0xdeadbeef actions=output:20
752 in_port=10,reg1=0xdeadbeef actions=output:21
753 in_port=11,reg2=0xeef22dea actions=output:22
755 dnl Sanilty check all registers
756 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
757 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
758 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
759 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
762 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
763 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
764 AT_CHECK([tail -1 stdout], [0],
765 [Datapath actions: 20,21,22,33
770 dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
771 dnl in the manner documented in ovs-ofctl(8).
772 AT_SETUP([ofproto-dpif - extended registers])
774 add_of_ports br0 1 2 3
775 AT_DATA([flows.txt], [dnl
776 table=0 actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
777 table=1,reg2=0xfedcba98,reg3=0x76543210 actions=2
779 # These low-priority rules shouldn't match. They're here only to make really
780 # sure that the test fails if either of the above rules fails to match.
781 table=0,priority=0 actions=3
782 table=1,priority=0 actions=3
784 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
785 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
786 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
791 dnl Tests that the standardized xxregs are mapped onto the legacy OVS
792 dnl registers in the manner documented in ovs-ofctl(8).
793 AT_SETUP([ofproto-dpif - extended-extended registers])
795 add_of_ports br0 1 2 3
796 AT_DATA([flows.txt], [dnl
797 table=0 actions=load:0x0123456789abcdeffedcba9876543210->NXM_NX_XXREG1[[]],resubmit(,1)
798 table=1,reg4=0x01234567,reg5=0x89abcdef,reg6=0xfedcba98,reg7=0x76543210 actions=2
800 # These low-priority rules shouldn't match. They're here only to make really
801 # sure that the test fails if either of the above rules fails to match.
802 table=0,priority=0 actions=3
803 table=1,priority=0 actions=3
805 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
806 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
807 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
812 AT_SETUP([ofproto-dpif - load and move order])
814 add_of_ports br0 1 10 11
815 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,move:NXM_NX_REG1[[]]->NXM_OF_IP_SRC[[]],bucket=output:11'])
816 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(load:0xffffffff->NXM_NX_REG1[[]],move:NXM_NX_REG1[[]]->NXM_NX_REG2[[]],group:1234)'])
817 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
818 AT_CHECK([tail -2 stdout], [0],
819 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
820 Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
825 dnl Tests that 1.5 copy-field can copy into the standardized xregs.
826 AT_SETUP([ofproto-dpif - copy-field into extended registers])
828 add_of_ports br0 1 2 3
829 AT_DATA([flows.txt], [dnl
830 table=0 actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
831 table=1,xreg0=0x0000505400000005 actions=2
833 # These low-priority rules shouldn't match. They're here only to make really
834 # sure that the test fails if either of the above rules fails to match.
835 table=0,priority=0 actions=3
836 table=1,priority=0 actions=3
838 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
839 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
840 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
845 dnl Tests that 1.5 set-field with mask in the metadata register.
846 AT_SETUP([ofproto-dpif - masked set-field into metadata])
848 add_of_ports br0 1 2 3
849 AT_DATA([flows.txt], [dnl
850 table=0 actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1)
851 table=1 actions=set_field:0x6b/0xff->metadata,goto_table(2)
852 table=2,metadata=0xfafafafa5a5a5a6b actions=2
854 # These low-priority rules shouldn't match. They're here only to make really
855 # sure that the test fails if either of the above rules fails to match.
856 table=0,priority=0 actions=3
857 table=1,priority=0 actions=3
858 table=2,priority=0 actions=3
860 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
861 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
862 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
868 AT_SETUP([ofproto-dpif - actset_output])
870 add_of_ports br0 1 2 3 4 5 6 7 8 9 10 11 12 13
871 AT_DATA([flows.txt], [dnl
872 table=0,actset_output=unset actions=write_actions(output(2)),goto_table(1)
873 table=1 actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
875 # Verify that actset_output got set.
876 table=2,priority=20,actset_output=2 actions=4,goto_table(3)
877 table=2,priority=10 actions=5,goto_table(3)
879 # Verify that xreg0 got copied properly from actset_output.
880 table=3,priority=20,xreg0=2 actions=6,goto_table(4)
881 table=3,priority=10 actions=7,goto_table(4)
883 # Verify that xxreg0 got copied properly from actset_output.
884 table=3,priority=20,xxreg0=2 actions=6,goto_table(4)
885 table=3,priority=10 actions=7,goto_table(4)
887 # Verify that adding a group action unsets actset_output,
888 # even if output follows group.
889 table=4 actions=write_actions(group(5),output(10)),goto_table(5)
890 table=5,priority=20,actset_output=unset actions=8,goto_table(6)
891 table=5,priority=10 actions=9,goto_table(6)
893 # Verify that adding another output action doesn't change actset_output
894 # (since there's still a group).
895 table=6 actions=write_actions(output(3)),goto_table(7)
896 table=7,priority=20,actset_output=unset actions=10,goto_table(8)
897 table=7,priority=10 actions=11,goto_table(8)
899 # Verify that clearing the action set, then writing an output action,
900 # causes actset_output to be set again.
901 table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
902 table=9,priority=20,actset_output=2 actions=12
903 table=9,priority=10 actions=13
905 AT_CHECK([ovs-ofctl -O OpenFlow13 add-group br0 'group_id=5,type=all,bucket=output:1'])
906 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
907 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
908 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
913 AT_SETUP([ofproto-dpif - push-pop])
915 add_of_ports br0 20 21 22 33 90
916 AT_DATA([flows.txt], [dnl
917 in_port=90 actions=load:20->NXM_NX_REG0[[0..7]],load:21->NXM_NX_REG1[[0..7]],load:22->NXM_NX_REG2[[0..7]], load:33->NXM_NX_REG3[[0..7]], push:NXM_NX_REG0[[]], push:NXM_NX_REG1[[0..7]],push:NXM_NX_REG2[[0..15]], push:NXM_NX_REG3[[]], resubmit:2, resubmit:3, resubmit:4, resubmit:5
918 in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
919 in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
920 in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
921 in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
924 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
925 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
926 AT_CHECK([tail -1 stdout], [0],
927 [Datapath actions: 33,22,21,20
932 AT_SETUP([ofproto-dpif - output])
934 add_of_ports br0 1 9 10 11 55 66 77 88
935 AT_DATA([flows.txt], [dnl
936 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
937 in_port=2 actions=output:9
938 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
939 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
940 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
941 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
942 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
943 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
945 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
946 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
947 AT_CHECK([tail -1 stdout], [0],
948 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
953 AT_SETUP([ofproto-dpif - dec_ttl])
955 add_of_ports br0 1 2 3 4
956 AT_DATA([flows.txt], [dnl
957 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
958 table=1 in_port=1 action=dec_ttl,output:3
960 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
961 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
962 AT_CHECK([tail -4 stdout], [0], [
963 Final flow: ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1
964 Megaflow: recirc_id=0,eth,ip,in_port=1,nw_ttl=2,nw_frag=no
965 Datapath actions: set(ipv4(ttl=1)),2,userspace(pid=0,controller(reason=2,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535)),4
967 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'], [0], [stdout])
968 AT_CHECK([tail -2 stdout], [0],
969 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_ttl=3,nw_frag=no
970 Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
972 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'], [0], [stdout])
973 AT_CHECK([tail -2 stdout], [0],
974 [Megaflow: recirc_id=0,eth,ipv6,in_port=1,nw_ttl=128,nw_frag=no
975 Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
978 AT_CAPTURE_FILE([ofctl_monitor.log])
979 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
981 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)'
983 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
984 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
985 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
986 ip,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1
991 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
992 dnl buffer to be resized just before pushing the id of the dec_ttl action.
993 dnl Thus the implementation must account for this by using the
994 dnl reallocated buffer rather than the original buffer.
996 dnl A number of similar rules are added to try and exercise
997 dnl xrealloc sufficiently that it returns a different base pointer
998 AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
1001 (for i in `seq 0 255`; do
1002 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
1004 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1008 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
1009 dnl buffer to be resized just before pushing the id of the dec_ttl action.
1010 dnl Thus the implementation must account for this by using the
1011 dnl reallocated buffer rather than the original buffer.
1013 dnl A number of similar rules are added to try and exercise
1014 dnl xrealloc sufficiently that it returns a different base pointer
1015 AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
1018 (for i in `seq 0 255`; do
1019 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
1021 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1025 dnl A note action at offset 24 in ofpacts will cause the ofpacts
1026 dnl buffer to be resized just before pushing the id of the dec_ttl action.
1027 dnl Thus the implementation must account for this by using the
1028 dnl reallocated buffer rather than the original buffer.
1030 dnl A number of similar rules are added to try and exercise
1031 dnl xrealloc sufficiently that it returns a different base pointer
1032 AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
1035 (for i in `seq 0 255`; do
1036 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
1038 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1042 dnl As of OVS-2.5, a note action after 4 set_field actions are likely to
1043 dnl trigger ofpbuf reallocation during decode (~1KB into ofpacts buffer).
1044 dnl Using `make check-valgrind' here checks for use-after-free in this
1046 AT_SETUP([ofproto-dpif - note action deep inside ofpacts])
1048 AT_CHECK([ovs-ofctl add-flow br0 'actions=set_field:0x1->metadata,set_field:0x2->metadata,set_field:0x3->metadata,set_field:0x4->metadata,note:00000000000000000000000000000000,note:00000000000000000000000000000000'])
1052 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
1054 add_of_ports br0 1 2
1056 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
1058 # "in_port" defaults to OFPP_NONE if it's not specified.
1059 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,icmp_type=8,icmp_code=0"
1060 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
1061 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
1070 AT_SETUP([ofproto-dpif - DSCP])
1071 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
1073 AT_DATA([flows.txt], [dnl
1074 actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL
1076 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1077 AT_CHECK([ovs-vsctl -- \
1078 set Port p1 qos=@newqos --\
1079 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
1080 --id=@q1 create Queue dscp=1 --\
1081 --id=@q2 create Queue dscp=2], [0], [ignore])
1082 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
1083 AT_CHECK([tail -2 stdout], [0],
1084 [Megaflow: recirc_id=0,skb_priority=0,eth,ip,in_port=9,nw_tos=252,nw_frag=no
1085 Datapath actions: dnl
1087 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
1088 set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
1090 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
1091 set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
1092 set(ipv4(tos=0/0xfc)),1,100
1097 AT_SETUP([ofproto-dpif - output/flood flags])
1099 add_of_ports br0 1 2 3 4 5 6 7
1101 AT_DATA([flows.txt], [dnl
1102 in_port=local actions=local,flood
1103 in_port=1 actions=flood
1104 in_port=2 actions=all
1105 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
1106 in_port=4 actions=enqueue:LOCAL:1,enqueue:1:1,enqueue:2:1,enqueue:3:2,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1
1108 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1109 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
1110 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
1112 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
1113 AT_CHECK([tail -1 stdout \
1114 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
1122 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
1123 AT_CHECK([tail -1 stdout \
1124 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
1132 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
1133 AT_CHECK([tail -1 stdout \
1134 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
1143 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
1144 AT_CHECK([tail -1 stdout], [0],
1145 [Datapath actions: 100,1,2,4,6,7
1148 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
1149 AT_CHECK([tail -1 stdout], [0],
1150 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
1155 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
1156 OVS_VSWITCHD_START([dnl
1157 add-port br0 p1 -- set Interface p1 type=dummy
1159 on_exit 'kill `cat ovs-ofctl.pid`'
1161 AT_CAPTURE_FILE([ofctl_monitor.log])
1163 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1166 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(syn)'
1168 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1169 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1170 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1171 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1172 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:2e7e
1174 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1175 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:2e7e
1177 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1178 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:2e7e
1181 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1182 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1189 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
1190 OVS_VSWITCHD_START([dnl
1191 add-port br0 p1 -- set Interface p1 type=dummy
1193 on_exit 'kill `cat ovs-ofctl.pid`'
1195 AT_CAPTURE_FILE([ofctl_monitor.log])
1196 AT_CHECK([ovs-ofctl del-flows br0])
1198 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1200 dnl Test that missed packets are dropped
1202 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack,syn)'
1204 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1206 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1209 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1210 AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1211 OFPST_FLOW reply (OF1.3):
1217 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
1218 OVS_VSWITCHD_START([dnl
1219 add-port br0 p1 -- set Interface p1 type=dummy
1221 on_exit 'kill `cat ovs-ofctl.pid`'
1223 AT_CAPTURE_FILE([ofctl_monitor.log])
1224 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1226 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1229 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(urg|rst)'
1231 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1232 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1233 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1234 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1235 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:2e5c
1237 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1238 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:2e5c
1240 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1241 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:2e5c
1244 AT_CHECK([ovs-appctl revalidator/purge], [0])
1245 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1246 n_packets=3, n_bytes=162, actions=goto_table:1
1247 OFPST_FLOW reply (OF1.2):
1253 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
1254 OVS_VSWITCHD_START([dnl
1255 add-port br0 p1 -- set Interface p1 type=dummy
1257 on_exit 'kill `cat ovs-ofctl.pid`'
1259 AT_CAPTURE_FILE([ofctl_monitor.log])
1260 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1262 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1265 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1268 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1269 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1272 AT_CHECK([ovs-appctl revalidator/purge], [0])
1273 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1274 n_packets=3, n_bytes=354, actions=resubmit(1,1)
1275 OFPST_FLOW reply (OF1.2):
1281 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
1282 OVS_VSWITCHD_START([dnl
1283 add-port br0 p1 -- set Interface p1 type=dummy
1285 on_exit 'kill `cat ovs-ofctl.pid`'
1287 AT_CAPTURE_FILE([ofctl_monitor.log])
1288 AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
1289 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1291 dnl Miss table 0, Hit table 1
1292 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1295 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1297 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1298 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1300 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1301 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1302 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1304 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1305 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1307 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1308 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1311 dnl Hit table 0, Miss all other tables, sent to controller
1312 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1315 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1317 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1318 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1320 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1321 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1322 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1324 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1325 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1327 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1328 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1331 AT_CHECK([ovs-appctl revalidator/purge], [0])
1332 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1333 table=1, n_packets=3, n_bytes=354, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1334 OFPST_FLOW reply (OF1.2):
1340 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
1341 OVS_VSWITCHD_START([dnl
1342 add-port br0 p1 -- set Interface p1 type=dummy
1344 on_exit 'kill `cat ovs-ofctl.pid`'
1346 AT_CAPTURE_FILE([ofctl_monitor.log])
1347 AT_DATA([flows.txt], [dnl
1348 table=0 actions=goto_table(1)
1349 table=2 dl_src=10:11:11:11:11:11 actions=controller
1351 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1352 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1354 dnl Hit table 0, Miss table 1, Hit table 2
1355 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1358 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1360 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1361 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1363 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1364 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1365 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1367 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1368 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1370 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1371 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1374 dnl Hit table 1, Miss all other tables, sent to controller
1375 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1378 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1380 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1381 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1383 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1384 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1385 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1387 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1388 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1390 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1391 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1394 AT_CHECK([ovs-appctl revalidator/purge], [0])
1395 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1396 n_packets=6, n_bytes=708, actions=goto_table:1
1397 table=2, n_packets=3, n_bytes=354, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1398 OFPST_FLOW reply (OF1.2):
1404 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1405 OVS_VSWITCHD_START([dnl
1406 add-port br0 p1 -- set Interface p1 type=dummy
1408 on_exit 'kill `cat ovs-ofctl.pid`'
1410 AT_CAPTURE_FILE([ofctl_monitor.log])
1411 AT_DATA([flows.txt], [dnl
1412 table=0 actions=resubmit(1,1)
1413 table=2 dl_src=10:11:11:11:11:11 actions=controller
1415 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1416 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1418 dnl Hit table 0, Miss table 1, Dropped
1419 AT_CHECK([ovs-ofctl monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1422 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1424 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1426 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1429 dnl Hit table 1, Dropped
1430 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1433 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1435 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1437 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1440 AT_CHECK([ovs-appctl revalidator/purge], [0])
1441 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1442 n_packets=6, n_bytes=708, actions=resubmit(1,1)
1443 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1444 OFPST_FLOW reply (OF1.2):
1450 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1451 OVS_VSWITCHD_START([dnl
1452 add-port br0 p1 -- set Interface p1 type=dummy
1454 on_exit 'kill `cat ovs-ofctl.pid`'
1456 AT_CAPTURE_FILE([ofctl_monitor.log])
1457 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1459 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1461 dnl Test that missed packets are dropped
1463 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1465 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1467 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1470 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1471 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1478 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1479 OVS_VSWITCHD_START([dnl
1480 add-port br0 p1 -- set Interface p1 type=dummy
1482 on_exit 'kill `cat ovs-ofctl.pid`'
1484 AT_CAPTURE_FILE([ofctl_monitor.log])
1485 AT_CHECK([ovs-ofctl del-flows br0])
1486 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1487 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1489 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1491 dnl Test that missed packets are dropped
1493 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1495 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1497 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1500 AT_CHECK([ovs-appctl revalidator/purge], [0])
1501 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1502 n_packets=3, n_bytes=354, actions=goto_table:1
1503 OFPST_FLOW reply (OF1.2):
1509 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1510 OVS_VSWITCHD_START([dnl
1511 add-port br0 p1 -- set Interface p1 type=dummy
1513 on_exit 'kill `cat ovs-ofctl.pid`'
1515 AT_CAPTURE_FILE([ofctl_monitor.log])
1516 AT_CHECK([ovs-ofctl del-flows br0])
1517 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1518 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1520 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1522 dnl Test that missed packets are dropped
1524 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1526 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1528 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1531 AT_CHECK([ovs-appctl revalidator/purge], [0])
1532 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1533 n_packets=3, n_bytes=354, actions=resubmit(1,1)
1534 OFPST_FLOW reply (OF1.2):
1540 AT_SETUP([ofproto-dpif - controller])
1541 OVS_VSWITCHD_START([dnl
1542 add-port br0 p1 -- set Interface p1 type=dummy
1544 on_exit 'kill `cat ovs-ofctl.pid`'
1546 AT_CAPTURE_FILE([ofctl_monitor.log])
1547 AT_DATA([flows.txt], [dnl
1548 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1549 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1550 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1552 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1553 cookie=0x4 table=2 in_port=81 actions=load:2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,controller,resubmit(82,3)
1554 cookie=0x5 table=3 in_port=82 actions=load:3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,controller,resubmit(83,4)
1555 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1556 cookie=0x7 table=5 in_port=84 actions=load:5->NXM_NX_REG4[[]],load:6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,controller,resubmit(85,6)
1557 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1558 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1559 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1560 cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[[]],controller,load:0xc0a88001->OXM_OF_ARP_SPA[[]],controller,load:0x404444444441->OXM_OF_ARP_THA[[]],load:0x01010101->OXM_OF_ARP_SPA[[]],load:0x02020202->OXM_OF_ARP_TPA[[]],controller
1562 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1565 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1568 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1570 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1571 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1573 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1574 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1575 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1577 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1578 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1580 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1581 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1584 dnl Singleton controller action.
1585 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1588 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
1590 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1591 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1593 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1594 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1595 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
1596 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1597 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
1598 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1599 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
1602 dnl Modified controller action.
1603 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1606 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=30:33:33:33:33:33,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x001)'
1608 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1609 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1611 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1612 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1613 tcp,dl_vlan=15,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:2e7e
1615 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1616 tcp,dl_vlan=15,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:2e7e
1618 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1619 tcp,dl_vlan=15,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:2e7e
1622 dnl Modified VLAN controller action.
1623 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1626 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:41,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1628 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1629 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1631 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1632 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1633 ip,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1635 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1636 ip,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1638 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1639 ip,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1643 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1646 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)'
1648 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1649 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1651 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1652 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1653 tcp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:2e7d
1655 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=58 reg0=0x1,in_port=1 (via action) data_len=58 (unbuffered)
1656 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:2e7d
1658 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=58 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=58 (unbuffered)
1659 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:2e7d
1661 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=58 (unbuffered)
1662 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:2e7d
1664 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=58 (unbuffered)
1665 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:4880
1667 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1668 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:6082
1670 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1671 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=fin tcp_csum:6035
1673 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1674 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:5fea
1676 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1677 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:5fea
1681 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1684 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
1686 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1687 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1689 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1690 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1691 udp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1693 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1694 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1696 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=64 (unbuffered)
1697 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1699 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=64 (unbuffered)
1700 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1702 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=64 (unbuffered)
1703 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37
1705 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1706 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439
1708 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1709 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec
1711 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1712 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1714 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1715 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1718 dnl Modified ARP controller action.
1719 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1722 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
1725 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1726 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1727 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1728 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1729 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1730 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1731 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1732 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1733 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1734 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1735 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1736 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1737 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1738 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1739 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1740 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1741 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1742 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1743 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1744 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1745 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1748 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1751 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1754 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04'
1757 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1758 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1759 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1760 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1761 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1762 sctp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1764 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 reg0=0x1,in_port=1 (via action) data_len=102 (unbuffered)
1765 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1767 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=102 (unbuffered)
1768 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1770 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=102 (unbuffered)
1771 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1773 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=102 (unbuffered)
1774 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1776 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1777 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1779 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1780 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:dd778f5f
1782 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1783 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
1785 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1786 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
1789 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1790 cookie=0x1, n_packets=3, n_bytes=212, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1791 cookie=0x2, n_packets=3, n_bytes=162, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1792 cookie=0x3, table=1, n_packets=3, n_bytes=212, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1793 cookie=0x4, table=2, n_packets=3, n_bytes=212, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1794 cookie=0x5, table=3, n_packets=3, n_bytes=212, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1795 cookie=0x6, table=4, n_packets=3, n_bytes=212, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1796 cookie=0x7, table=5, n_packets=3, n_bytes=212, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6)
1797 cookie=0x8, table=6, n_packets=3, n_bytes=212, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1798 cookie=0x9, table=7, n_packets=3, n_bytes=212, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1799 cookie=0xa, n_packets=3, n_bytes=102, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1800 cookie=0xd, n_packets=3, n_bytes=126, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535
1801 n_packets=3, n_bytes=162, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1809 AT_SETUP([ofproto-dpif - controller with slow-path action])
1811 add_of_ports br0 1 2
1813 AT_CHECK([ovs-ofctl add-flow br0 "in_port=1,actions=debug_slow,controller"])
1815 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1818 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1821 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 3])
1822 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1824 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1825 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1826 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1828 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1829 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1831 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1832 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:4a2c
1839 AT_SETUP([ofproto-dpif - controller action without megaflows])
1843 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,action=controller])
1844 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [dnl
1848 AT_CAPTURE_FILE([ofctl_monitor.log])
1849 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1852 AT_CHECK([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)'])
1855 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
1856 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1858 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
1859 flow-dump from non-dpdk interfaces:
1860 packets:1, bytes:14, used:0.001s, actions:userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
1863 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1864 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1865 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
1866 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1867 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
1870 AT_CHECK([ovs-appctl revalidator/purge])
1871 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1873 dnl Add a controller meter.
1874 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=controller pktps stats bands=type=drop rate=2'])
1876 dnl Advance time by 1 second.
1877 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1879 for i in `seq 1 8`; do
1880 AT_CHECK([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(0x4321)'])
1883 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
1884 flow-dump from non-dpdk interfaces:
1885 packets:7, bytes:98, used:0.001s, actions:sample(sample=100.0%,actions(meter(0),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=2,rule_cookie=0,controller_id=0,max_len=65535))))
1888 AT_CHECK([ovs-appctl time/warp 1], [0], [ignore])
1889 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1891 dnl Out of 8 packets we sent, two were passed by the rate limiter, and
1892 dnl the rest of packets were blocked.
1893 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1894 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1895 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x4321
1896 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1897 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x4321
1899 dnl Check meter stats to make it gives the same picture;
1900 dnl 7 packets hit the meter, but 6 packets are dropped by band0.
1901 AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl
1902 OFPST_METER reply (OF1.3) (xid=0x2):
1903 meter:controller flow_count:0 packet_in_count:8 byte_in_count:112 duration:0.0s bands:
1904 0: packet_count:6 byte_count:84
1910 AT_SETUP([ofproto-dpif - MPLS handling])
1911 OVS_VSWITCHD_START([dnl
1912 add-port br0 p1 -- set Interface p1 type=dummy
1914 on_exit 'kill `cat ovs-ofctl.pid`'
1916 AT_CAPTURE_FILE([ofctl_monitor.log])
1917 AT_DATA([flows.txt], [dnl
1918 cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1919 cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller
1920 cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1921 cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1922 cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller
1923 cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller
1924 cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller
1925 cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller
1926 cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
1927 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1928 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1929 cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller
1931 cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1932 cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1933 cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1934 cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller
1935 cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,1,0,OXM_OF_IPV4_SRC[[0..7]]),controller
1936 cookie=0xd dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,OXM_OF_IPV4_SRC[[0..15]],slaves:1,2),controller
1937 cookie=0xd dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,OXM_OF_IPV4_SRC[[]]=OXM_OF_IPV4_DST[[]]),controller
1939 cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1940 cookie=0xd table=1 arp actions=controller
1942 cookie=0xdeadbeef table=2 dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
1943 cookie=0xd dl_src=60:66:66:66:00:09 actions=resubmit(,2),controller
1944 cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1945 cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1947 cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1948 cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1949 cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1951 cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1952 cookie=0xe dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1953 cookie=0xe dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1955 cookie=0xe dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1956 cookie=0xe dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1957 cookie=0xe dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1959 cookie=0xf dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1960 cookie=0xf dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1961 cookie=0xf dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1963 cookie=0x5 dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1964 cookie=0x5 dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1965 cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
1967 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1969 dnl Modified MPLS controller action.
1970 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1973 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=17,tos=0,ttl=64,frag=no),udp(src=7777,dst=80)'
1975 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1976 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1978 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1979 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=110 in_port=1 (via action) data_len=110 (unbuffered)
1980 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1982 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=110 in_port=1 (via action) data_len=110 (unbuffered)
1983 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1985 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=110 in_port=1 (via action) data_len=110 (unbuffered)
1986 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1989 dnl Modified MPLS controller action.
1990 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1993 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1995 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1996 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1998 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1999 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
2000 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
2002 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
2003 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
2005 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
2006 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
2009 dnl Modified MPLS controller action.
2010 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2012 dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1)
2015 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:43,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'
2017 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2018 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2020 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2021 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2022 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
2024 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2025 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
2027 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2028 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
2031 dnl Modified MPLS controller action.
2032 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2035 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))'
2037 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2038 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2040 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2041 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2042 mpls,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
2044 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2045 mpls,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
2047 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2048 mpls,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
2051 dnl Modified MPLS controller action.
2052 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2055 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:45,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
2057 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2058 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2060 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2061 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2062 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
2064 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2065 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
2067 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2068 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
2071 dnl Modified MPLS controller action.
2072 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2075 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:46,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
2077 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2078 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2080 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2081 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2082 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
2084 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2085 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
2087 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2088 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
2091 dnl Modified MPLS controller action.
2092 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2095 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:47,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
2097 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2098 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2100 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2101 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2102 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
2104 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2105 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
2107 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2108 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
2111 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2113 dnl Modified MPLS controller action.
2114 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2117 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:49,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=64,bos=1)'
2119 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2120 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2122 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2123 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2124 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
2126 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2127 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
2129 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2130 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
2133 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2135 dnl Modified MPLS controller action.
2136 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2139 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:48,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
2141 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2142 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2144 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2145 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2146 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
2148 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2149 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
2151 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2152 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
2155 dnl Modified MPLS actions.
2156 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2159 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:55:55:55:55:55,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)'
2161 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2162 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2164 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2165 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
2166 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
2168 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
2169 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
2171 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
2172 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
2175 dnl Modified MPLS ipv6 controller action.
2176 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2179 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=70:77:77:77:77:77,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'
2181 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2182 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2184 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2185 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2186 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
2188 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2189 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
2191 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2192 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
2196 dnl Modified MPLS pop action.
2197 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
2198 dnl 60:66:66:66:66:66 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2199 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
2201 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2204 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 66 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2207 # ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=60:66:66:66:66:66,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=100,bos=1)'
2209 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2210 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2212 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2213 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2214 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2216 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2217 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2219 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2220 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2223 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2225 dnl Modified MPLS pop action.
2226 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2227 dnl 60:66:66:66:00:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2228 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2229 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2230 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2233 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2235 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2236 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2238 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2239 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2240 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2242 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2243 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2245 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2246 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2249 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2251 dnl Modified MPLS pop action.
2252 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2253 dnl 60:66:66:66:00:02 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2254 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2255 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2256 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2259 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 02 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2261 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2262 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2264 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2265 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2266 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2268 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2269 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2271 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2272 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2275 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2277 dnl Modified MPLS pop action.
2278 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2279 dnl 60:66:66:66:00:03 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2280 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2281 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2282 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2285 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 03 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2287 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2288 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2290 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2291 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2292 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
2294 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2295 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
2297 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2298 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
2301 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2303 dnl Modified MPLS pop action.
2304 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2305 dnl 60:66:66:66:00:04 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2306 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2307 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2308 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2311 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 04 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2313 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2314 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2316 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2317 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2318 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
2320 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2321 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
2323 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2324 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
2327 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2329 dnl Modified MPLS pop action.
2330 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2331 dnl 60:66:66:66:00:05 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2332 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2333 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2334 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2337 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 05 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2339 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2340 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2342 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2343 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2344 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.0,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2346 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2347 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.0,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2349 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2350 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.0,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2353 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2355 dnl Modified MPLS pop action.
2356 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2357 dnl 60:66:66:66:00:06 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2358 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2359 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2360 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2363 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 06 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2365 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2366 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2368 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2369 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2370 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2372 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2373 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2375 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2376 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2379 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2381 dnl Modified MPLS pop action.
2382 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2383 dnl 60:66:66:66:00:07 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2384 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2385 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2386 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2389 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 07 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2391 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2392 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2394 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2395 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2396 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2398 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2399 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2401 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2402 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2405 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2407 dnl Modified MPLS pop action.
2408 dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
2409 dnl 60:66:66:66:00:08 > ff:ff:ff:ff:ff:ff, ethertype MPLS unicast (0x8847), length 46: MPLS (label 20, exp 0, [S], ttl 32)
2410 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2413 ovs-appctl netdev-dummy/receive p1 'ff ff ff ff ff ff 60 66 66 66 00 08 88 47 00 01 41 20 00 01 08 00 06 04 00 02 60 66 66 66 00 08 c0 a8 00 01 ff ff ff ff ff ff ff ff ff ff'
2415 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2416 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2418 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2419 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2420 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2422 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2423 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2425 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2426 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2429 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2431 dnl Modified MPLS pop action.
2432 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2433 dnl 60:66:66:66:00:09 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2434 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2435 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2436 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2439 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 09 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2441 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2442 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2444 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2445 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2446 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2448 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2449 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2451 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2452 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2455 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2457 dnl Modified MPLS pop action.
2458 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2459 dnl 60:66:66:66:00:0a > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2460 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2461 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2462 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2465 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0a 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2467 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2468 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2470 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2471 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2472 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2474 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2475 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2477 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2478 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2481 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2483 dnl Modified MPLS pop action.
2484 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2485 dnl 60:66:66:66:00:0b > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2486 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2487 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2488 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2491 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0b 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2493 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2494 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2496 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2497 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2498 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2500 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2501 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2503 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2504 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2507 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2509 dnl Modified MPLS pop action.
2510 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2511 dnl 60:66:66:66:01:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2512 dnl (label 20, exp 0, [S], ttl 31)
2513 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2514 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2515 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2518 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 00 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2520 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2521 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2523 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2524 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2525 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2527 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2528 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2530 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2531 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2534 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2536 dnl Modified MPLS pop action.
2537 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2538 dnl 60:66:66:66:01:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2539 dnl (label 20, exp 0, [S], ttl 31)
2540 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2541 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2542 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2545 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 01 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2547 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2548 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2550 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2551 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2552 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2554 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2555 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2557 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2558 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2561 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2563 dnl Modified MPLS pop action.
2564 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2565 dnl 60:66:66:66:01:02 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2566 dnl (label 20, exp 0, [S], ttl 31)
2567 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2568 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2569 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2572 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 02 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2574 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2575 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2577 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2578 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2579 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2581 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2582 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2584 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2585 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2588 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2590 dnl Modified MPLS pop action.
2591 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2592 dnl 60:66:66:66:02:00 > 50:54:00:00:02:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2593 dnl (label 20, exp 0, [S], ttl 31)
2594 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2595 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2596 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2599 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 00 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2601 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2602 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2604 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2605 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2606 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2608 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2609 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2611 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2612 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2615 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2617 dnl Modified MPLS pop action.
2618 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2619 dnl 60:66:66:66:02:01 > 50:54:00:00:02:01, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2620 dnl (label 20, exp 0, [S], ttl 31)
2621 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2622 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2623 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2626 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 01 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2629 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2630 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2632 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2633 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2634 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2636 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2637 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2639 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2640 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2643 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2645 dnl Modified MPLS pop action.
2646 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2647 dnl 60:66:66:66:02:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2648 dnl (label 20, exp 0, [S], ttl 31)
2649 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2650 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2651 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2654 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 10 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2656 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2657 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2659 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2660 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2661 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2663 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2664 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2666 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2667 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2670 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2672 dnl Modified MPLS pop action.
2673 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2674 dnl 60:66:66:66:03:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2675 dnl (label 20, exp 0, ttl 31)
2676 dnl (label 20, exp 0, [S], ttl 30)
2677 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2678 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2679 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2682 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 00 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2684 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2685 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2687 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2688 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2689 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2691 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2692 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2694 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2695 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2698 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2700 dnl Modified MPLS pop action.
2701 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2702 dnl 60:66:66:66:03:01 > 50:54:00:00:00:00, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2703 dnl (label 20, exp 0, ttl 31)
2704 dnl (label 20, exp 0, [S], ttl 30)
2705 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2706 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2707 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2710 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 01 88 48 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2712 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2713 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2715 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2716 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2717 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2719 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2720 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2722 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2723 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2726 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2728 dnl Modified MPLS pop action.
2729 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2730 dnl 60:66:66:66:03:10 > 50:54:00:00:00:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2731 dnl (label 20, exp 0, ttl 31)
2732 dnl (label 20, exp 0, [S], ttl 30)
2733 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2734 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2735 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2738 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 10 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2740 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2741 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2743 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2744 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2745 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2747 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2748 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2750 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2751 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2754 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2756 dnl Modified MPLS pop action.
2757 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2758 dnl 60:66:66:66:04:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2759 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2760 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2761 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2764 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 00 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2766 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2767 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2769 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2770 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2771 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2773 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2774 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2776 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2777 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2780 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2782 dnl Modified MPLS pop action.
2783 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2784 dnl 60:66:66:66:04:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2785 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2786 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2787 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2790 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 01 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2792 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2793 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2795 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2796 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2797 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2799 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2800 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2802 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2803 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2806 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2808 dnl Modified MPLS pop action.
2809 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2810 dnl 60:66:66:66:04:10 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2811 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2812 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2813 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2816 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 10 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2818 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2819 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2821 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2822 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2823 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2825 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2826 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2828 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2829 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2832 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2834 dnl Modified MPLS pop action.
2835 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2836 dnl 60:66:66:66:05:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2837 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2838 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2839 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2842 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 00 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2845 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2846 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2848 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2849 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2850 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2852 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2853 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2855 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2856 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2859 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2861 dnl Modified MPLS pop action.
2862 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2863 dnl 60:66:66:66:05:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2864 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2865 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2866 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2869 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2871 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2872 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2874 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2875 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2876 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2878 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2879 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2881 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2882 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2885 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2887 dnl Modified MPLS pop action.
2888 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2889 dnl 60:66:66:66:05:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2890 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2891 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2892 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2895 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 10 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2898 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2899 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2901 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2902 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2903 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2905 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2906 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2908 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2909 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2912 AT_CHECK([ovs-appctl revalidator/purge], [0])
2913 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2914 cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,CONTROLLER:65535
2915 cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2916 cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2917 cookie=0xa, n_packets=3, n_bytes=102, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,CONTROLLER:65535
2918 cookie=0xa, n_packets=3, n_bytes=102, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),CONTROLLER:65535
2919 cookie=0xa, n_packets=3, n_bytes=102, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535
2920 cookie=0xa, n_packets=3, n_bytes=102, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535
2921 cookie=0xa, n_packets=3, n_bytes=102, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,CONTROLLER:65535
2922 cookie=0xa, n_packets=3, n_bytes=114, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2923 cookie=0xa, n_packets=3, n_bytes=318, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2924 cookie=0xa, n_packets=3, n_bytes=54, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2925 cookie=0xa, n_packets=3, n_bytes=54, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2926 cookie=0xb, n_packets=3, n_bytes=54, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2927 cookie=0xc, n_packets=3, n_bytes=162, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[[]],load:0x7->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2928 cookie=0xd, n_packets=3, n_bytes=138, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2929 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2930 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->NXM_OF_IP_DST[[]],CONTROLLER:65535
2931 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:NXM_OF_IP_DST[[]]->NXM_OF_IP_SRC[[]],CONTROLLER:65535
2932 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:NXM_OF_IP_DST[[]],pop:NXM_OF_IP_SRC[[]],CONTROLLER:65535
2933 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,1,0,NXM_OF_IP_SRC[[0..7]]),CONTROLLER:65535
2934 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,NXM_OF_IP_SRC[[0..15]],slaves:1,2),CONTROLLER:65535
2935 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]]),CONTROLLER:65535
2936 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=resubmit(,2),CONTROLLER:65535
2937 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,CONTROLLER:65535
2938 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,CONTROLLER:65535
2939 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
2940 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2941 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2942 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2943 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,CONTROLLER:65535
2944 cookie=0xd, table=1, n_packets=3, n_bytes=126, arp actions=CONTROLLER:65535
2945 cookie=0xdeadbeef, table=2, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
2946 cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2947 cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2948 cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,CONTROLLER:65535
2949 cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2950 cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2951 cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,CONTROLLER:65535
2952 cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2953 cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2960 AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2961 OVS_VSWITCHD_START([dnl
2962 add-port br0 p1 -- set Interface p1 type=dummy
2964 on_exit 'kill `cat ovs-ofctl.pid`'
2966 AT_CAPTURE_FILE([ofctl_monitor.log])
2967 AT_DATA([flows.txt], [dnl
2968 table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2969 table=1 ip,ip_dscp=8 actions=controller
2971 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2974 dnl Modified MPLS pop action.
2975 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2976 dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2977 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2978 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2979 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2982 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2984 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2985 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2987 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2988 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2989 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2991 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2992 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2994 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2995 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2998 AT_CHECK([ovs-appctl revalidator/purge], [0])
2999 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3000 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
3001 table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
3002 OFPST_FLOW reply (OF1.2):
3008 AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
3009 OVS_VSWITCHD_START([dnl
3010 add-port br0 p1 -- set Interface p1 type=dummy
3012 on_exit 'kill `cat ovs-ofctl.pid`'
3014 dnl N.B: The first (and only) action that accesses L3 data after the
3015 dnl pop_mpls action is present in write_actions. This exercises recirculation
3016 dnl triggered in write_actions due to a previous action not in write actions.
3017 AT_CAPTURE_FILE([ofctl_monitor.log])
3018 AT_DATA([flows.txt], [dnl
3019 mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
3021 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
3023 dnl Modified MPLS pop action.
3024 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
3025 dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
3026 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
3027 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
3028 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3031 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
3033 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3034 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3036 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
3037 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3038 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
3040 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3041 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
3043 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3044 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
3047 AT_CHECK([ovs-appctl revalidator/purge], [0])
3048 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3049 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
3050 OFPST_FLOW reply (OF1.2):
3056 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
3057 OVS_VSWITCHD_START([dnl
3058 add-port br0 p1 -- set Interface p1 type=dummy
3060 on_exit 'kill `cat ovs-ofctl.pid`'
3062 AT_CAPTURE_FILE([ofctl_monitor.log])
3063 # A table-miss flow has priority 0 and no match
3064 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3066 dnl Singleton controller action.
3067 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3070 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
3072 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3073 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3075 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3076 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3077 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3079 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3080 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3082 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3083 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3086 AT_CHECK([ovs-appctl revalidator/purge], [0])
3087 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3088 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3096 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
3097 OVS_VSWITCHD_START([dnl
3098 add-port br0 p1 -- set Interface p1 type=dummy
3100 on_exit 'kill `cat ovs-ofctl.pid`'
3102 AT_CAPTURE_FILE([ofctl_monitor.log])
3103 # A table-miss flow has priority 0 and no match
3104 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3106 dnl Singleton controller action.
3107 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3110 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
3112 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3113 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3115 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3117 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3118 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3119 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3121 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3122 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3124 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3125 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3128 AT_CHECK([ovs-appctl revalidator/purge], [0])
3129 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3130 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3131 OFPST_FLOW reply (OF1.3):
3137 AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)])
3138 OVS_VSWITCHD_START([dnl
3139 add-port br0 p1 -- set Interface p1 type=dummy
3141 on_exit 'kill `cat ovs-ofctl.pid`'
3143 ovs-appctl time/stop
3145 AT_CAPTURE_FILE([ofctl_monitor.log])
3146 # A table-miss flow has priority 0 and no match
3147 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3149 dnl Singleton controller action.
3150 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3152 # Become slave (OF 1.3), which should disable everything except port status.
3153 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
3155 # Ensure that ovs-vswitchd gets a chance to reply before sending another command.
3156 ovs-appctl time/warp 500 100
3158 # Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
3159 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
3161 ovs-appctl time/warp 500 100
3163 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
3165 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3166 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3168 AT_CHECK([ovs-appctl revalidator/purge], [0])
3169 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3170 send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1
3171 OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1
3173 send: OFPT_SET_ASYNC (OF1.3) (xid=0x2):
3180 REQUESTFORWARD: (off)
3188 REQUESTFORWARD: (off)
3190 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3191 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3193 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3194 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3196 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3197 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3200 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3202 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3203 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3204 OFPST_FLOW reply (OF1.3):
3211 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)])
3212 OVS_VSWITCHD_START([dnl
3213 add-port br0 p1 -- set Interface p1 type=dummy
3215 on_exit 'kill `cat ovs-ofctl.pid`'
3217 AT_CAPTURE_FILE([ofctl_monitor.log])
3218 # A table-miss flow has priority 0 and no match
3219 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3221 dnl Singleton controller action.
3222 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3225 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
3227 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3228 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3230 AT_CHECK([ovs-appctl revalidator/purge], [0])
3231 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3232 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3233 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3235 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3236 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3238 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3239 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3242 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3244 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3245 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3246 OFPST_FLOW reply (OF1.4):
3253 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
3254 OVS_VSWITCHD_START([dnl
3255 add-port br0 p1 -- set Interface p1 type=dummy
3257 on_exit 'kill `cat ovs-ofctl.pid`'
3259 AT_CAPTURE_FILE([ofctl_monitor.log])
3260 AT_DATA([flows.txt], [dnl
3261 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
3262 table=1 actions=output(CONTROLLER),goto_table(2)
3263 table=2 actions=group:1234
3265 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
3266 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flows br0 flows.txt])
3268 dnl Singleton controller action.
3269 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3272 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
3274 AT_CHECK([ovs-ofctl packet-out br0 'in_port=NONE, packet=505400000007101111111111080045000028000000004006f97cc0a80001c0a800020008000a0000000000000000500200002e7d0000, actions=controller'])
3275 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 7])
3276 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3278 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3280 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3281 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3282 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3284 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3285 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3287 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3288 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3290 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3291 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3293 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3294 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3296 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3297 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3299 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3300 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3302 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3303 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3305 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3306 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3308 OFPT_PACKET_IN (OF1.3) (xid=0x0): total_len=54 in_port=ANY (via action) data_len=54 (unbuffered)
3309 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3312 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3314 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3315 n_packets=3, n_bytes=162, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3316 table=1, n_packets=3, n_bytes=162, actions=CONTROLLER:65535,goto_table:2
3317 table=2, n_packets=3, n_bytes=162, actions=group:1234
3318 OFPST_FLOW reply (OF1.3):
3325 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.4)])
3326 OVS_VSWITCHD_START([dnl
3327 add-port br0 p1 -- set Interface p1 type=dummy
3329 on_exit 'kill `cat ovs-ofctl.pid`'
3331 AT_CAPTURE_FILE([ofctl_monitor.log])
3332 AT_DATA([flows.txt], [dnl
3333 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
3334 table=1 actions=output(CONTROLLER),goto_table(2)
3335 table=2 actions=group:1234
3337 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
3338 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flows br0 flows.txt])
3340 dnl Singleton controller action.
3341 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3344 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
3346 AT_CHECK([ovs-ofctl packet-out br0 'in_port=NONE, packet=505400000007101111111111080045000028000000004006f97cc0a80001c0a800020008000a0000000000000000500200002e7d0000, actions=controller'])
3347 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 7])
3348 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3350 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3352 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3353 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3354 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3356 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3357 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3359 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3360 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3362 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3363 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3365 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3366 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3368 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3369 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3371 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3372 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3374 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3375 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3377 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3378 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3380 OFPT_PACKET_IN (OF1.4) (xid=0x0): total_len=54 in_port=ANY (via packet_out) data_len=54 (unbuffered)
3381 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:2e7d
3384 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3386 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3387 n_packets=3, n_bytes=162, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3388 table=1, n_packets=3, n_bytes=162, actions=CONTROLLER:65535,goto_table:2
3389 table=2, n_packets=3, n_bytes=162, actions=group:1234
3390 OFPST_FLOW reply (OF1.4):
3396 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
3398 OVS_VSWITCHD_START([dnl
3399 set bridge br0 datapath_type=dummy \
3400 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
3401 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
3404 ovs-ofctl -OOpenFlow13 del-flows br0
3405 ovs-ofctl -OOpenFlow13 add-group br0 "group_id=6000,type=all,bucket=actions=controller,bucket=actions=resubmit(,48),bucket=actions=resubmit(,81)"
3406 ovs-ofctl -OOpenFlow13 add-flow br0 "table=0, in_port=1, vlan_tci=0x0000/0x1fff actions=write_metadata:0x67870000000000/0xffffff0000000001,goto_table:17"
3407 ovs-ofctl -OOpenFlow13 add-flow br0 "table=17, priority=10,metadata=0x67870000000000/0xffffff0000000000 actions=write_metadata:0xe067870000000000/0xfffffffffffffffe,goto_table:60"
3408 ovs-ofctl -OOpenFlow13 add-flow br0 "table=60, priority=0 actions=resubmit(,17)"
3409 ovs-ofctl -OOpenFlow13 add-flow br0 "table=17, priority=10,metadata=0xe067870000000000/0xffffff0000000000 actions=write_metadata:0x67871d4d000000/0xfffffffffffffffe,goto_table:43"
3410 ovs-ofctl -OOpenFlow13 add-flow br0 "table=43, priority=100,icmp actions=group:6000"
3411 ovs-ofctl -OOpenFlow13 add-flow br0 "table=48, priority=0 actions=resubmit(,49),resubmit(,50)"
3412 ovs-ofctl -OOpenFlow13 add-flow br0 "table=50, priority=0 actions=controller"
3415 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3418 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
3421 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 1])
3422 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3424 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3425 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=43 cookie=0x0 total_len=98 metadata=0x67871d4d000000,in_port=1 (via action) data_len=98 (unbuffered)
3426 icmp,vlan_tci=0x0000,dl_src=3a:6d:d2:09:9c:ab,dl_dst=1e:2c:e9:2a:66:9e,nw_src=192.168.10.10,nw_dst=192.168.10.30,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:6f20
3428 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=50 cookie=0x0 total_len=98 metadata=0x67871d4d000000,in_port=1 (via no_match) data_len=98 (unbuffered)
3429 icmp,vlan_tci=0x0000,dl_src=3a:6d:d2:09:9c:ab,dl_dst=1e:2c:e9:2a:66:9e,nw_src=192.168.10.10,nw_dst=192.168.10.30,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:6f20
3435 AT_SETUP([ofproto-dpif - ARP modification slow-path])
3437 add_of_ports br0 1 2
3439 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
3440 ovs-ofctl add-flow br0 'in_port=1,arp actions=load:2->OXM_OF_ARP_OP[[]],2,load:0xc0a88001->OXM_OF_ARP_SPA[[]],2,load:0x404444444441->OXM_OF_ARP_THA[[]],2'
3442 # Input some packets that should follow the arp modification slow-path.
3444 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
3446 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3448 # Check the packets that were output.
3449 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
3450 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3451 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3452 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3453 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3454 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3455 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3456 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3457 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3458 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3464 AT_SETUP([ofproto-dpif - VLAN handling])
3466 [set Bridge br0 fail-mode=standalone -- \
3467 add-port br0 p1 trunks=10,12 -- \
3468 add-port br0 p2 tag=10 -- \
3469 add-port br0 p3 tag=12 \
3470 other-config:priority-tags=if-nonzero -- \
3471 add-port br0 p4 tag=12 -- \
3472 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
3473 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
3474 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
3475 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
3476 other-config:priority-tags=if-nonzero -- \
3477 add-port br0 p9 vlan_mode=dot1q-tunnel tag=10 other-config:qinq-ethtype=802.1q -- \
3478 add-port br0 p10 vlan_mode=dot1q-tunnel tag=10 cvlans=10,12 other-config:qinq-ethtype=802.1q -- \
3479 add-port br0 p11 vlan_mode=dot1q-tunnel tag=12 other-config:qinq-ethtype=802.1q -- \
3480 add-port br0 p12 vlan_mode=dot1q-tunnel tag=12 other-config:qinq-ethtype=802.1q \
3481 other-config:priority-tags=if-nonzero -- \
3482 set Interface p1 type=dummy -- \
3483 set Interface p2 type=dummy -- \
3484 set Interface p3 type=dummy -- \
3485 set Interface p4 type=dummy -- \
3486 set Interface p5 type=dummy -- \
3487 set Interface p6 type=dummy -- \
3488 set Interface p7 type=dummy -- \
3489 set Interface p8 type=dummy -- \
3490 set Interface p9 type=dummy -- \
3491 set Interface p10 type=dummy -- \
3492 set Interface p11 type=dummy -- \
3493 set Interface p12 type=dummy --])
3495 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
3496 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
3502 "100 10 0 1,5,6,7,8,pop_vlan,2,9" \
3503 "100 10 1 1,5,6,7,8,pop_vlan,2,9" \
3506 "100 12 0 1,5,6,pop_vlan,3,4,7,8,11,12" \
3507 "100 12 1 1,5,6,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3511 "1 10 0 5,6,7,8,100,pop_vlan,2,9" \
3512 "1 10 1 5,6,7,8,100,pop_vlan,2,9" \
3515 "1 12 0 5,6,100,pop_vlan,3,4,7,8,11,12" \
3516 "1 12 1 5,6,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3517 "2 none 0 9,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3518 "2 0 0 pop_vlan,9,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3519 "2 0 1 pop_vlan,9,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
3526 "3 none 0 4,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3527 "3 0 0 pop_vlan,4,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3528 "3 0 1 8,12,pop_vlan,4,7,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3535 "4 none 0 3,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3536 "4 0 0 pop_vlan,3,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3537 "4 0 1 3,8,12,pop_vlan,7,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3544 "5 none 0 2,9,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3545 "5 0 0 pop_vlan,2,9,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3546 "5 0 1 pop_vlan,2,9,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
3547 "5 10 0 1,6,7,8,100,pop_vlan,2,9" \
3548 "5 10 1 1,6,7,8,100,pop_vlan,2,9" \
3551 "5 12 0 1,6,100,pop_vlan,3,4,7,8,11,12" \
3552 "5 12 1 1,6,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3553 "6 none 0 2,9,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3554 "6 0 0 pop_vlan,2,9,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3555 "6 0 1 pop_vlan,2,9,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
3556 "6 10 0 1,5,7,8,100,pop_vlan,2,9" \
3557 "6 10 1 1,5,7,8,100,pop_vlan,2,9" \
3560 "6 12 0 1,5,100,pop_vlan,3,4,7,8,11,12" \
3561 "6 12 1 1,5,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3562 "7 none 0 3,4,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3563 "7 0 0 pop_vlan,3,4,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3564 "7 0 1 3,8,12,pop_vlan,4,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3565 "7 10 0 1,5,6,8,100,pop_vlan,2,9" \
3566 "7 10 1 1,5,6,8,100,pop_vlan,2,9" \
3569 "7 12 0 1,5,6,100,pop_vlan,3,4,8,11,12" \
3570 "7 12 1 1,5,6,100,pop_vlan,4,11,push_vlan(vid=0,pcp=1),3,8,12" \
3571 "8 none 0 3,4,7,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3572 "8 0 0 pop_vlan,3,4,7,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3573 "8 0 1 3,12,pop_vlan,4,7,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3574 "8 10 0 1,5,6,7,100,pop_vlan,2,9" \
3575 "8 10 1 1,5,6,7,100,pop_vlan,2,9" \
3578 "8 12 0 1,5,6,100,pop_vlan,3,4,7,11,12" \
3579 "8 12 1 1,5,6,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,12" \
3580 "9 none 0 2,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3581 "9 10 0 10,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3582 "9 11 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3586 "10 12 0 9,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3587 "11 10 0 7,8,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3588 "11 10 1 7,8,12,push_vlan(vid=12,pcp=0),1,5,6,100"
3596 if test $vlan = none; then
3597 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
3599 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=$vlan,pcp=$pcp),encap(eth_type(0xabcd))"
3602 echo "----------------------------------------------------------------------"
3603 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
3605 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3606 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3608 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3610 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3616 AT_SETUP([ofproto-dpif - VLAN depth limit])
3617 OVS_VSWITCHD_START([dnl
3618 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
3619 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \
3620 add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3
3623 AT_DATA([flows.txt], [dnl
3624 table=0 in_port=1,eth_type=0x8100,vlan_tci=0x0010/0x01ff actions=output:2
3625 table=0 in_port=1,eth_type=0xabcd,vlan_tci=0x0010/0x01ff actions=output:3
3627 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
3628 flow="in_port(1),eth(src=00:11:22:33:44:55,dst=00:22:44:66:88:00),eth_type(0x8100),vlan(vid=16,pcp=0), \
3629 encap(eth_type(0x8100),vlan(vid=17,pcp=0),encap(eth_type(0xabcd)))"
3631 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3632 AT_CHECK([tail -1 stdout], [0],
3633 [Datapath actions: 2
3636 AT_CHECK([ovs-vsctl set Open_vswitch `ovs-vsctl show | head -n1` other_config:vlan-limit=0])
3637 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3638 AT_CHECK([tail -1 stdout], [0],
3639 [Datapath actions: 3
3645 AT_SETUP([ofproto-dpif - Multi-VLAN actions])
3646 OVS_VSWITCHD_START([dnl
3647 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
3648 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2
3650 AT_CHECK([ovs-vsctl set Open_vswitch `ovs-vsctl show | head -n1` other_config:vlan-limit=0])
3652 AT_DATA([flows.txt], [dnl
3653 table=0 in_port=1,vlan_tci=0x1100/0x1fff actions=pop_vlan,output:2
3654 table=0 in_port=1,vlan_tci=0x1101/0x1fff actions=push_vlan:0x8100,set_field:0x1201/0x1fff->vlan_tci,output:2
3655 table=0 in_port=1,vlan_tci=0x1102/0x1fff actions=push_vlan:0x88a8,set_field:0x1202/0x1fff->vlan_tci,output:2
3656 table=0 in_port=1,vlan_tci=0x1103/0x1fff actions=set_field:0x1203/0x1fff->vlan_tci,output:2
3657 table=0 in_port=1,vlan_tci=0x1104/0x1fff actions=pop_vlan,goto_table:1
3658 table=1 vlan_tci=0 actions=output:2
3659 table=1 vlan_tci=0x1300/0x1fff actions=pop_vlan,output:2
3660 table=1 vlan_tci=0x1301/0x1fff actions=push_vlan:0x88a8,set_field:0x1401/0x1fff->vlan_tci,output:2
3661 table=1 vlan_tci=0x1302/0x1fff actions=set_field:0x1402/0x1fff->vlan_tci,output:2
3664 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
3667 psd_hdr="in_port(1),eth(src=00:11:22:33:44:55,dst=00:22:44:66:88:00),"
3668 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$psd_hdr$1"], [0], [stdout])
3669 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: $2
3673 check_act "eth_type(0x8100),vlan(vid=0x0100,pcp=0),encap(eth_type(0xabcd))" \
3676 check_act "eth_type(0x8100),vlan(vid=0x0101,pcp=0),encap(eth_type(0xabcd))" \
3677 "push_vlan(vid=513,pcp=0),2"
3679 check_act "eth_type(0x8100),vlan(vid=0x0102,pcp=0),encap(eth_type(0xabcd))" \
3680 "push_vlan(tpid=0x88a8,vid=514,pcp=0),2"
3682 check_act "eth_type(0x8100),vlan(vid=0x0103,pcp=0),encap(eth_type(0xabcd))" \
3683 "pop_vlan,push_vlan(vid=515,pcp=0),2"
3685 check_act "eth_type(0x8100),vlan(vid=0x0104,pcp=0),encap(eth_type(0xabcd))" \
3688 check_act "eth_type(0x88a8),vlan(vid=0x0104,pcp=0),encap(eth_type(0x8100),\
3689 vlan(vid=0x0300,pcp=0),encap(eth_type(0xabcd)))" "pop_vlan,pop_vlan,2"
3691 check_act "eth_type(0x88a8),vlan(vid=0x0104,pcp=0),encap(eth_type(0x8100),\
3692 vlan(vid=0x0301,pcp=0),encap(eth_type(0xabcd)))" \
3693 "pop_vlan,push_vlan(tpid=0x88a8,vid=1025,pcp=0),2"
3695 check_act "eth_type(0x88a8),vlan(vid=0x0104,pcp=0),encap(eth_type(0x8100),\
3696 vlan(vid=0x0302,pcp=0),encap(eth_type(0xabcd)))" \
3697 "pop_vlan,pop_vlan,push_vlan(vid=1026,pcp=0),2"
3702 AT_SETUP([ofproto-dpif - MPLS handling])
3703 OVS_VSWITCHD_START([dnl
3704 add-port br0 p1 -- set Interface p1 type=dummy
3706 on_exit 'kill `cat ovs-ofctl.pid`'
3708 AT_CAPTURE_FILE([ofctl_monitor.log])
3709 AT_DATA([flows.txt], [dnl
3710 dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
3711 dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
3712 dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
3714 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3716 dnl In this test, we push an MPLS tag to an ethernet packet.
3717 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3720 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:00,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3722 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3723 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3725 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3726 OFPT_PACKET_IN (OF1.2): total_len=122 in_port=1 (via action) data_len=122 (unbuffered)
3727 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3728 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3729 00000010 01 40 45 00 00 68 00 00-00 00 40 06 f9 3c c0 a8
3730 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3731 00000030 00 00 50 00 00 00 4a 4d-00 00 00 01 02 03 04 05
3732 00000040 06 07 08 09 0a 0b 0c 0d-0e 0f 10 11 12 13 14 15
3733 00000050 16 17 18 19 1a 1b 1c 1d-1e 1f 20 21 22 23 24 25
3734 00000060 26 27 28 29 2a 2b 2c 2d-2e 2f 30 31 32 33 34 35
3735 00000070 36 37 38 39 3a 3b 3c 3d-3e 3f
3736 OFPT_PACKET_IN (OF1.2): total_len=122 in_port=1 (via action) data_len=122 (unbuffered)
3737 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3738 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3739 00000010 01 40 45 00 00 68 00 00-00 00 40 06 f9 3c c0 a8
3740 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3741 00000030 00 00 50 00 00 00 4a 4d-00 00 00 01 02 03 04 05
3742 00000040 06 07 08 09 0a 0b 0c 0d-0e 0f 10 11 12 13 14 15
3743 00000050 16 17 18 19 1a 1b 1c 1d-1e 1f 20 21 22 23 24 25
3744 00000060 26 27 28 29 2a 2b 2c 2d-2e 2f 30 31 32 33 34 35
3745 00000070 36 37 38 39 3a 3b 3c 3d-3e 3f
3746 OFPT_PACKET_IN (OF1.2): total_len=122 in_port=1 (via action) data_len=122 (unbuffered)
3747 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3748 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3749 00000010 01 40 45 00 00 68 00 00-00 00 40 06 f9 3c c0 a8
3750 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3751 00000030 00 00 50 00 00 00 4a 4d-00 00 00 01 02 03 04 05
3752 00000040 06 07 08 09 0a 0b 0c 0d-0e 0f 10 11 12 13 14 15
3753 00000050 16 17 18 19 1a 1b 1c 1d-1e 1f 20 21 22 23 24 25
3754 00000060 26 27 28 29 2a 2b 2c 2d-2e 2f 30 31 32 33 34 35
3755 00000070 36 37 38 39 3a 3b 3c 3d-3e 3f
3758 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3759 dnl copied exactly, except for the BOS bit.
3760 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3763 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:01,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3765 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3766 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3768 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3769 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3770 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3771 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3772 00000010 a0 40 00 00 a1 40
3774 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3775 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3776 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3777 00000010 a0 40 00 00 a1 40
3779 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3780 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3781 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3782 00000010 a0 40 00 00 a1 40
3785 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3786 dnl copied exactly, except for the BOS bit. The ethertype should be updated
3787 dnl to the MPLS ethertype of the MPLS push action which differs to that
3788 dnl of the input packet.
3789 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3792 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:02,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3794 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3795 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3797 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3798 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3799 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3800 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3801 00000010 a0 40 00 00 a1 40
3803 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3804 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3805 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3806 00000010 a0 40 00 00 a1 40
3808 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3809 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3810 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3811 00000010 a0 40 00 00 a1 40
3817 AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
3818 OVS_VSWITCHD_START([dnl
3819 add-port br0 p1 -- set Interface p1 type=dummy
3821 on_exit 'kill `cat ovs-ofctl.pid`'
3823 AT_CAPTURE_FILE([ofctl_monitor.log])
3824 AT_DATA([flows.txt], [dnl
3825 cookie=0xa dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
3826 cookie=0xa dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
3827 cookie=0xa dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
3828 cookie=0xa dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
3829 cookie=0xa dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3830 cookie=0xa dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3831 cookie=0xa dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3832 cookie=0xa dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3833 cookie=0xa dl_src=40:44:44:44:54:58,vlan_tci=0x1000/0x1000 actions=load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3834 cookie=0xa dl_src=40:44:44:44:54:59,vlan_tci=0x1000/0x1000 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],set_vlan_pcp:1,load:99->OXM_OF_VLAN_VID[[]],controller
3836 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3838 dnl Modified MPLS controller action.
3839 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3840 dnl both of these in the final flow
3841 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3844 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:50,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3846 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3847 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3849 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3850 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3851 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3852 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3853 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3854 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3855 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3856 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3857 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3858 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3859 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3860 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3861 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3862 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3863 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3864 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3865 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3866 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3867 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3868 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3869 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3870 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3871 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3872 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3873 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3874 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3875 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3876 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3877 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3878 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3879 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3882 dnl Modified MPLS controller action.
3883 dnl In this test, the input packet is vlan-tagged, which should be kept as
3885 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3888 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:51,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3890 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3891 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3893 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3894 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3895 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3896 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3897 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3898 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3899 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3900 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3901 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3902 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3903 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3905 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3906 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3907 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3908 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3909 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3910 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3911 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3912 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3913 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3914 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3916 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3917 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3918 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3919 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3920 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3921 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3922 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3923 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3924 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3925 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3929 dnl Modified MPLS controller action.
3930 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3931 dnl both of these in the final flow
3932 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3935 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:52,dst=52:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3937 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3938 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3940 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3941 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3942 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3943 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3944 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3945 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3946 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3947 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3948 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3949 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3950 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3951 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3952 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3953 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3954 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3955 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3956 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3957 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3958 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3959 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3960 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3961 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3962 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3963 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3964 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3965 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3966 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3967 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3968 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3969 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3970 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3973 dnl Modified MPLS controller action.
3974 dnl In this test, the input packet is vlan-tagged, which should be kept as
3976 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3979 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:53,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3981 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3982 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3984 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3985 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3986 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3987 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3988 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3989 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3990 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3991 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3992 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3993 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3994 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3996 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3997 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3998 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3999 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4000 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4001 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4002 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4003 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4004 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4005 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4007 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4008 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4009 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
4010 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4011 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4012 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4013 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4014 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4015 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4016 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4020 dnl Modified MPLS controller action.
4021 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
4022 dnl actions are reordered, so we see both of these in the final flow.
4023 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4026 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:54,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
4028 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4029 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4031 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4032 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4033 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4034 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
4035 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4036 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4037 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4038 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4039 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4040 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4041 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4042 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4043 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4044 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
4045 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4046 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4047 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4048 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4049 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4050 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4051 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4052 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4053 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4054 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
4055 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4056 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4057 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4058 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4059 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4060 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4061 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4064 dnl Modified MPLS controller action.
4065 dnl In this test, the input packet is vlan-tagged, which should be kept as
4067 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4070 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:55,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
4072 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4073 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4075 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4076 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4077 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4078 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
4079 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4080 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4081 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4082 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4083 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4084 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4085 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4087 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4088 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4089 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
4090 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4091 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4092 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4093 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4094 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4095 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4096 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4098 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4099 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4100 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
4101 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4102 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4103 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4104 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4105 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4106 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4107 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4111 dnl Modified MPLS controller action.
4112 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
4113 dnl actions are reordered, so we see both of these in the final flow.
4114 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4117 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:56,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
4119 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4120 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4122 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4123 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4124 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4125 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
4126 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4127 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4128 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4129 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4130 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4131 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4132 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4133 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4134 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4135 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
4136 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4137 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4138 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4139 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4140 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4141 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4142 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4143 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4144 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4145 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
4146 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4147 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4148 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4149 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4150 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4151 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4152 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4155 dnl Modified MPLS controller action.
4156 dnl In this test, the input packet is vlan-tagged, which should be kept as
4158 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4161 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:57,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
4163 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4164 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4166 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4167 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4168 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4169 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
4170 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4171 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4172 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4173 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4174 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4175 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4176 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4178 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4179 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4180 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
4181 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4182 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4183 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4184 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4185 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4186 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4187 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4189 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4190 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4191 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
4192 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4193 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4194 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4195 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4196 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4197 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4198 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4202 dnl Modified MPLS controller action.
4203 dnl In this test, the input packet is vlan-tagged, which should be kept as
4205 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4208 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:58,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
4210 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4211 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4213 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4214 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4215 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4216 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
4217 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4218 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4219 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4220 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4221 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4222 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4223 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4224 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4225 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4226 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
4227 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4228 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4229 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4230 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4231 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4232 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4233 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4234 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4235 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4236 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
4237 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4238 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4239 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4240 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4241 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4242 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4243 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4246 dnl Modified MPLS controller action.
4247 dnl In this test, the input packet is vlan-tagged, which should be modified
4248 dnl before we push MPLS and VLAN tags.
4249 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4252 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:59,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
4254 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4255 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4257 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4258 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4259 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4260 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
4261 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4262 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4263 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4264 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4265 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4266 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4267 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4268 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4269 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4270 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
4271 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4272 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4273 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4274 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4275 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4276 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4277 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4278 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4279 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
4280 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
4281 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4282 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4283 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4284 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4285 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4286 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4287 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4290 AT_CHECK([ovs-appctl revalidator/purge], [0])
4291 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
4292 cookie=0xa, n_packets=3, n_bytes=354, dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
4293 cookie=0xa, n_packets=3, n_bytes=354, dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
4294 cookie=0xa, n_packets=3, n_bytes=354, dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
4295 cookie=0xa, n_packets=3, n_bytes=354, dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
4296 cookie=0xa, n_packets=3, n_bytes=366, dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
4297 cookie=0xa, n_packets=3, n_bytes=366, dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
4298 cookie=0xa, n_packets=3, n_bytes=366, dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
4299 cookie=0xa, n_packets=3, n_bytes=366, dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
4300 cookie=0xa, n_packets=3, n_bytes=366, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:58 actions=load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
4301 cookie=0xa, n_packets=3, n_bytes=366, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:59 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],set_field:1->vlan_pcp,load:0x63->OXM_OF_VLAN_VID[[]],CONTROLLER:65535
4302 OFPST_FLOW reply (OF1.2):
4308 AT_SETUP([ofproto-dpif - fragment handling - trace])
4310 add_of_ports br0 1 2 3 4 5 6 90
4311 AT_DATA([flows.txt], [dnl
4312 priority=75 tcp nw_frag=no tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
4313 priority=75 tcp nw_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
4314 priority=50 tcp nw_frag=no actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
4315 priority=50 tcp nw_frag=first actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
4316 priority=50 tcp nw_frag=later actions=output:6
4318 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
4320 base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128"
4321 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
4322 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
4323 later_flow="$base_flow,frag=later)"
4325 # mode no first later
4328 'drop 1 drop drop' \
4337 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4338 for type in no first later; do
4339 eval flow=\$${type}_flow exp_output=\$$type
4340 printf "\n%s\n" "----$mode $type-----"
4341 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4343 if test $mode = drop && test $type != no; then
4344 echo ' 0. Packets are IP fragments and the fragment handling mode is "drop".' >> expout
4345 echo "Datapath actions: $exp_output" >> expout
4346 elif test $type = later; then
4347 echo "Datapath actions: $exp_output" >> expout
4349 echo "Datapath actions: set(tcp(src=80)),$exp_output" >> expout
4351 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
4357 AT_SETUP([ofproto-dpif - fragment handling - upcall])
4359 add_of_ports br0 1 2 3 4 5 6 90
4360 AT_DATA([flows.txt], [dnl
4361 priority=75 tcp ip_frag=no tp_dst=80 actions=set_field:81->tcp_dst,output:1
4362 priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2
4363 priority=50 tcp ip_frag=no actions=set_field:81->tcp_dst,output:4
4364 priority=50 tcp ip_frag=first actions=set_field:81->tcp_dst,output:5
4365 priority=50 tcp ip_frag=later actions=output:6
4367 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
4369 base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128"
4370 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
4371 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
4372 later_flow="$base_flow,frag=later)"
4374 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4378 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4379 for type in no first later; do
4380 eval flow=\$${type}_flow
4381 printf "\n%s\n" "----$mode $type-----"
4383 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
4386 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
4387 flow-dump from non-dpdk interfaces:
4388 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
4389 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),5
4390 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
4395 AT_CHECK([ovs-appctl revalidator/purge], [0])
4396 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4397 for type in no first later; do
4398 eval flow=\$${type}_flow
4399 printf "\n%s\n" "----$mode $type-----"
4401 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
4404 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
4405 flow-dump from non-dpdk interfaces:
4406 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
4407 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop
4408 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop
4413 AT_CHECK([ovs-appctl revalidator/purge], [0])
4414 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4415 for type in no first later; do
4416 eval flow=\$${type}_flow
4417 printf "\n%s\n" "----$mode $type-----"
4419 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
4422 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
4423 flow-dump from non-dpdk interfaces:
4424 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
4425 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),2
4426 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
4432 AT_SETUP([ofproto-dpif - fragment handling - actions])
4434 add_of_ports br0 1 2 3 4 5 6 90
4436 AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_TCP_DST[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr])
4437 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4438 source field tcp_dst lacks correct prerequisites
4439 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4442 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_PKT_REG0[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr])
4443 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4444 destination field tcp_src lacks correct prerequisites
4445 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4448 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr])
4449 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4450 set_field udp_src lacks correct prerequisites
4451 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4454 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr])
4455 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4456 set_field udp_dst lacks correct prerequisites
4457 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4460 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr])
4461 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4462 set_field sctp_src lacks correct prerequisites
4463 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4466 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr])
4467 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4468 set_field sctp_dst lacks correct prerequisites
4469 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4472 AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]],NXM_OF_TCP_SRC[[]]=NXM_OF_TCP_DST[[]],output:NXM_NX_REG0[[0..15]]),output:1"], [1], [], [stderr])
4473 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4474 source field tcp_dst lacks correct prerequisites
4475 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4478 AT_DATA([flows.txt], [dnl
4479 priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1
4481 AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt])
4483 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4487 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4488 for frag in 4000 6000 6008 4010; do
4489 printf "\n%s\n" "----$mode $frag-----"
4491 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 003c 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016 751e267b 00000000 a002 16d0 1736 0000 02 04 05 b4 04 02 08 0a 2d 25 08 5f 00 00 00 00 01 03 03 07"])
4494 dnl The set_field action only modifies 8 bits of the tcp_src, so both the flow
4495 dnl wildcard and the set_field action have a mask of 0xFF. Up to (including)
4496 dnl OVS-2.5, the wildcards and set_field mask are shared internally.
4497 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
4498 flow-dump from non-dpdk interfaces:
4499 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=33419/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
4500 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=33419/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
4501 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1
4504 AT_CHECK([ovs-appctl revalidator/purge], [0])
4505 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4506 for frag in 4000 6000 6008 4010; do
4507 printf "\n%s\n" "----$mode $frag truncated transport header -----"
4509 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"])
4512 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
4513 flow-dump from non-dpdk interfaces:
4514 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
4515 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
4516 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:38, used:0.001s, actions:1
4519 AT_CHECK([ovs-appctl revalidator/purge], [0])
4520 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4521 for frag in 4000 6000 6001 4002; do
4522 printf "\n%s\n" "----$mode $frag missing transport header-----"
4524 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"])
4527 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
4528 flow-dump from non-dpdk interfaces:
4529 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
4530 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
4531 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:34, used:0.001s, actions:1
4537 AT_SETUP([ofproto-dpif - exit])
4539 add_of_ports br0 1 2 3 10 11 12 13 14
4540 AT_DATA([flows.txt], [dnl
4541 in_port=1 actions=output:10,exit,output:11
4542 in_port=2 actions=output:12,resubmit:1,output:12
4543 in_port=3 actions=output:13,resubmit:2,output:14
4545 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4546 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
4547 AT_CHECK([tail -1 stdout], [0],
4548 [Datapath actions: 10
4550 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
4551 AT_CHECK([tail -1 stdout], [0],
4552 [Datapath actions: 12,10
4554 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
4555 AT_CHECK([tail -1 stdout], [0],
4556 [Datapath actions: 13,12,10
4562 AT_SETUP([ofproto-dpif - mirroring, select_all])
4563 AT_KEYWORDS([mirror mirrors mirroring])
4565 add_of_ports br0 1 2 3
4567 set Bridge br0 mirrors=@m --\
4568 --id=@p3 get Port p3 --\
4569 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4571 AT_DATA([flows.txt], [dnl
4572 in_port=1 actions=output:2
4573 in_port=2 actions=output:1
4575 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4577 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4578 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4579 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4580 [Datapath actions: 3,2
4583 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4584 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4585 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4586 [Datapath actions: 3,1
4593 AT_SETUP([ofproto-dpif - mirroring, select_src])
4594 AT_KEYWORDS([mirror mirrors mirroring])
4596 add_of_ports br0 1 2 3
4598 set Bridge br0 mirrors=@m --\
4599 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4600 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
4602 AT_DATA([flows.txt], [dnl
4603 in_port=1 actions=output:2
4604 in_port=2 actions=output:1
4606 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4608 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4609 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4610 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4611 [Datapath actions: 3,2
4614 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4615 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4616 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4617 [Datapath actions: 1
4622 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
4623 AT_KEYWORDS([mirror mirrors mirroring])
4625 add_of_ports br0 1 2
4627 set Bridge br0 mirrors=@m --\
4628 --id=@p2 get Port p2 --\
4629 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
4631 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4633 # "in_port" defaults to OFPP_NONE if it's not specified.
4634 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_ttl=128,icmp_type=8,icmp_code=0"
4635 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4636 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4637 [Datapath actions: 1,2
4644 AT_SETUP([ofproto-dpif - mirroring, select_dst])
4645 AT_KEYWORDS([mirror mirrors mirroring])
4647 add_of_ports br0 1 2 3
4649 set Bridge br0 mirrors=@m --\
4650 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4651 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
4653 AT_DATA([flows.txt], [dnl
4654 in_port=1 actions=output:2
4655 in_port=2 actions=output:1
4657 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4659 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4660 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4661 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4662 [Datapath actions: 2,3
4665 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4666 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4667 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4668 [Datapath actions: 1
4675 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
4676 AT_KEYWORDS([mirror mirrors mirroring])
4678 add_of_ports br0 1 2 3
4680 set Bridge br0 mirrors=@m --\
4681 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4682 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
4684 AT_DATA([flows.txt], [dnl
4685 in_port=1, actions=output:2
4687 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4689 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4690 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4691 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4692 [Datapath actions: 2
4695 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4696 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4697 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4698 [Datapath actions: 2
4701 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=11,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4702 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4703 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4704 [Datapath actions: 3,2
4711 AT_SETUP([ofproto-dpif - mirroring, output_port])
4712 AT_KEYWORDS([mirror mirrors mirroring])
4714 add_of_ports br0 1 2 3
4716 set Bridge br0 mirrors=@m --\
4717 --id=@p3 get Port p3 --\
4718 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4720 AT_DATA([flows.txt], [dnl
4721 in_port=1 actions=mod_vlan_vid:17,output:2
4722 in_port=2 actions=output:1
4724 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4726 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4727 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4728 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4729 [Datapath actions: 3,push_vlan(vid=17,pcp=0),2
4732 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4733 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4734 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4735 [Datapath actions: 3,1
4741 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
4742 AT_KEYWORDS([mirror mirrors mirroring])
4744 add_of_ports br0 1 2
4746 set Bridge br0 mirrors=@m --\
4747 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
4749 AT_DATA([flows.txt], [dnl
4750 in_port=1 actions=output:2
4751 in_port=2 actions=mod_vlan_vid:17,output:1
4753 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4755 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4756 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4757 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4759 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
4760 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4762 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4764 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4765 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4766 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4768 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
4769 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4771 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4776 # This verifies that we don't get duplicate mirroring when mirror_packet()
4777 # might be invoked recursively, as a check against regression.
4778 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors])
4779 AT_KEYWORDS([mirror mirrors mirroring])
4781 add_of_ports br0 1 2 3
4783 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
4784 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 \
4785 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 \
4786 -- set Port br0 tag=0 \
4787 -- set Port p1 tag=0 \
4788 -- set Port p2 tag=500 \
4789 -- set Port p3 tag=501
4792 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4793 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //
4795 /g' | sort], [0], [100
4803 # This test verifies that mirror state is preserved across recirculation.
4805 # Otherwise, post-recirculation the ingress and the output to port 4
4806 # would cause the packet to be mirrored to port 3 a second time.
4807 AT_SETUP([ofproto-dpif - mirroring with recirculation])
4808 AT_KEYWORDS([mirror mirrors mirroring])
4810 add_of_ports br0 1 2 3 4
4812 set Bridge br0 mirrors=@m --\
4813 --id=@p3 get Port p3 --\
4814 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4816 AT_DATA([flows.txt], [dnl
4817 in_port=1 actions=2,debug_recirc,4
4819 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4821 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4822 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4823 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3,2,recirc(0x1)
4825 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4826 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 4
4832 # Tests below verify the snaplen support for mirroring
4833 AT_SETUP([ofproto-dpif - mirroring, select_all with snaplen])
4834 AT_KEYWORDS([mirror mirrors mirroring])
4836 add_of_ports br0 1 2 3
4838 set Bridge br0 mirrors=@m --\
4839 --id=@p3 get Port p3 --\
4840 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4842 AT_DATA([flows.txt], [dnl
4843 in_port=1 actions=output:2
4844 in_port=2 actions=output:1
4846 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4848 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4849 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4850 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4851 [Datapath actions: trunc(100),3,2
4854 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4855 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4856 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4857 [Datapath actions: trunc(100),3,1
4863 AT_SETUP([ofproto-dpif - mirroring, select_all with snaplen and reset snaplen])
4864 AT_KEYWORDS([mirror mirrors mirroring])
4866 add_of_ports br0 1 2 3
4868 set Bridge br0 mirrors=@m --\
4869 --id=@p3 get Port p3 --\
4870 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4872 AT_DATA([flows.txt], [dnl
4873 in_port=1 actions=output:2
4874 in_port=2 actions=output:1
4876 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4878 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4879 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4880 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4881 [Datapath actions: trunc(100),3,2
4884 ovs-vsctl set mirror mymirror snaplen=77
4886 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4887 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4888 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4889 [Datapath actions: trunc(77),3,1
4892 ovs-vsctl set mirror mymirror snaplen=65535
4894 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4895 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4896 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4897 [Datapath actions: 3,1
4903 AT_SETUP([ofproto-dpif - mirroring, select_src with snaplen])
4904 AT_KEYWORDS([mirror mirrors mirroring])
4906 add_of_ports br0 1 2 3
4908 set Bridge br0 mirrors=@m --\
4909 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4910 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3 snaplen=100
4912 AT_DATA([flows.txt], [dnl
4913 in_port=1 actions=output:2
4914 in_port=2 actions=output:1
4916 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4918 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4919 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4920 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4921 [Datapath actions: trunc(100),3,2
4924 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4925 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4926 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4927 [Datapath actions: 1
4932 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port with snaplen])
4933 AT_KEYWORDS([mirror mirrors mirroring])
4935 add_of_ports br0 1 2
4937 set Bridge br0 mirrors=@m --\
4938 --id=@p2 get Port p2 --\
4939 --id=@m create Mirror name=mymirror select_all=true output_port=@p2 snaplen=100
4941 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4943 # "in_port" defaults to OFPP_NONE if it's not specified.
4944 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_ttl=128,icmp_type=8,icmp_code=0"
4945 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4946 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4947 [Datapath actions: 1,trunc(100),2
4953 AT_SETUP([ofproto-dpif - mirroring, select_dst with snaplen])
4954 AT_KEYWORDS([mirror mirrors mirroring])
4956 add_of_ports br0 1 2 3
4958 set Bridge br0 mirrors=@m --\
4959 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4960 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3 snaplen=100
4962 AT_DATA([flows.txt], [dnl
4963 in_port=1 actions=output:2
4964 in_port=2 actions=output:1
4966 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4968 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4969 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4970 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4971 [Datapath actions: 2,trunc(100),3
4974 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4975 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4976 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4977 [Datapath actions: 1
4983 AT_SETUP([ofproto-dpif - mirroring, select_vlan with snaplen])
4984 AT_KEYWORDS([mirror mirrors mirroring])
4986 add_of_ports br0 1 2 3
4988 set Bridge br0 mirrors=@m --\
4989 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4990 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3 snaplen=100
4992 AT_DATA([flows.txt], [dnl
4993 in_port=1, actions=output:2
4995 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4997 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4998 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4999 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5000 [Datapath actions: 2
5003 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
5004 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5005 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5006 [Datapath actions: 2
5009 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=11,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
5010 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5011 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5012 [Datapath actions: trunc(100),3,2
5018 AT_SETUP([ofproto-dpif - mirroring, output_port with snaplen])
5019 AT_KEYWORDS([mirror mirrors mirroring])
5021 add_of_ports br0 1 2 3
5023 set Bridge br0 mirrors=@m --\
5024 --id=@p3 get Port p3 --\
5025 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
5027 AT_DATA([flows.txt], [dnl
5028 in_port=1 actions=mod_vlan_vid:17,output:2
5029 in_port=2 actions=output:1
5031 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5033 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5034 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5035 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5036 [Datapath actions: trunc(100),3,push_vlan(vid=17,pcp=0),2
5039 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5040 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5041 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5042 [Datapath actions: trunc(100),3,1
5048 AT_SETUP([ofproto-dpif - mirroring, output_vlan with snaplen])
5049 AT_KEYWORDS([mirror mirrors mirroring])
5051 add_of_ports br0 1 2
5053 set Bridge br0 mirrors=@m --\
5054 --id=@m create Mirror name=mymirror select_all=true output_vlan=12 snaplen=100
5056 AT_DATA([flows.txt], [dnl
5057 in_port=1 actions=output:2
5058 in_port=2 actions=mod_vlan_vid:17,output:1
5060 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5062 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5063 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5064 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5065 dnl Expect: "trunc(100),100,trunc(100),2,trunc(100),1", with different order
5066 AT_CHECK([echo "$actual" | sed -n 's/.*\(trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*\)/\1/p'], [0])
5068 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5069 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5070 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5071 AT_CHECK([echo "$actual" | sed -n 's/.*\(trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*\)/\1/p'], [0])
5076 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors with snaplen])
5077 AT_KEYWORDS([mirror mirrors mirroring])
5079 add_of_ports br0 1 2 3
5081 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
5082 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 snaplen=200 \
5083 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 snaplen=300 \
5084 -- set Port br0 tag=0 \
5085 -- set Port p1 tag=0 \
5086 -- set Port p2 tag=500 \
5087 -- set Port p3 tag=501
5090 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
5091 AT_CHECK([tail -1 stdout | egrep "trunc\(200\),2,trunc\(300\),3,100|trunc\(300\),3,trunc\(200\),2,100"], [0], [stdout])
5096 # This test verifies that the table ID is preserved across recirculation
5097 # when a resubmit action requires it (because the action is relative to
5098 # the current table rather than specifying a table).
5099 AT_SETUP([ofproto-dpif - resubmit with recirculation])
5101 add_of_ports br0 1 2 3
5103 AT_DATA([flows.txt], [dnl
5104 table=0 in_port=1 actions=2,resubmit(,1)
5105 table=1 in_port=1 actions=debug_recirc,resubmit:55
5106 table=1 in_port=55 actions=3
5108 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5110 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5111 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5112 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2,recirc(0x1)
5114 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
5115 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3
5122 # This test verifies that tunnel metadata is preserved across
5123 # recirculation. At the time of recirculation, fields such as "tun_id"
5124 # may be set before the tunnel is "valid" (ie, has a destination
5125 # address), but the field should still be available after recirculation.
5126 AT_SETUP([ofproto-dpif - resubmit with tun_id])
5128 add_of_ports br0 1 2 3
5130 AT_DATA([flows.txt], [dnl
5131 table=0 in_port=1 actions=2,load:6->NXM_NX_TUN_ID[[]],resubmit(,1)
5132 table=1 in_port=1 actions=debug_recirc,resubmit:55
5133 table=1 in_port=55 actions=3
5135 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5137 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5138 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5139 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: icmp,tun_id=0x6,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128,icmp_type=8,icmp_code=0
5142 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
5143 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: recirc_id=0x1,eth,icmp,tun_id=0x6,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128,icmp_type=8,icmp_code=0
5150 # This test verifies that "resubmit", when it triggers recirculation
5151 # indirectly through the flow that it recursively invokes, is not
5152 # re-executed when execution continues later post-recirculation.
5153 AT_SETUP([ofproto-dpif - recirculation after resubmit])
5155 add_of_ports br0 1 2
5157 AT_DATA([flows.txt], [dnl
5158 table=0 in_port=1 actions=resubmit(,1),2
5159 table=1 in_port=1 actions=debug_recirc
5161 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5163 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5164 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5165 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: recirc(0x1)
5167 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
5168 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2
5175 AT_SETUP([ofproto-dpif - debug_slow action])
5177 add_of_ports br0 1 2 3
5179 AT_CHECK([ovs-ofctl add-flow br0 "in_port=1,actions=debug_slow,2"])
5181 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5183 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5184 AT_CHECK_UNQUOTED([tail -3 stdout], [0], [Datapath actions: 2
5185 This flow is handled by the userspace slow path because it:
5186 - Uses action(s) not supported by datapath.
5193 dnl CHECK_CONTINUATION(TITLE, N_PORTS0, N_PORTS1, ACTIONS0, ACTIONS1, [EXTRA_SETUP])
5195 dnl Checks the implementation of the continuation mechanism that allows the
5196 dnl packet processing pipeline to be paused and resumed. Starts by creating
5197 dnl bridge br0 with N_PORTS0 ports numbered 1 through N_PORTS0, and adds the
5198 dnl flows listed in ACTIONS0 to that bridge. Then, injects a packet at port 1
5199 dnl in the bridge, resuming each time the pipeline pauses, and expects a single
5200 dnl packet to be output at each port 2 through N_PORTS0. Then, as long as
5201 dnl ACTIONS0 still contains at least one "pause" action, removes one of them
5202 dnl and repeats the process.
5204 dnl If N_PORTS1 is nonzero, also creates a bridge br1 and adds ports numbered
5205 dnl N_PORTS0 + 1 to N_PORTS0 + N_PORTS1 to it, as well as flows ACTIONS1.
5206 dnl ACTIONS1 may also contain "pause" actions. Packets are only ever injected
5207 dnl into port 1 on br0, so br1 only comes into action if a patch port (added
5208 dnl by EXTRA_SETUP) jumps from one bridge to another.
5210 dnl EXTRA_SETUP is an optional list of extra commands to run after setting up
5211 dnl both bridges, e.g. to configure mirrors or patch ports.
5212 m4_define([CHECK_CONTINUATION], [dnl
5213 AT_SETUP([ofproto-dpif - continuation - $1])
5214 AT_KEYWORDS([continuations pause resume])
5217 # count_matches STRING
5219 # Prints on stdout the number of occurrences of STRING in stdin.
5226 add_of_ports --pcap br0 `seq 1 $2`
5227 m4_if([$3], [0], [],
5229 add_of_ports --pcap br1 `seq m4_eval([$2 + 1]) m4_eval([$2 + $3])`])
5231 AT_CAPTURE_FILE([ofctl_monitor0.log])
5232 AT_CHECK([ovs-ofctl monitor br0 resume --detach --no-chdir --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log])
5233 m4_if([$3], [0], [],
5234 [AT_CAPTURE_FILE([ofctl_monitor1.log])
5235 AT_CHECK([ovs-ofctl monitor br1 resume --detach --no-chdir --pidfile=ovs-ofctl1.pid 2> ofctl_monitor1.log])])
5240 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5244 printf "\n\nactions for br0:\n%s\n" "$actions0"
5245 m4_if([$3], [0], [], [printf "actions for br1:\n%s\n" "$actions1"])
5248 AT_CHECK([echo "$actions0" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br0 -])
5249 m4_if([$3], [0], [],
5250 [AT_CHECK([echo "$actions1" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br1 -])])
5252 # Make sure the datapath is up-to-date before sending the packet.
5253 ovs-appctl revalidator/wait
5255 # Run a packet through the switch.
5256 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5258 # Wait for the expected number of packets to show up.
5259 n_packets=`expr $n_packets + $2 - 1 + $3`
5260 echo "waiting for $n_packets packets..."
5261 OVS_WAIT_UNTIL([test $n_packets = `ovs-ofctl parse-pcap p*-tx.pcap | wc -l`])
5263 # Wait for the expected number of NXT_RESUMEs to be logged.
5264 n_resumes=$(expr $n_resumes + $(echo "$actions0 $actions1" | count_matches pause) )
5265 echo "waiting for $n_resumes NXT_RESUMEs..."
5266 OVS_WAIT_UNTIL([test $n_resumes = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
5268 # Eliminate one "pause" from the actions.
5270 # If there were none left, then we're done.
5271 next_actions0=`echo "$actions0" | sed '1,/pause/s/pause//'`
5272 if test X"$actions0" = X"$next_actions0"; then
5273 next_actions1=`echo "$actions1" | sed '1,/pause/s/pause//'`
5274 if test X"$actions1" = X"$next_actions1"; then
5277 actions1=$next_actions1
5280 actions0=$next_actions0
5283 # Delete all the flows and verify that there are none, so that we
5284 # can be sure that our updated flow tables is actually in use
5286 AT_CHECK([ovs-ofctl del-flows br0 && ovs-ofctl dump-flows br0 | strip_xids], [0],
5289 m4_if([$3], [0], [],
5290 [AT_CHECK([ovs-ofctl del-flows br1 && ovs-ofctl dump-flows br1 | strip_xids], [0],
5298 # Check that pause at the end of the pipeline works OK.
5300 # (xlate_continuation() has a special case for no-op actions; this
5301 # fails without that special case.)
5302 CHECK_CONTINUATION([pause at end of pipeline], [2], [0], [actions=2 pause])
5304 # Check that remaining actions are preserved following resume.
5305 CHECK_CONTINUATION([actions], [7], [0],
5306 [in_port=1 actions=pause 2 pause 3 pause 4 pause 5 pause 6 pause 7])
5308 # Check that multiple levels of resubmit continue following resume.
5310 # The "resubmit:55", which is relative to the current table, is
5311 # particularly interesting because it checks that the notion of the
5312 # current table is correctly preserved.
5313 CHECK_CONTINUATION([resubmit], [10], [0],
5314 [table=0 in_port=1 actions=pause 2 pause resubmit(,1) pause 10 pause
5315 table=1 in_port=1 actions=pause 3 pause resubmit(,2) pause 9 pause
5316 table=2 in_port=1 actions=pause 4 pause resubmit(,3) pause 8 pause
5317 table=3 in_port=1 actions=pause 5 pause resubmit:55 pause 7 pause
5318 table=3 in_port=55 actions=pause 6 pause])
5320 # Check that the action set is preserved across pause/resume.
5321 CHECK_CONTINUATION([action set], [3], [0],
5322 [in_port=1 actions=1 pause resubmit(,1) pause 2
5323 table=1 actions=write_actions(3)])
5325 # Check that metadata and the stack used by push and pop is preserved
5326 # across pause/resume.
5327 CHECK_CONTINUATION([data stack], [3], [0],
5328 [in_port=1 actions=pause dnl
5329 set_field:1->reg0 dnl
5331 set_field:2->reg1 dnl
5333 output:NXM_NX_REG0[[]] dnl
5335 push:NXM_NX_REG1[[]] dnl
5337 pop:NXM_NX_REG2[[]] dnl
5339 output:NXM_NX_REG2[[]] dnl
5343 # Check that mirror output occurs once and once only, even if
5344 # separated by pause/resume.
5345 CHECK_CONTINUATION([mirroring], [5], [0],
5346 [in_port=1 actions=pause 2 pause 3 pause 4 pause], [],
5348 set Bridge br0 mirrors=@m --\
5349 --id=@p2 get Port p2 --\
5350 --id=@p3 get Port p3 --\
5351 --id=@p4 get Port p4 --\
5352 --id=@p5 get Port p5 --\
5353 --id=@m create Mirror name=mymirror select_dst_port=@p2,@p3,@p4 output_port=@p5])
5355 # Check that pause works in the presence of patch ports.
5356 CHECK_CONTINUATION([patch ports], [4], [1],
5357 [table=0 in_port=1 actions=pause 2 resubmit(,1) pause 4
5358 table=1 in_port=1 actions=pause 3 pause 10 pause],
5359 [table=0 in_port=11 actions=pause 5 pause],
5361 -- add-port br0 patch10 \
5362 -- set interface patch10 type=patch options:peer=patch11 \
5364 -- add-port br1 patch11 \
5365 -- set interface patch11 type=patch options:peer=patch10 \
5368 AT_SETUP([ofproto-dpif - continuation flow stats])
5369 AT_KEYWORDS([continuations pause resume])
5372 add_of_ports --pcap br0 `seq 1 2`
5374 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5376 AT_DATA([flows.txt], [dnl
5377 table=0 in_port=1 actions=set_field:1->reg1 controller(pause) resubmit(,2)
5378 table=2 reg1=0x1 actions=2
5381 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5383 AT_CAPTURE_FILE([ofctl_monitor0.log])
5384 ovs-ofctl monitor br0 resume --detach --no-chdir \
5385 --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
5387 # Run a packet through the switch.
5388 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5391 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5392 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sed -n 's/idle_age=[[0-9]]*/idle_age=0/p' | grep 'table=2'], [0], [dnl
5393 cookie=0x0, duration=0.0s, table=2, n_packets=1, n_bytes=106, idle_age=0, reg1=0x1 actions=output:2
5396 # The packet should be received by port 2
5397 AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
5402 AT_SETUP([ofproto-dpif - continuation with conntrack])
5403 AT_KEYWORDS([continuations pause resume])
5406 add_of_ports --pcap br0 `seq 1 2`
5408 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5410 AT_DATA([flows.txt], [dnl
5411 table=0, in_port=1 icmp action=ct(table=1)
5412 table=1, icmp action=controller(pause) resubmit(,2)
5413 table=2, in_port=1 icmp ct_state=+trk+new action=output:2
5416 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5418 AT_CAPTURE_FILE([ofctl_monitor0.log])
5419 ovs-ofctl monitor br0 resume --detach --no-chdir \
5420 --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
5422 # Run a packet through the switch.
5423 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5426 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5427 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sed -n 's/idle_age=[[0-9]]*/idle_age=0/p' | grep 'table=2'], [0], [dnl
5428 cookie=0x0, duration=0.0s, table=2, n_packets=1, n_bytes=106, idle_age=0, ct_state=+new+trk,icmp,in_port=1 actions=output:2
5431 # The packet should be received by port 2
5432 AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
5437 AT_SETUP([ofproto-dpif - continuation with patch port])
5438 AT_KEYWORDS([continuations pause resume])
5440 [add-port br0 p0 -- set Interface p0 type=dummy -- \
5441 add-port br0 patch- -- \
5442 set interface patch- type=patch options:peer=patch+ -- \
5443 add-br br1 -- set bridge br1 datapath-type=dummy fail-mode=secure -- \
5444 add-port br1 patch+ -- set interface patch+ type=patch options:peer=patch-
5446 add_of_ports --pcap br1 1
5448 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5450 AT_DATA([flows.txt], [dnl
5451 table=0, in_port=patch+ icmp action=controller(pause), resubmit(,1)
5452 table=1, in_port=patch+ icmp action=ct(table=2)
5453 table=2, in_port=patch+ icmp ct_state=+trk+new action=ct(commit, table=3)
5454 table=3, in_port=patch+ icmp action=p1
5457 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5458 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br1 flows.txt])
5460 AT_CAPTURE_FILE([ofctl_monitor.log])
5461 ovs-ofctl monitor br1 resume --detach --no-chdir --pidfile=ovs-ofctl.pid 2> ofctl_monitor.log
5463 # Run a packet through the switch.
5464 AT_CHECK([ovs-appctl netdev-dummy/receive p0 "$flow"], [0], [stdout])
5467 AT_CHECK([ovs-ofctl dump-flows br1], [0], [stdout])
5468 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sed -n 's/idle_age=[[0-9]]*/idle_age=0/p' | grep 'table=3' | grep -v 'commit'], [0], [dnl
5469 cookie=0x0, duration=0.0s, table=3, n_packets=1, n_bytes=106, idle_age=0, icmp,in_port=1 actions=output:2
5472 # The packet should be received by port 1
5473 AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p1-tx.pcap | wc -l`])
5478 # Check that pause works after the packet is cloned.
5479 AT_SETUP([ofproto-dpif - continuation after clone])
5480 AT_KEYWORDS([continuations clone pause resume])
5483 add_of_ports --pcap br0 `seq 1 3`
5485 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
5487 AT_DATA([flows.txt], [dnl
5488 table=0 in_port=1 actions=set_field:1->reg1 resubmit(,2)
5489 table=1 reg1=0x5 actions=controller(pause) resubmit(,3)
5490 table=1 reg1=0x1 actions=2
5491 table=2 in_port=1 actions=clone(set_field:5->reg1, resubmit(,1))
5492 table=3 reg1=0x1 actions=3
5493 table=3 reg1=0x5 actions=2
5496 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5498 AT_CAPTURE_FILE([ofctl_monitor0.log])
5499 ovs-ofctl monitor br0 resume --detach --no-chdir \
5500 --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
5502 # Run a packet through the switch.
5503 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5506 ovs-ofctl dump-flows br0
5508 # The packet should be received by port 2 and not port 3
5509 AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
5510 AT_CHECK([test 0 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p3-tx.pcap | wc -l`])
5512 # NXT_RESUMEs should be 1 and reg1 should be set to 0x5.
5513 OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor*.log | grep NXT_RESUME | grep -c reg1=0x5`])
5518 # Two testcases below are for the ofproto/trace command
5519 # The first one tests all correct syntax:
5520 # ofproto/trace [dp_name] odp_flow [-generate|packet]
5521 # ofproto/trace br_name br_flow [-generate|packet]
5522 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
5523 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
5524 add_of_ports br0 1 2 3
5526 AT_DATA([flows.txt], [dnl
5527 in_port=1 actions=output:2
5528 in_port=2 actions=output:1
5530 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5532 odp_flow="in_port(p1)"
5534 # Test command: ofproto/trace odp_flow with in_port as a name.
5535 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
5536 AT_CHECK([tail -1 stdout], [0], [dnl
5540 odp_flow="in_port(1)"
5541 # Test command: ofproto/trace odp_flow
5542 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
5543 AT_CHECK([tail -1 stdout], [0], [dnl
5547 # Test command: ofproto/trace dp_name odp_flow
5548 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
5549 AT_CHECK([tail -1 stdout], [0], [dnl
5552 # Test commmand: ofproto/trace br_name br_flow
5553 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
5554 AT_CHECK([tail -1 stdout], [0], [dnl
5558 # Delete the inserted flows
5559 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
5560 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
5562 # This section below tests the [-generate] option
5563 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
5564 br_flow="arp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=ff:ff:ff:ff:ff:ff"
5566 # Test command: ofproto/trace odp_flow
5567 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
5568 # Check for no MAC learning entry
5569 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5573 # Test command: ofproto/trace br_name br_flow
5574 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
5575 # Check for no MAC learning entry
5576 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5580 # Test command: ofproto/trace odp_flow -generate
5581 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
5582 # Check for the MAC learning entry
5583 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5585 3 0 50:54:00:00:00:05 ?
5588 # Test command: ofproto/trace dp_name odp_flow -generate
5589 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5590 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
5591 -generate], [0], [stdout])
5592 # Check for both MAC learning entries
5593 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5595 3 0 50:54:00:00:00:05 ?
5596 1 0 50:54:00:00:00:06 ?
5599 # Test command: ofproto/trace br_name br_flow -generate
5600 AT_CHECK([ovs-appctl ofproto/trace br0 \
5601 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
5602 -generate], [0], [stdout])
5603 # Check for both MAC learning entries.
5604 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5606 3 0 50:54:00:00:00:05 ?
5607 1 0 50:54:00:00:00:06 ?
5608 2 0 50:54:00:00:00:07 ?
5611 # This section beflow tests the [packet] option
5612 # The ovs-tcpundump of packets between port1 and port2
5613 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
5614 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
5616 # Construct the MAC learning table
5617 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5618 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
5619 -generate], [0], [stdout])
5621 # Construct the MAC learning table
5622 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5623 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
5624 -generate], [0], [stdout])
5626 # Test command: ofproto/trace odp_flow packet
5627 AT_CHECK([ovs-appctl ofproto/trace \
5628 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
5629 AT_CHECK([tail -1 stdout], [0], [dnl
5632 AT_CHECK([head -n 3 stdout], [0], [dnl
5633 Flow: pkt_mark=0x2,skb_priority=0x1,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
5638 # Test command: ofproto/trace dp_name odp_flow packet
5639 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5640 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
5641 AT_CHECK([tail -1 stdout], [0], [dnl
5644 AT_CHECK([head -n 3 stdout], [0], [dnl
5645 Flow: pkt_mark=0x2,skb_priority=0x1,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
5650 # Test command: ofproto/trace br_name br_flow packet
5651 AT_CHECK([ovs-appctl ofproto/trace br0 \
5652 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
5653 AT_CHECK([tail -1 stdout], [0], [dnl
5656 AT_CHECK([head -n 3 stdout], [0], [dnl
5657 Flow: pkt_mark=0x1,skb_priority=0x2,arp,in_port=2,vlan_tci=0x0000,dl_src=50:54:00:00:00:02,dl_dst=50:54:00:00:00:01,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
5665 # The second test tests the corner cases
5666 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
5668 add_of_ports br0 1 2
5671 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
5672 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
5674 generate="-generate"
5675 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
5677 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
5683 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
5685 AT_CHECK([tail -2 stderr], [0], [dnl
5686 Cannot find the datapath
5687 ovs-appctl: ovs-vswitchd: server returned an error
5690 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
5696 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
5698 AT_CHECK([tail -2 stderr], [0], [dnl
5699 Cannot find the datapath
5700 ovs-appctl: ovs-vswitchd: server returned an error
5703 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
5709 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
5711 AT_CHECK([tail -2 stderr], [0], [dnl
5712 Cannot find the datapath
5713 ovs-appctl: ovs-vswitchd: server returned an error
5716 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
5722 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
5724 AT_CHECK([tail -2 stderr], [0], [dnl
5725 Cannot find the datapath
5726 ovs-appctl: ovs-vswitchd: server returned an error
5729 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
5735 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
5737 AT_CHECK([tail -2 stderr], [0], [dnl
5738 ovs-dummy: unknown bridge
5739 ovs-appctl: ovs-vswitchd: server returned an error
5742 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
5748 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
5750 AT_CHECK([tail -2 stderr], [0], [dnl
5751 syntax error at in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02 (or the bridge name was omitted)
5752 ovs-appctl: ovs-vswitchd: server returned an error
5755 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
5756 AT_CHECK([ovs-appctl ofproto/trace \
5757 ovs-dummy "$odp_flow" garbage_option],
5758 [2], [stdout],[stderr])
5759 AT_CHECK([tail -2 stderr], [0], [dnl
5760 Trailing garbage in packet data
5761 ovs-appctl: ovs-vswitchd: server returned an error
5764 # Test incorrect command: ofproto/trace with 0 argument
5765 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
5766 AT_CHECK([tail -2 stderr], [0], [dnl
5767 "ofproto/trace" command requires at least 1 arguments
5768 ovs-appctl: ovs-vswitchd: server returned an error
5774 # The third test checks that the output of "ovs-dpctl -m" is valid to trace.
5775 AT_SETUP([ofproto-dpif - ofproto/trace from dpctl output])
5776 OVS_VSWITCHD_START([dnl
5777 set Open_vSwitch . other_config:max-idle=10000 \
5778 -- add-port br0 p1 -- set Interface p1 type=dummy])
5780 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
5781 ovs-appctl revalidator/wait
5782 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows1.txt])
5784 odp_flow=`cat dp_flows1.txt`
5785 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
5793 Final flow: <cleared>
5795 Datapath actions: drop
5798 dnl Now, try again without megaflows:
5799 ovs-appctl upcall/disable-megaflows
5801 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
5802 ovs-appctl revalidator/wait
5803 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows2.txt])
5805 odp_flow=`cat dp_flows2.txt`
5806 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
5814 Final flow: <cleared>
5816 Datapath actions: drop
5822 AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
5824 add_of_ports br0 1 2 3
5826 AT_DATA([flows.txt], [dnl
5827 in_port=1 actions=output:2
5828 in_port=2 actions=output:1
5830 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5832 AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
5833 AT_CHECK([tail -1 stdout], [0], [dnl
5834 Datapath actions: push_vlan(vid=123,pcp=0),2
5841 m4_define([OFPROTO_TRACE],
5843 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
5844 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5846 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
5849 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
5852 AT_SETUP([ofproto-dpif - MAC learning])
5853 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
5854 add_of_ports br0 1 2 3
5856 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
5858 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
5861 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5865 # Check for the MAC learning entry.
5866 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5868 3 0 50:54:00:00:00:05 ?
5871 # Trace a packet arrival destined for the learned MAC.
5872 # (This will also learn a MAC.)
5875 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
5879 # Check for both MAC learning entries.
5880 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5882 3 0 50:54:00:00:00:05 ?
5883 1 0 50:54:00:00:00:06 ?
5886 # Trace a packet arrival that updates the first learned MAC entry.
5889 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5893 # Check that the MAC learning entry was updated.
5894 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5896 1 0 50:54:00:00:00:06 ?
5897 2 0 50:54:00:00:00:05 ?
5900 # Add another bridge.
5904 -- set bridge br1 datapath-type=dummy])
5905 add_of_ports br1 4 5
5907 # Trace some packet arrivals in br1 to create MAC learning entries there too.
5910 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
5915 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
5919 # Check that the MAC learning entries were added.
5920 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5922 4 0 50:54:00:00:00:06 ?
5923 5 0 50:54:00:00:00:07 ?
5926 # Delete port p1 and see that its MAC learning entry disappeared, and
5927 # that the MAC learning entry for the same MAC was also deleted from br1.
5928 AT_CHECK([ovs-vsctl del-port p1])
5929 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5931 2 0 50:54:00:00:00:05 ?
5933 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5935 5 0 50:54:00:00:00:07 ?
5941 AT_SETUP([ofproto-dpif - MAC table overflow])
5943 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
5944 add_of_ports br0 1 2 3
5946 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
5948 AT_CHECK([ovs-appctl time/stop])
5950 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
5951 for i in 0 1 2 3 4 5 6 7 8 9; do
5954 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
5957 ovs-appctl time/warp 1000
5960 # Check for the MAC learning entries.
5961 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5963 3 0 50:54:00:00:00:00
5964 3 0 50:54:00:00:00:01
5965 3 0 50:54:00:00:00:02
5966 3 0 50:54:00:00:00:03
5967 3 0 50:54:00:00:00:04
5968 3 0 50:54:00:00:00:05
5969 3 0 50:54:00:00:00:06
5970 3 0 50:54:00:00:00:07
5971 3 0 50:54:00:00:00:08
5972 3 0 50:54:00:00:00:09
5976 # Trace another ARP packet on another MAC.
5979 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
5983 # Check that the new one chased the oldest one out of the table.
5984 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
5986 3 0 50:54:00:00:00:01 ?
5987 3 0 50:54:00:00:00:02 ?
5988 3 0 50:54:00:00:00:03 ?
5989 3 0 50:54:00:00:00:04 ?
5990 3 0 50:54:00:00:00:05 ?
5991 3 0 50:54:00:00:00:06 ?
5992 3 0 50:54:00:00:00:07 ?
5993 3 0 50:54:00:00:00:08 ?
5994 3 0 50:54:00:00:00:09 ?
5995 3 0 50:54:00:00:00:10 ?
6001 AT_SETUP([ofproto-dpif - MAC table overflow fairness])
6003 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
6004 add_of_ports br0 1 2 3 4 5 6
6006 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
6008 AT_CHECK([ovs-appctl time/stop])
6010 # Trace packets with 2 different source MACs arriving on each of the 5
6011 # ports, filling up the 10-entry learning table.
6012 for i in 0 1 2 3 4 5 6 7 8 9; do
6014 ovs-appctl ofproto/trace ovs-dummy "in_port($p),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp" -generate
6015 ovs-appctl time/warp 1000
6018 # Check for the MAC learning entries.
6019 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
6021 1 0 50:54:00:00:00:00
6022 1 0 50:54:00:00:00:01
6023 2 0 50:54:00:00:00:02
6024 2 0 50:54:00:00:00:03
6025 3 0 50:54:00:00:00:04
6026 3 0 50:54:00:00:00:05
6027 4 0 50:54:00:00:00:06
6028 4 0 50:54:00:00:00:07
6029 5 0 50:54:00:00:00:08
6030 5 0 50:54:00:00:00:09
6034 # Now trace 16 new MACs on another port.
6035 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
6036 ovs-appctl ofproto/trace ovs-dummy "in_port(6),eth(src=50:54:00:00:0$i:ff,dst=ff:ff:ff:ff:ff:ff),$arp" -generate
6037 ovs-appctl time/warp 1000
6040 # Check the results.
6042 # Our eviction algorithm on overflow is that an arbitrary (but deterministic)
6043 # one of the ports with the most learned MACs loses the least recently used
6044 # one. Thus, the new port will end up with 3 MACs, 3 of the old ports with 1
6045 # MAC each, and the other 2 of the old ports with 2 MACs each.
6047 # (If someone changes lib/heap.c to do something different with equal-priority
6048 # nodes, then the output below could change, but it would still follow the
6049 # rules explained above.)
6050 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
6052 1 0 50:54:00:00:00:01
6053 2 0 50:54:00:00:00:03
6054 3 0 50:54:00:00:00:04
6055 3 0 50:54:00:00:00:05
6056 4 0 50:54:00:00:00:07
6057 5 0 50:54:00:00:00:08
6058 5 0 50:54:00:00:00:09
6059 6 0 50:54:00:00:0d:ff
6060 6 0 50:54:00:00:0e:ff
6061 6 0 50:54:00:00:0f:ff
6067 # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR)
6069 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
6070 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
6071 [AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6072 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6074 on_exit 'kill `cat test-sflow.pid`'
6075 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
6076 AT_CAPTURE_FILE([sflow.log])
6077 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6078 ovs-appctl time/stop
6080 add_of_ports br0 1 2
6082 set Interface br0 options:ifindex=1002 -- \
6083 set Interface p1 options:ifindex=1004 -- \
6084 set Interface p2 options:ifindex=1003 -- \
6085 set Bridge br0 sflow=@sf -- \
6086 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
6087 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
6089 dnl open with ARP packets to seed the bridge-learning. The output
6090 dnl ifIndex numbers should be reported predictably after that.
6091 dnl Since we set sampling=1 we should see all of these packets
6092 dnl reported. Sorting the output by data-source and seqNo makes
6093 dnl it deterministic. Ensuring that we send at least two packets
6094 dnl into each port means we get to check the seq nos are
6095 dnl incrementing correctly.
6096 dnl because packets from different ports can be handled by separate
6097 dnl threads, put some sleeps
6099 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.2,tip=192.168.0.1,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
6101 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:07,tha=00:00:00:00:00:00)'
6103 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
6105 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'
6106 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=fe80::1,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'
6108 dnl sleep long enough to get more than one counter sample
6109 dnl from each datasource so we can check sequence numbers
6110 ovs-appctl time/warp 2000 100
6112 OVS_APP_EXIT_AND_WAIT([test-sflow])
6114 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6115 /g' | sed 's/\(.*\)ds=\[::1\]\(.*\)/\1ds=127.0.0.1\2/g' ]], [0], [dnl
6135 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-05-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-05-C0-A8-00-02-00-00-00-00-00-00-C0-A8-00-01
6155 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-07-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-07-C0-A8-00-01-00-00-00-00-00-00-C0-A8-00-02
6175 hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-5C-00-00-00-00-40-01-F9-4D-C0-A8-00-01-C0-A8-00-02-08-00-13-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6195 hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-5C-00-00-00-00-40-01-F9-4D-C0-A8-00-02-C0-A8-00-01-00-00-1B-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6215 hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-67-00-00-00-00-00-0A-80-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-01-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-02
6218 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'ETHCOUNTERS|IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -24 | sed 's/ /\
6219 /g' | sed 's/\(.*\)ds=\[::1\]\(.*\)/\1ds=127.0.0.1\2/g' ]], [0], [dnl
6221 dot3StatsAlignmentErrors=4294967295
6222 dot3StatsFCSErrors=4294967295
6223 dot3StatsSingleCollisionFrames=4294967295
6224 dot3StatsMultipleCollisionFrames=4294967295
6225 dot3StatsSQETestErrors=4294967295
6226 dot3StatsDeferredTransmissions=4294967295
6227 dot3StatsLateCollisions=4294967295
6228 dot3StatsExcessiveCollisions=4294967295
6229 dot3StatsInternalMacTransmitErrors=4294967295
6230 dot3StatsCarrierSenseErrors=4294967295
6231 dot3StatsFrameTooLongs=4294967295
6232 dot3StatsInternalMacReceiveErrors=4294967295
6233 dot3StatsSymbolErrors=4294967295
6235 dot3StatsAlignmentErrors=4294967295
6236 dot3StatsFCSErrors=4294967295
6237 dot3StatsSingleCollisionFrames=4294967295
6238 dot3StatsMultipleCollisionFrames=4294967295
6239 dot3StatsSQETestErrors=4294967295
6240 dot3StatsDeferredTransmissions=4294967295
6241 dot3StatsLateCollisions=4294967295
6242 dot3StatsExcessiveCollisions=4294967295
6243 dot3StatsInternalMacTransmitErrors=4294967295
6244 dot3StatsCarrierSenseErrors=4294967295
6245 dot3StatsFrameTooLongs=4294967295
6246 dot3StatsInternalMacReceiveErrors=4294967295
6247 dot3StatsSymbolErrors=4294967295
6249 dot3StatsAlignmentErrors=4294967295
6250 dot3StatsFCSErrors=4294967295
6251 dot3StatsSingleCollisionFrames=4294967295
6252 dot3StatsMultipleCollisionFrames=4294967295
6253 dot3StatsSQETestErrors=4294967295
6254 dot3StatsDeferredTransmissions=4294967295
6255 dot3StatsLateCollisions=4294967295
6256 dot3StatsExcessiveCollisions=4294967295
6257 dot3StatsInternalMacTransmitErrors=4294967295
6258 dot3StatsCarrierSenseErrors=4294967295
6259 dot3StatsFrameTooLongs=4294967295
6260 dot3StatsInternalMacReceiveErrors=4294967295
6261 dot3StatsSymbolErrors=4294967295
6263 dot3StatsAlignmentErrors=4294967295
6264 dot3StatsFCSErrors=4294967295
6265 dot3StatsSingleCollisionFrames=4294967295
6266 dot3StatsMultipleCollisionFrames=4294967295
6267 dot3StatsSQETestErrors=4294967295
6268 dot3StatsDeferredTransmissions=4294967295
6269 dot3StatsLateCollisions=4294967295
6270 dot3StatsExcessiveCollisions=4294967295
6271 dot3StatsInternalMacTransmitErrors=4294967295
6272 dot3StatsCarrierSenseErrors=4294967295
6273 dot3StatsFrameTooLongs=4294967295
6274 dot3StatsInternalMacReceiveErrors=4294967295
6275 dot3StatsSymbolErrors=4294967295
6277 dot3StatsAlignmentErrors=4294967295
6278 dot3StatsFCSErrors=4294967295
6279 dot3StatsSingleCollisionFrames=4294967295
6280 dot3StatsMultipleCollisionFrames=4294967295
6281 dot3StatsSQETestErrors=4294967295
6282 dot3StatsDeferredTransmissions=4294967295
6283 dot3StatsLateCollisions=4294967295
6284 dot3StatsExcessiveCollisions=4294967295
6285 dot3StatsInternalMacTransmitErrors=4294967295
6286 dot3StatsCarrierSenseErrors=4294967295
6287 dot3StatsFrameTooLongs=4294967295
6288 dot3StatsInternalMacReceiveErrors=4294967295
6289 dot3StatsSymbolErrors=4294967295
6291 dot3StatsAlignmentErrors=4294967295
6292 dot3StatsFCSErrors=4294967295
6293 dot3StatsSingleCollisionFrames=4294967295
6294 dot3StatsMultipleCollisionFrames=4294967295
6295 dot3StatsSQETestErrors=4294967295
6296 dot3StatsDeferredTransmissions=4294967295
6297 dot3StatsLateCollisions=4294967295
6298 dot3StatsExcessiveCollisions=4294967295
6299 dot3StatsInternalMacTransmitErrors=4294967295
6300 dot3StatsCarrierSenseErrors=4294967295
6301 dot3StatsFrameTooLongs=4294967295
6302 dot3StatsInternalMacReceiveErrors=4294967295
6303 dot3StatsSymbolErrors=4294967295
6315 in_multicasts=4294967295
6316 in_broadcasts=4294967295
6317 in_discards=4294967295
6318 in_errors=4294967295
6319 in_unknownprotos=4294967295
6322 out_multicasts=4294967295
6323 out_broadcasts=4294967295
6324 out_discards=4294967295
6325 out_errors=4294967295
6338 in_multicasts=4294967295
6339 in_broadcasts=4294967295
6340 in_discards=4294967295
6341 in_errors=4294967295
6342 in_unknownprotos=4294967295
6345 out_multicasts=4294967295
6346 out_broadcasts=4294967295
6347 out_discards=4294967295
6348 out_errors=4294967295
6361 in_multicasts=4294967295
6362 in_broadcasts=4294967295
6363 in_discards=4294967295
6364 in_errors=4294967295
6365 in_unknownprotos=4294967295
6368 out_multicasts=4294967295
6369 out_broadcasts=4294967295
6370 out_discards=4294967295
6371 out_errors=4294967295
6384 in_multicasts=4294967295
6385 in_broadcasts=4294967295
6386 in_discards=4294967295
6387 in_errors=4294967295
6388 in_unknownprotos=4294967295
6391 out_multicasts=4294967295
6392 out_broadcasts=4294967295
6393 out_discards=4294967295
6394 out_errors=4294967295
6407 in_multicasts=4294967295
6408 in_broadcasts=4294967295
6409 in_discards=4294967295
6410 in_errors=4294967295
6411 in_unknownprotos=4294967295
6414 out_multicasts=4294967295
6415 out_broadcasts=4294967295
6416 out_discards=4294967295
6417 out_errors=4294967295
6430 in_multicasts=4294967295
6431 in_broadcasts=4294967295
6432 in_discards=4294967295
6433 in_errors=4294967295
6434 in_unknownprotos=4294967295
6437 out_multicasts=4294967295
6438 out_broadcasts=4294967295
6439 out_discards=4294967295
6440 out_errors=4294967295
6443 datapath_id=18364758544493064720
6446 datapath_id=18364758544493064720
6449 datapath_id=18364758544493064720
6452 datapath_id=18364758544493064720
6455 datapath_id=18364758544493064720
6458 datapath_id=18364758544493064720
6474 AT_SETUP([ofproto-dpif - basic truncate action])
6476 add_of_ports br0 1 2 3 4 5
6478 AT_CHECK([ovs-vsctl -- set Interface p1 type=dummy options:pcap=p1.pcap])
6479 AT_CHECK([ovs-vsctl -- set Interface p2 type=dummy options:pstream=punix:p2.sock])
6480 AT_CHECK([ovs-vsctl -- set Interface p3 type=dummy options:stream=unix:p2.sock])
6481 AT_CHECK([ovs-vsctl -- set Interface p4 type=dummy options:pstream=punix:p4.sock])
6482 AT_CHECK([ovs-vsctl -- set Interface p5 type=dummy options:stream=unix:p4.sock])
6484 AT_DATA([flows.txt], [dnl
6485 in_port=3,actions=drop
6486 in_port=5,actions=drop
6487 in_port=1,actions=output(port=2,max_len=64),output:4
6489 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6491 dnl Datapath actions
6492 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
6493 AT_CHECK([tail -1 stdout], [0],
6494 [Datapath actions: trunc(64),2,4
6497 dnl An 170 byte packet
6498 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
6500 AT_CHECK([ovs-ofctl parse-pcap p1.pcap], [0], [dnl
6501 icmp,in_port=ANY,vlan_tci=0x0000,dl_src=00:50:56:c0:00:08,dl_dst=00:0c:29:c8:a0:a4,nw_src=192.168.218.1,nw_dst=192.168.218.100,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0
6504 AT_CHECK([ovs-appctl revalidator/purge], [0])
6505 dnl packet with truncated size
6506 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6509 dnl packet with original size
6510 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6514 dnl More complicated case
6515 AT_CHECK([ovs-ofctl del-flows br0])
6516 AT_DATA([flows.txt], [dnl
6517 in_port=3,actions=drop
6518 in_port=5,actions=drop
6519 in_port=1,actions=output(port=2,max_len=64),output(port=2,max_len=128),output(port=4,max_len=60),output:2,output:4
6521 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6523 dnl Datapath actions
6524 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
6525 AT_CHECK([tail -1 stdout], [0],
6526 [Datapath actions: trunc(64),2,trunc(128),2,trunc(60),4,2,4
6529 dnl An 170 byte packet
6530 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
6532 AT_CHECK([ovs-appctl revalidator/purge], [0])
6533 dnl packet size: 64 + 128 + 170 = 362
6534 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6537 dnl packet size: 60 + 170 = 230
6538 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6543 AT_CHECK([ovs-ofctl add-flow br0 'actions=output(port=ALL,max_len=100)'], [1], [], [dnl
6544 ovs-ofctl: output to unsupported truncate port: ALL
6550 AT_SETUP([ofproto-dpif - truncate and output to patch port])
6551 OVS_VSWITCHD_START([add-br br1 \
6552 -- set bridge br1 datapath-type=dummy fail-mode=secure \
6553 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 ofport_request=1 \
6554 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
6558 AT_CHECK([ovs-ofctl add-flow br0 actions='output(port=1,max_len=100),output:2'])
6559 AT_CHECK([ovs-ofctl add-flow br1 actions=NORMAL])
6561 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6563 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
6565 dnl the output(port=1,max_len=100) fails the translation, only output:2 in datapath
6566 AT_CHECK([grep "output_trunc does not support patch port [[0-9]]*" stdout], [0], [stdout])
6571 AT_SETUP([ofproto-dpif - truncate and output to gre tunnel])
6572 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
6573 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
6574 options:key=5 ofport_request=1\
6575 -- add-port br0 p2 -- set Interface p2 type=dummy \
6577 AT_DATA([flows.txt], [dnl
6578 actions=output(max_len=100, port=1)
6580 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
6581 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6583 AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl
6584 br0 65534/100: (dummy-internal)
6585 p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1)
6590 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
6591 AT_CHECK([tail -1 stdout], [0],
6592 [Datapath actions: trunc(100),set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,ttl=64,flags(df|key))),1
6598 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv4 collector])
6599 CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1])
6602 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv6 collector])
6603 AT_SKIP_IF([test $HAVE_IPV6 = no])
6604 CHECK_SFLOW_SAMPLING_PACKET([[[::1]]])
6607 dnl Test sFlow LAG structures
6608 AT_SETUP([ofproto-dpif - sFlow packet sampling - LACP structures])
6609 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
6610 OVS_VSWITCHD_START([dnl
6611 add-bond br0 bond p1 p2 -- \
6612 set Port bond lacp=active bond-mode=active-backup \
6613 other_config:lacp-time="fast" \
6614 other_config:lacp-system-id=11:22:33:44:55:66 \
6615 other_config:lacp-system-priority=54321 -- \
6616 set Interface p1 type=dummy \
6617 other_config:lacp-port-id=11 \
6618 other_config:lacp-port-priority=111 \
6619 other_config:lacp-aggregation-key=3333 -- \
6620 set Interface p2 type=dummy \
6621 other_config:lacp-port-id=22 \
6622 other_config:lacp-port-priority=222 \
6623 other_config:lacp-aggregation-key=3333 ])
6625 on_exit 'kill `cat test-sflow.pid`'
6626 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6627 AT_CAPTURE_FILE([sflow.log])
6628 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6630 ovs-appctl time/stop
6633 set Interface p1 options:ifindex=1003 -- \
6634 set Bridge br0 sflow=@sf -- \
6635 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
6636 header=128 sampling=1 polling=1 agent=127.0.0.1
6638 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6639 AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
6640 AT_CHECK([ovs-appctl revalidator/purge], [0])
6641 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6642 OVS_APP_EXIT_AND_WAIT([test-sflow])
6643 AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
6646 sysID=11:22:33:44:55:66
6647 partnerID=00:00:00:00:00:00
6654 markerPDUsRx=4294967295
6655 markerRespPDUsRx=4294967295
6656 unknownRx=4294967295
6659 markerPDUsTx=4294967295
6660 markerRespPDUsTx=4294967295
6665 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel set])
6666 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6667 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6669 dnl set up sFlow logging
6670 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6671 AT_CAPTURE_FILE([sflow.log])
6672 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6673 ovs-appctl time/stop
6675 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
6676 AT_CHECK([ovs-vsctl add-port br0 gre0 -- set Interface gre0 type=gre \
6677 options:remote_ip=1.1.1.1 options:key=456 ofport_request=3])
6678 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy ofport_request=4])
6680 AT_CHECK([ovs-ofctl add-flow br0 action=3])
6684 set Bridge br0 sflow=@sf -- \
6685 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
6686 header=128 sampling=1 polling=0
6688 dnl introduce a packet that will be flooded to the tunnel
6689 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'])
6691 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6692 for i in `seq 1 30`; do
6693 ovs-appctl time/warp 100
6696 OVS_APP_EXIT_AND_WAIT([test-sflow])
6698 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6704 tunnel4_out_length=0
6705 tunnel4_out_protocol=47
6706 tunnel4_out_src=0.0.0.0
6707 tunnel4_out_dst=1.1.1.1
6708 tunnel4_out_src_port=0
6709 tunnel4_out_dst_port=0
6710 tunnel4_out_tcp_flags=0
6728 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-08-00-45-01-00-5C-00-00-00-00-80-01-12-8A-0A-0A-0A-02-0A-0A-0A-01-08-00-13-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6731 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6734 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel push])
6735 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6737 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 options:ifindex=1010])
6739 dnl set up sFlow logging
6740 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6741 AT_CAPTURE_FILE([sflow.log])
6742 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6743 ovs-appctl time/stop
6745 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6746 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
6747 AT_CHECK([ovs-vsctl -- add-port int-br t1 -- set Interface t1 type=gre \
6748 options:remote_ip=1.1.2.92 options:key=456 ofport_request=4\
6749 -- add-port int-br vm1 -- set Interface vm1 type=dummy \
6750 options:ifindex=2011 ofport_request=5
6753 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
6754 dummy@ovs-dummy: hit:0 missed:0
6756 br0 65534/100: (dummy-internal)
6757 p0 1/1: (dummy: ifindex=1010)
6759 int-br 65534/2: (dummy-internal)
6760 t1 4/4: (gre: key=456, remote_ip=1.1.2.92)
6761 vm1 5/3: (dummy: ifindex=2011)
6764 dnl set up route to 1.1.2.92 via br0 and action=normal
6765 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
6767 AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
6769 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
6771 dnl Prime ARP Cache for 1.1.2.92
6772 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
6774 dnl configure sflow on int-br only
6776 set Bridge int-br sflow=@sf -- \
6777 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
6778 header=128 sampling=1 polling=0
6780 dnl set up route to 192.168.1.2 via br0
6781 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 192.168.1.1/16], [0], [OK
6783 AT_CHECK([ovs-appctl ovs/route/add 192.168.0.0/16 br0], [0], [OK
6786 dnl add rule for int-br to force packet onto tunnel. There is no ifindex
6787 dnl for this port so the sFlow output will just report that it went to
6788 dnl 1 output (out_format=2, out_ifindex=1)
6789 AT_CHECK([ovs-ofctl add-flow int-br "actions=4"])
6791 AT_CHECK([ovs-appctl netdev-dummy/receive vm1 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.2.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'])
6793 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6794 for i in `seq 1 30`; do
6795 ovs-appctl time/warp 100
6798 OVS_APP_EXIT_AND_WAIT([test-sflow])
6800 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6806 tunnel4_out_length=0
6807 tunnel4_out_protocol=47
6808 tunnel4_out_src=1.1.2.88
6809 tunnel4_out_dst=1.1.2.92
6810 tunnel4_out_src_port=0
6811 tunnel4_out_dst_port=0
6812 tunnel4_out_tcp_flags=0
6830 hdr=50-54-00-00-00-0A-50-54-00-00-00-05-08-00-45-00-00-5C-00-00-00-00-80-01-B6-4D-C0-A8-01-01-C0-A8-02-02-08-00-13-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6833 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6836 AT_SETUP([ofproto-dpif - sFlow packet sampling - MPLS])
6837 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6839 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6840 add_of_ports br0 1 2
6841 AT_DATA([flows.txt], [dnl
6842 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,set_mpls_label:789,set_mpls_tc:4,set_mpls_ttl:32,2
6843 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
6845 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6847 dnl set up sFlow logging
6848 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6849 AT_CAPTURE_FILE([sflow.log])
6850 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6851 ovs-appctl time/stop
6855 set Bridge br0 sflow=@sf -- \
6856 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
6857 header=128 sampling=1 polling=0
6859 AT_CHECK([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(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
6860 AT_CHECK([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(0x0800)'])
6862 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6863 for i in `seq 1 30`; do
6864 ovs-appctl time/warp 100
6867 OVS_APP_EXIT_AND_WAIT([test-sflow])
6869 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6898 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-88-47-00-00-B7-40
6922 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-08-00-45-00-00-14-00-00-00-00-00-00-BA-EB-00-00-00-00-00-00-00-00
6925 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6929 # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR)
6931 # Test that basic NetFlow reports flow statistics correctly:
6932 # The initial packet of a flow are correctly accounted.
6933 # Later packets within a flow are correctly accounted.
6934 # Flow actions changing (in this case, due to MAC learning)
6935 # cause a record to be sent.
6936 m4_define([CHECK_NETFLOW_EXPIRATION],
6937 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6938 add_of_ports br0 1 2
6940 ovs-appctl time/stop
6941 on_exit 'kill `cat test-netflow.pid`'
6942 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6943 AT_CAPTURE_FILE([netflow.log])
6944 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6947 set Bridge br0 netflow=@nf -- \
6948 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6949 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
6951 for delay in 1000 30000; do
6952 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
6953 sleep 1 # ensure the order in which these two packets are processed
6954 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'
6956 ovs-appctl time/warp $delay
6959 ovs-appctl time/warp 6000
6960 ovs-appctl revalidator/wait
6962 OVS_APP_EXIT_AND_WAIT([test-netflow])
6964 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 106 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6966 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 106 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6968 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 212 bytes, ICMP 0:0" netflow.log | wc -l`
6969 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 106 bytes, ICMP 0:0" netflow.log | wc -l`
6970 AT_CHECK([test $separate = 2 || test $combined = 1], [0])])
6972 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv4 collector])
6973 CHECK_NETFLOW_EXPIRATION([127.0.0.1])
6976 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv6 collector])
6977 AT_SKIP_IF([test $HAVE_IPV6 = no])
6978 CHECK_NETFLOW_EXPIRATION([[[::1]]])
6981 # CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR)
6983 # Test that basic NetFlow reports active expirations correctly.
6984 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
6985 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6986 add_of_ports br0 1 2
6988 on_exit 'kill `cat test-netflow.pid`'
6989 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6990 AT_CAPTURE_FILE([netflow.log])
6991 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6994 set Bridge br0 netflow=@nf -- \
6995 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6996 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
6998 AT_CHECK([ovs-appctl time/stop])
7000 while test $n -le 60; do
7003 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=1234,dst=80)'
7004 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)'
7006 ovs-appctl time/warp 1000
7009 ovs-appctl time/warp 10000
7011 ovs-appctl revalidator/wait
7013 OVS_APP_EXIT_AND_WAIT([test-netflow])
7015 # Count the number of reported packets:
7016 # - From source to destination before MAC learning kicks in (just one).
7017 # - From source to destination after that.
7018 # - From destination to source.
7026 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
7033 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
7036 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
7039 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
7046 eval $counter=\`expr \$$counter + \$pkts\`
7047 n_recs=`expr $n_recs + 1`
7050 # There should be exactly 1 MAC learning packet,
7051 # exactly 59 other packets in that direction,
7052 # and exactly 60 packets in the other direction.
7053 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
7056 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv4 collector])
7057 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1])
7060 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv6 collector])
7061 AT_SKIP_IF([test $HAVE_IPV6 = no])
7062 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]])
7065 dnl In the absence of an IPFIX collector to verify protocol correctness, simply
7066 dnl configure bridge IPFIX and ensure that sample action generation works at the
7068 AT_SETUP([ofproto-dpif - Bridge IPFIX sanity check])
7070 add_of_ports br0 1 2
7072 dnl Sample every packet using bridge-based sampling.
7073 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
7074 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
7075 sampling=1], [0], [ignore])
7077 dnl Send some packets that should be sampled.
7078 for i in `seq 1 3`; do
7079 AT_CHECK([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(0x0800)'])
7081 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7082 flow-dump from non-dpdk interfaces:
7083 packets:2, bytes:68, used:0.001s, actions:userspace(pid=0,ipfix(output_port=4294967295))
7086 AT_CHECK([ovs-appctl revalidator/purge])
7088 dnl Add a slowpath meter. The userspace action should be metered.
7089 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=slowpath pktps burst stats bands=type=drop rate=3 burst_size=1'])
7091 dnl Send some packets that should be sampled and metered.
7092 for i in `seq 1 3`; do
7093 AT_CHECK([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(0x0800)'])
7095 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7096 flow-dump from non-dpdk interfaces:
7097 packets:2, bytes:68, used:0.001s, actions:sample(sample=100.0%,actions(meter(0),userspace(pid=0,ipfix(output_port=4294967295))))
7100 dnl Remove the IPFIX configuration.
7101 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
7102 AT_CHECK([ovs-appctl revalidator/purge])
7104 dnl Send some more packets, to ensure that these are not sampled.
7105 for i in `seq 1 3`; do
7106 AT_CHECK([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(0x0800)'])
7108 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7109 flow-dump from non-dpdk interfaces:
7110 packets:2, bytes:68, used:0.001s, actions:drop
7113 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
7116 dnl Bridge IPFIX statistics check
7117 AT_SETUP([ofproto-dpif - Bridge IPFIX statistics check])
7119 add_of_ports br0 1 2
7121 dnl Negative test check.
7122 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
7123 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7124 NXST_IPFIX_BRIDGE request (xid=0x2):
7127 dnl Sample every packet using bridge-based sampling.
7128 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
7129 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
7130 sampling=1], [0], [ignore])
7132 dnl Send some packets that should be sampled.
7133 for i in `seq 1 20`; do
7134 AT_CHECK([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(0x0800)'])
7137 dnl There are 4 extra IPFIX template packets.
7138 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0 | sed 's/tx pkts=[[0-9]]*/tx pkts=24/' | sed 's/tx errs=[[0-9]]*/tx errs=0/'], [0], [dnl
7139 NXST_IPFIX_BRIDGE reply (xid=0x2):
7140 bridge ipfix: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=24
7141 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=0
7144 dnl Remove the IPFIX configuration.
7145 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
7146 AT_CHECK([ovs-appctl revalidator/purge])
7148 dnl Send some more packets, to ensure that these are not sampled.
7149 for i in `seq 1 2`; do
7150 AT_CHECK([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(0x0800)'])
7152 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
7153 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7154 NXST_IPFIX_BRIDGE request (xid=0x2):
7157 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
7160 dnl Flow IPFIX sanity check
7161 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check])
7163 add_of_ports br0 1 2
7165 # Check for regression against a bug where an invalid target caused an
7166 # assertion failure and a crash.
7167 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
7168 -- --id=@ipfix create IPFIX targets=\"xyzzy\" \
7169 -- --id=@cs create Flow_Sample_Collector_Set id=0 bridge=@br0 ipfix=@ipfix],
7172 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
7173 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
7174 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
7177 AT_DATA([flows.txt], [dnl
7178 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
7181 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7183 dnl Send some packets that should be sampled.
7184 for i in `seq 1 3`; do
7185 AT_CHECK([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(0x0800)'])
7187 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7188 flow-dump from non-dpdk interfaces:
7189 packets:2, bytes:68, used:0.001s, actions:userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=4294967295)),2
7192 dnl Remove the flow which contains sample action.
7193 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
7194 AT_CHECK([ovs-appctl revalidator/purge])
7196 dnl Send some more packets, to ensure that these are not sampled.
7197 for i in `seq 1 3`; do
7198 AT_CHECK([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(0x0800)'])
7200 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7201 flow-dump from non-dpdk interfaces:
7202 packets:2, bytes:68, used:0.001s, actions:drop
7205 OVS_VSWITCHD_STOP(["/sending to collector failed/d
7210 dnl Flow IPFIX sanity check for tunnel set
7211 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check - tunnel set])
7212 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
7213 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
7214 options:key=5 ofport_request=1\
7215 -- add-port br0 p2 -- set Interface p2 type=stt \
7216 options:remote_ip=1.1.1.2 options:local_ip=2.2.2.3 \
7217 options:key=6 ofport_request=2\
7218 -- add-port br0 p3 -- set Interface p3 type=dummy \
7220 -- --id=@br0 get Bridge br0 \
7221 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
7222 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
7227 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
7229 dnl Add openflow sample action without sampling_port.
7230 AT_DATA([flows.txt], [dnl
7231 in_port=3, actions=sample(probability=65535,collector_set_id=1),output:1
7233 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7235 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7236 AT_CHECK([tail -1 stdout], [0], [dnl
7237 Datapath actions: userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=4294967295)),set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),1
7240 dnl Remove the flow which contains sample action.
7241 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
7242 AT_CHECK([ovs-appctl revalidator/purge])
7244 dnl Add openflow sample action with sampling_port which is
7245 dnl equal to output port.
7246 AT_DATA([flows2.txt], [dnl
7247 in_port=3, actions=sample(probability=65535,collector_set_id=1,sampling_port=1),output:1
7249 AT_CHECK([ovs-ofctl add-flows br0 flows2.txt], [0], [ignore])
7251 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7252 dnl Make sure flow sample action in datapath is behind set tunnel
7253 dnl action at egress point of tunnel port.
7254 AT_CHECK([tail -1 stdout], [0], [dnl
7255 Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=1),tunnel_out_port=1),1
7258 dnl Remove the flow which contains sample action.
7259 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
7260 AT_CHECK([ovs-appctl revalidator/purge])
7262 dnl Add a rule with two sample actions and each sample action
7263 dnl has a sampling_port
7264 AT_DATA([flows3.txt], [dnl
7265 in_port=3, actions=sample(probability=65535,collector_set_id=1,sampling_port=1),output:1,sample(probability=65535,collector_set_id=1,sampling_port=2),output:2
7267 AT_CHECK([ovs-ofctl add-flows br0 flows3.txt], [0], [ignore])
7269 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7270 dnl Make sure flow sample action in datapath is behind set tunnel
7271 dnl action at egress point of tunnel port.
7272 AT_CHECK([tail -1 stdout], [0], [dnl
7273 Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=1),tunnel_out_port=1),1,set(tunnel(tun_id=0x6,src=2.2.2.3,dst=1.1.1.2,tos=0x1,ttl=64,tp_dst=7471,flags(df|key))),userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=7471),tunnel_out_port=7471),7471
7276 dnl Remove the flow which contains sample action.
7277 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
7278 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
7283 AT_SETUP([ofproto-dpif - clone action])
7285 add_of_ports br0 1 2 3 4
7287 dnl Reversible open flow clone actions, no datapath clone action should be generated.
7288 AT_DATA([flows.txt], [dnl
7289 in_port=1, ip, actions=clone(set_field:192.168.3.3->ip_src),clone(set_field:192.168.4.4->ip_dst,output:2),clone(mod_dl_src:80:81:81:81:81:81,set_field:192.168.5.5->ip_dst,output:3),output:4
7291 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7293 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7295 AT_CHECK([tail -1 stdout], [0], [dnl
7296 Datapath actions: set(ipv4(dst=192.168.4.4)),2,set(eth(src=80:81:81:81:81:81)),set(ipv4(dst=192.168.5.5)),3,set(eth(src=50:54:00:00:00:09)),set(ipv4(dst=10.10.10.1)),4
7299 dnl Test flow xlate openflow clone action without using datapath clone action.
7300 AT_CHECK([ovs-appctl dpif/set-dp-features br0 clone false], [0], [ignore])
7302 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7304 AT_CHECK([tail -1 stdout], [0], [dnl
7305 Datapath actions: set(ipv4(dst=192.168.4.4)),2,set(eth(src=80:81:81:81:81:81)),set(ipv4(dst=192.168.5.5)),3,set(eth(src=50:54:00:00:00:09)),set(ipv4(dst=10.10.10.1)),4
7308 AT_CHECK([ovs-appctl dpif/set-dp-features br0 sample_nesting 2], [0], [ignore])
7309 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7311 AT_CHECK([tail -1 stdout], [0], [dnl
7312 Datapath actions: set(ipv4(dst=192.168.4.4)),2,set(eth(src=80:81:81:81:81:81)),set(ipv4(dst=192.168.5.5)),3,set(eth(src=50:54:00:00:00:09)),set(ipv4(dst=10.10.10.1)),4
7315 dnl Mixing reversible and irreversible open flow clone actions. Datapath clone action
7316 dnl should be generated when necessary.
7318 dnl Restore the datapath support level.
7319 AT_CHECK([ovs-appctl dpif/set-dp-features br0 clone true], [0], [])
7320 AT_CHECK([ovs-appctl dpif/set-dp-features br0 sample_nesting 10], [0], [])
7322 AT_DATA([flows.txt], [dnl
7323 in_port=1, ip, actions=clone(set_field:192.168.3.3->ip_src),clone(set_field:192.168.4.4->ip_dst,output:2),clone(ct(commit),output:3),output:4
7325 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7327 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7329 AT_CHECK([tail -1 stdout], [0], [dnl
7330 Datapath actions: set(ipv4(dst=192.168.4.4)),2,set(ipv4(dst=10.10.10.1)),clone(ct(commit),3),4
7333 AT_CHECK([ovs-appctl dpif/set-dp-features br0 clone false], [0], [ignore])
7335 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7337 AT_CHECK([tail -1 stdout], [0], [dnl
7338 Datapath actions: set(ipv4(dst=192.168.4.4)),2,set(ipv4(dst=10.10.10.1)),sample(sample=100.0%,actions(ct(commit),3)),4
7341 AT_CHECK([ovs-appctl dpif/set-dp-features br0 sample_nesting 2], [0], [ignore])
7342 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
7344 AT_CHECK([tail -1 stdout], [0], [dnl
7345 Datapath actions: set(ipv4(dst=192.168.4.4)),2,set(ipv4(dst=10.10.10.1)),4
7347 AT_CHECK([grep "Failed to compose clone action" stdout], [0], [ignore])
7352 dnl Flow based IPFIX statistics check
7353 AT_SETUP([ofproto-dpif - Flow IPFIX statistics check])
7355 add_of_ports br0 1 2
7357 dnl Negative test check.
7358 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
7359 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7360 NXST_IPFIX_FLOW request (xid=0x2):
7363 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
7364 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
7365 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
7368 AT_DATA([flows.txt], [dnl
7369 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
7372 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7374 dnl Send some packets that should be sampled.
7375 for i in `seq 1 20`; do
7376 AT_CHECK([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(0x0800)'])
7379 dnl There are 4 extra IPFIX template packets.
7380 AT_CHECK([ovs-ofctl dump-ipfix-flow br0 | sed 's/tx pkts=[[0-9]]*/tx pkts=24/' | sed 's/tx errs=[[0-9]]*/tx errs=0/'], [0], [dnl
7381 NXST_IPFIX_FLOW reply (xid=0x2): 1 ids
7382 id 1: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=24
7383 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=0
7386 dnl Remove the flow which contains sample action.
7387 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
7388 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
7389 AT_CHECK([ovs-appctl revalidator/purge])
7391 dnl Send some more packets, to ensure that these are not sampled.
7392 for i in `seq 1 3`; do
7393 AT_CHECK([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(0x0800)'])
7395 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
7396 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7397 NXST_IPFIX_FLOW request (xid=0x2):
7400 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
7403 AT_SETUP([ofproto-dpif - flow stats])
7405 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
7406 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
7408 ovs-appctl time/stop
7410 for i in `seq 1 10`; do
7411 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
7414 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7415 AT_CHECK([ovs-appctl revalidator/purge], [0])
7416 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
7417 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
7418 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
7419 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=1180, idle_age=1, ip actions=NORMAL
7424 AT_SETUP([ofproto-dpif - flow stats reset_counts])
7426 flow="ip,actions=NORMAL"
7428 ovs-appctl time/stop
7430 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7432 warp_and_dump_NXM () {
7433 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7434 AT_CHECK([ovs-appctl revalidator/purge], [0])
7436 AT_CHECK_UNQUOTED([ovs-ofctl dump-flows br0], [0], [stdout])
7437 if [[ $5 -gt 0 ]]; then
7438 expected=" cookie=0x0, duration=$1s, table=0, n_packets=$2, n_bytes=$3, idle_age=$4, hard_age=$5, ip actions=NORMAL"
7440 expected=" cookie=0x0, duration=$1s, table=0, n_packets=$2, n_bytes=$3, idle_age=$4, ip actions=NORMAL"
7442 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
7447 warp_and_dump_OF () {
7448 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7449 AT_CHECK([ovs-appctl revalidator/purge], [0])
7451 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 dump-flows br0], [0], [stdout])
7452 if [[ $1 -lt 13 -o "$5X" = "X" ]]; then
7453 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, ip actions=NORMAL"
7455 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, $5 ip actions=NORMAL"
7457 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
7463 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
7466 # OpenFlow 1.0, implicit reset_counts
7468 warp_and_dump_NXM 1 1 118 1
7469 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow10 add-flow br0 $flow])
7470 # add-flow resets duration and counts,
7471 # but idle age is inherited from the old flow
7472 warp_and_dump_NXM 1 0 0 2
7475 warp_and_dump_NXM 2 1 118 1
7476 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow10 mod-flows br0 $flow])
7477 # mod-flows resets hard_age, but not counts
7478 # but duration and idle_age is inherited from the old flow
7479 warp_and_dump_NXM 3 1 118 2 1
7481 # OpenFlow 1.1, implicit reset_counts
7483 warp_and_dump_OF 11 4 2 236
7484 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow11 add-flow br0 $flow])
7485 # add-flow resets duration and counts,
7486 # but idle age is inherited from the old flow
7487 warp_and_dump_NXM 1 0 0 2
7488 warp_and_dump_OF 11 2 0 0
7491 warp_and_dump_OF 11 3 1 118
7492 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow11 mod-flows br0 $flow])
7493 # mod-flows resets hard_age, but not counts
7494 # but duration and idle_age is inherited from the old flow
7495 warp_and_dump_NXM 4 1 118 2 1
7496 warp_and_dump_OF 11 5 1 118
7498 # OpenFlow 1.2, explicit reset_counts
7500 warp_and_dump_OF 12 6 2 236
7501 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 add-flow br0 $flow])
7502 # add-flow without flags resets duration, but not counts,
7503 # idle age is inherited from the old flow
7504 warp_and_dump_NXM 1 2 236 2
7505 warp_and_dump_OF 12 2 2 236
7508 warp_and_dump_OF 12 3 3 354
7509 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 mod-flows br0 $flow])
7510 # mod-flows without flags does not reset duration nor counts,
7511 # idle age is inherited from the old flow
7512 warp_and_dump_NXM 4 3 354 2 1
7513 warp_and_dump_OF 12 5 3 354
7516 warp_and_dump_OF 12 6 4 472
7517 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 add-flow br0 reset_counts,$flow])
7518 # add-flow with reset_counts resets both duration and counts,
7519 # idle age is inherited from the old flow
7520 warp_and_dump_NXM 1 0 0 2
7521 warp_and_dump_OF 12 2 0 0
7524 warp_and_dump_OF 12 3 1 118
7525 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 mod-flows br0 reset_counts,$flow])
7526 # mod-flows with reset_counts resets counts, but not duration,
7527 # idle age is inherited from the old flow
7528 warp_and_dump_NXM 4 0 0 2 1
7529 warp_and_dump_OF 12 5 0 0
7531 # OpenFlow > 1.3, explicit reset_counts
7532 flow_mods_reset_counts () {
7533 # Reset to a known state
7534 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7537 warp_and_dump_OF $1 1 1 118 reset_counts
7538 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7539 # add-flow without flags resets duration, but not counts,
7540 # idle age is inherited from the old flow
7541 warp_and_dump_NXM 1 1 118 2
7542 warp_and_dump_OF $1 2 1 118
7545 warp_and_dump_OF $1 3 2 236
7546 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7547 # mod-flows without flags does not reset duration nor counts,
7548 # idle age is inherited from the old flow
7549 warp_and_dump_NXM 4 2 236 2 1
7550 warp_and_dump_OF $1 5 2 236
7553 warp_and_dump_OF $1 6 3 354
7554 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 reset_counts,$flow])
7555 # add-flow with reset_counts resets both duration and counts,
7556 # idle age is inherited from the old flow
7557 warp_and_dump_NXM 1 0 0 2
7558 warp_and_dump_OF $1 2 0 0 reset_counts
7561 warp_and_dump_OF $1 3 1 118 reset_counts
7562 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7563 # mod-flows with reset_counts resets counts, but not duration,
7564 # idle age is inherited from the old flow
7565 warp_and_dump_NXM 4 0 0 2 1
7566 warp_and_dump_OF $1 5 0 0 reset_counts
7568 # Modify flow having reset_counts flag without reset_counts
7570 warp_and_dump_OF $1 6 1 118 reset_counts
7571 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7572 warp_and_dump_NXM 7 1 118 2 1
7573 warp_and_dump_OF $1 8 1 118 reset_counts
7575 # Add flow having reset_counts flag without reset_counts
7577 warp_and_dump_OF $1 9 2 236 reset_counts
7578 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7579 warp_and_dump_NXM 1 2 236 2
7580 warp_and_dump_OF $1 2 2 236
7582 # Modify flow w/o reset_counts flag with a flow_mod having reset_counts
7584 warp_and_dump_OF $1 3 3 354
7585 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7586 warp_and_dump_NXM 4 0 0 2 1
7587 warp_and_dump_OF $1 5 0 0
7590 # OpenFlow versions >= 1.3 should behave the same way
7591 flow_mods_reset_counts 13
7592 flow_mods_reset_counts 14
7597 AT_SETUP([ofproto-dpif - flow stats reset_counts OpenFlow1.5])
7599 flow="ip,actions=NORMAL"
7601 ovs-appctl time/stop
7603 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7605 warp_and_dump_OF () {
7606 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7607 AT_CHECK([ovs-appctl revalidator/purge], [0])
7609 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 dump-flows br0 ], [0], [stdout])
7610 if [[ "$6X" = "X" ]]; then
7611 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, idle_age=$5, ip actions=NORMAL"
7613 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, $6 idle_age=$5, ip actions=NORMAL"
7615 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
7621 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
7624 # OpenFlow 1.5, explicit reset_counts
7625 flow_mods_reset_counts () {
7626 # Reset to a known state
7627 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7630 warp_and_dump_OF $1 1 1 118 1 reset_counts
7631 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7632 # add-flow without flags resets duration, but not counts,
7633 # idle age is inherited from the old flow
7634 warp_and_dump_OF $1 1 1 118 2
7637 warp_and_dump_OF $1 2 2 236 1
7638 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7639 # mod-flows without flags does not reset duration nor counts,
7640 # idle age is inherited from the old flow
7641 warp_and_dump_OF $1 3 2 236 2
7644 warp_and_dump_OF $1 4 3 354 1
7645 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 reset_counts,$flow])
7646 # add-flow with reset_counts resets both duration and counts,
7647 # idle age is inherited from the old flow
7648 warp_and_dump_OF $1 1 0 0 2 reset_counts
7651 warp_and_dump_OF $1 2 1 118 1 reset_counts
7652 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7653 # mod-flows with reset_counts resets counts, but not duration,
7654 # idle age is inherited from the old flow
7655 warp_and_dump_OF $1 3 0 0 2 reset_counts
7657 # Modify flow having reset_counts flag without reset_counts
7659 warp_and_dump_OF $1 4 1 118 1 reset_counts
7660 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7661 warp_and_dump_OF $1 5 1 118 2 reset_counts
7663 # Add flow having reset_counts flag without reset_counts
7665 warp_and_dump_OF $1 6 2 236 1 reset_counts
7666 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7667 warp_and_dump_OF $1 1 2 236 2
7669 # Modify flow w/o reset_counts flag with a flow_mod having reset_counts
7671 warp_and_dump_OF $1 2 3 354 1
7672 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7673 warp_and_dump_OF $1 3 0 0 2
7676 # OpenFlow versions >= 1.3 should behave the same way
7677 flow_mods_reset_counts 15
7683 AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
7685 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
7686 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
7688 ovs-appctl time/stop
7690 for i in `seq 1 10`; do
7691 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
7694 ovs-appctl time/warp 100
7695 AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
7696 ovs-appctl time/warp 1000
7698 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
7699 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
7700 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
7701 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=1180, idle_age=1, ip actions=NORMAL
7706 AT_SETUP([ofproto-dpif - idle_age and hard_age increase over time])
7709 # get_ages DURATION HARD IDLE
7711 # Fetch the flow duration, hard age, and idle age into the variables
7712 # whose names are given as arguments. Rounds DURATION down to the
7713 # nearest integer. If hard_age doesn't appear in the output, sets
7714 # HARD to "none". If idle_age doesn't appear in the output, sets IDLE
7717 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
7719 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
7720 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
7721 AS_VAR_COPY([$1], [duration])
7723 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
7724 if test X"$hard" = X; then
7727 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
7729 AS_VAR_COPY([$2], [hard])
7731 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
7732 if test X"$idle" = X; then
7735 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
7737 AS_VAR_COPY([$3], [idle])
7740 # Add a flow and get its initial hard and idle age.
7741 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
7742 get_ages duration1 hard1 idle1
7744 ovs-appctl time/stop
7745 # Warp time forward by 10 seconds, then modify the flow's actions.
7746 ovs-appctl time/warp 10000
7747 get_ages duration2 hard2 idle2
7748 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
7750 # Warp time forward by 10 seconds.
7751 ovs-appctl time/warp 10000
7752 get_ages duration3 hard3 idle3
7754 # Warp time forward 10 more seconds, then pass some packets through the flow,
7755 # then warp forward a few more times because idle times are only updated
7757 ovs-appctl time/warp 10000
7758 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)'
7759 ovs-appctl time/warp 3000 1000
7761 get_ages duration4 hard4 idle4
7763 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
7764 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
7765 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
7767 # Duration should increase steadily over time.
7768 AT_CHECK([test $duration1 -lt $duration2])
7769 AT_CHECK([test $duration2 -lt $duration3])
7770 AT_CHECK([test $duration3 -lt $duration4])
7772 # Hard age should be "none" initially because it's the same as flow_duration,
7773 # then it should increase.
7774 AT_CHECK([test $hard1 = none])
7775 AT_CHECK([test $hard2 = none])
7776 AT_CHECK([test $hard3 != none])
7777 AT_CHECK([test $hard4 != none])
7778 AT_CHECK([test $hard3 -lt $hard4])
7780 # Idle age should increase from 1 to 2 to 3, then decrease.
7781 AT_CHECK([test $idle1 -lt $idle2])
7782 AT_CHECK([test $idle2 -lt $idle3])
7783 AT_CHECK([test $idle3 -gt $idle4])
7785 # Check some invariant relationships.
7786 AT_CHECK([test $duration1 = $idle1])
7787 AT_CHECK([test $duration2 = $idle2])
7788 AT_CHECK([test $duration3 = $idle3])
7789 AT_CHECK([test $idle3 -gt $hard3])
7790 AT_CHECK([test $idle4 -lt $hard4])
7791 AT_CHECK([test $hard4 -lt $duration4])
7796 AT_SETUP([ofproto-dpif - fin_timeout])
7798 ovs-appctl time/stop
7799 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
7800 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
7802 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
7805 # Check that a TCP SYN packet does not change the timeout. (Because
7806 # flow stats updates are mainly what implements the fin_timeout
7807 # feature, we warp forward a couple of times to ensure that flow stats
7808 # run before re-checking the flow table.)
7809 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
7810 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
7813 AT_CHECK([ovs-appctl revalidator/purge], [0])
7814 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
7816 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
7818 # Check that a TCP FIN packet does change the timeout.
7819 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
7820 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
7823 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
7825 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
7830 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
7831 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
7832 add_of_ports br0 1 2
7835 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
7842 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
7843 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy], [], [],
7844 [--dummy-numa="0,0,0,0,1,1,1,1"])
7845 add_pmd_of_ports br0 1 2
7848 AT_CHECK([ovs-appctl dpif/show | sed 's/\(dummy-pmd: \).*)/\1<cleared>)/'], [0], [dnl
7849 dummy@ovs-dummy: hit:0 missed:0
7851 br0 65534/100: (dummy-internal)
7852 p1 1/1: (dummy-pmd: <cleared>)
7853 p2 2/2: (dummy-pmd: <cleared>)
7855 br1 65534/101: (dummy-internal)
7861 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
7862 # bump max-idle to avoid the flows being reclaimed behind us
7863 OVS_VSWITCHD_START([add-br br1 -- \
7864 set bridge br1 datapath-type=dummy fail-mode=secure -- \
7865 set Open_vSwitch . other_config:max-idle=10000], [], [],
7866 [--dummy-numa="0,0,0,0,1,1,1,1"])
7868 add_pmd_of_ports br0 2
7871 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7872 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'])
7873 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7874 ovs-appctl revalidator/wait
7875 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
7876 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7877 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7880 AT_CHECK([ovs-appctl dpif/dump-flows br1 | strip_ufid | strip_used | sort], [0], [dnl
7881 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7884 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | strip_ufid | strip_used | sort], [0], [dnl
7885 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(p1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
7886 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(p2),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
7889 AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | strip_ufid | strip_used | sort], [0], [dnl
7890 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(p3),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
7896 m4_define([OFPROTO_DPIF_GET_FLOW],
7897 [AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow$1])
7899 OVS_VSWITCHD_START([add-br br1 -- \
7900 set bridge br1 datapath-type=dummy fail-mode=secure -- \
7901 set Open_vSwitch . other_config:max-idle=10000], [], [],
7902 [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
7904 func=`printf '%s_' "$1" | cut -c 4-`
7905 add_${func}of_ports br0 1 2
7907 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7908 ovs-appctl revalidator/wait
7909 AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
7911 UFID=`sed -n 's/\(ufid:[[-0-9a-fA-F]]*\).*/\1/p' stdout`
7912 AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
7913 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7919 OFPROTO_DPIF_GET_FLOW([])
7920 OFPROTO_DPIF_GET_FLOW([ - pmd])
7922 AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
7923 OVS_VSWITCHD_START([dnl
7924 add-port br0 p1 -- set Interface p1 type=dummy
7926 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7927 on_exit 'kill `cat ovs-ofctl.pid`'
7929 AT_CAPTURE_FILE([ofctl_monitor.log])
7930 AT_DATA([flows.txt], [dnl
7931 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
7932 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
7934 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7936 dnl Packet is sent to userspace because a MPLS push or pop action is applied to
7937 dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
7939 dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
7940 dnl 60:66:66:66:66:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 74: MPLS (label 20, exp 0, ttl 32)
7941 dnl (label 20, exp 0, [S], ttl 32)
7942 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
7943 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
7945 for dl_src in 00 01; do
7946 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45"])
7948 sleep 1 # wait for the datapath flow installed
7949 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7950 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=60:66:66:66:66:00),eth_type(0x8847),mpls(label=20,tc=0,ttl=32,bos=0,label=20,tc=0,ttl=32,bos=1), actions:push_mpls(label=20,tc=0,ttl=32,bos=0,eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7951 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=60:66:66:66:66:01),eth_type(0x8847),mpls(label=20/0x0,tc=0/0,ttl=32/0x0,bos=0/1,label=20/0xfffff,tc=0/7,ttl=32/0xff,bos=1/1), actions:pop_mpls(eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7958 AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
7959 OVS_VSWITCHD_START([dnl
7960 add-port br0 p1 -- set Interface p1 type=dummy
7962 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7963 on_exit 'kill `cat ovs-ofctl.pid`'
7965 AT_CAPTURE_FILE([ofctl_monitor.log])
7966 AT_DATA([flows.txt], [dnl
7967 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
7968 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
7970 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7972 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
7973 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
7974 dnl can't determine the resulting MPLS label after MPLS push/pop actions.
7976 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
7977 dnl 60:66:66:66:66:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 74: MPLS (label 20, exp 0, ttl 32)
7978 dnl (label 20, exp 0, ttl 32)
7979 dnl (label 20, exp 0, ttl 32)
7980 dnl (label 20, exp 0, [S], ttl 32)
7981 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
7982 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
7984 for dl_src in 00 01; do
7985 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45"])
7987 sleep 1 # wait for the datapath flow installed
7988 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7989 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=60:66:66:66:66:00),eth_type(0x8847),mpls(label=20,tc=0,ttl=32,bos=0,label=20,tc=0,ttl=32,bos=1), actions:push_mpls(label=20,tc=0,ttl=32,bos=0,eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7990 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=60:66:66:66:66:01),eth_type(0x8847),mpls(label=20/0x0,tc=0/0,ttl=32/0x0,bos=0/1,label=20/0xfffff,tc=0/7,ttl=32/0xff,bos=1/1), actions:pop_mpls(eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7996 AT_SETUP([ofproto-dpif - patch ports])
7997 OVS_VSWITCHD_START([add-br br1 \
7998 -- set bridge br1 datapath-type=dummy fail-mode=secure \
7999 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
8000 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
8005 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
8007 AT_CHECK([ovs-appctl time/stop])
8008 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8010 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
8011 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
8013 for i in $(seq 1 10); do
8014 ovs-appctl netdev-dummy/receive br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
8015 if [[ $i -eq 1 ]]; then
8020 for i in $(seq 1 5); do
8021 ovs-appctl netdev-dummy/receive br1 'in_port(101),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
8022 if [[ $i -eq 1 ]]; then
8027 AT_CHECK([ovs-appctl time/warp 500], [0],
8030 sleep 1 # wait for log writer
8032 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
8033 dummy@ovs-dummy: hit:13 missed:2
8035 br0 65534/100: (dummy-internal)
8037 pbr0 1/none: (patch: peer=pbr1)
8039 br1 65534/101: (dummy-internal)
8041 pbr1 1/none: (patch: peer=pbr0)
8044 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8045 recirc_id(0),in_port(100),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:101,3,2
8046 recirc_id(0),in_port(101),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:100,2,3
8049 AT_CHECK([grep -e 'in_port(100).*packets:9' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
8050 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(100),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:9, bytes:954, used:0.0s, actions:101,3,2
8052 AT_CHECK([grep -e 'in_port(101).*packets:4' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
8053 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(101),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:4, bytes:424, used:0.0s, actions:100,2,3
8056 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
8057 OFPST_PORT reply (xid=0x4): 1 ports
8058 port 1: rx pkts=5, bytes=530, drop=?, errs=?, frame=?, over=?, crc=?
8059 tx pkts=10, bytes=1060, drop=?, errs=?, coll=?
8062 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
8063 OFPST_PORT reply (xid=0x4): 1 ports
8064 port 1: rx pkts=10, bytes=1060, drop=?, errs=?, frame=?, over=?, crc=?
8065 tx pkts=5, bytes=530, drop=?, errs=?, coll=?
8071 AT_SETUP([ofproto-dpif - patch ports - stack])
8072 OVS_VSWITCHD_START([add-br br1 \
8073 -- set bridge br1 datapath-type=dummy fail-mode=secure \
8074 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
8075 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
8080 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
8082 AT_CHECK([ovs-appctl time/stop])
8083 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8085 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=push:OXM_OF_IN_PORT[[0..31]],output:1,pop:OXM_OF_IPV4_SRC[[0..31]],output:2"])
8086 # Try to pop from empty stack, and push and leave data to stack.
8087 AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"])
8089 ovs-appctl netdev-dummy/receive br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
8091 AT_CHECK([ovs-appctl time/warp 500], [0],
8095 OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1])
8097 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
8098 dummy@ovs-dummy: hit:0 missed:1
8100 br0 65534/100: (dummy-internal)
8102 pbr0 1/none: (patch: peer=pbr1)
8104 br1 65534/101: (dummy-internal)
8106 pbr1 1/none: (patch: peer=pbr0)
8109 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8110 recirc_id(0),in_port(100),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), actions:101,set(ipv4(src=255.255.255.254)),2
8113 AT_CHECK([grep -e '|ofproto_dpif_xlate|WARN|' ovs-vswitchd.log | sed "s/^.*|WARN|//"], [0], [dnl
8114 stack underflow on bridge br1 while processing icmp,in_port=LOCAL,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0
8117 OVS_VSWITCHD_STOP(["/stack underflow/d"])
8120 AT_SETUP([ofproto-dpif - port duration])
8121 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
8122 add_of_ports br0 1 2
8124 ovs-appctl time/stop
8125 ovs-appctl time/warp 10000
8127 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
8128 AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
8137 dnl ----------------------------------------------------------------------
8138 AT_BANNER([ofproto-dpif -- megaflows])
8140 AT_SETUP([ofproto-dpif megaflow - port classification])
8142 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8143 add_of_ports br0 1 2
8144 AT_DATA([flows.txt], [dnl
8145 table=0 in_port=1 actions=output(2)
8147 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8148 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8150 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8152 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8153 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions: <del>
8158 AT_SETUP([ofproto-dpif megaflow - L2 classification])
8160 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8161 add_of_ports br0 1 2
8162 AT_DATA([flows.txt], [dnl
8163 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
8165 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8166 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8167 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8169 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8170 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8171 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8176 AT_SETUP([ofproto-dpif megaflow - L3 classification])
8178 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8179 add_of_ports br0 1 2
8180 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
8181 AT_DATA([flows.txt], [dnl
8182 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
8184 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8185 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8186 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8188 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8189 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
8190 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,frag=no), actions: <del>
8195 AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
8197 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8198 add_of_ports br0 1 2
8199 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], [])
8200 AT_DATA([flows.txt], [dnl
8201 table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
8203 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8204 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'])
8205 AT_CHECK([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(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1,dst=2001:db8:3c4d:1:2:3:4:1,label=0,proto=99,tclass=0x70,hlimit=64,frag=no)'])
8207 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8208 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,frag=no), actions: <del>
8209 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:ffff:fffc::,frag=no), actions: <del>
8214 AT_SETUP([ofproto-dpif megaflow - L4 classification])
8216 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8217 add_of_ports br0 1 2
8218 AT_DATA([flows.txt], [dnl
8219 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
8221 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8222 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8224 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8226 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8227 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=1,frag=no),icmp(type=8), actions: <del>
8232 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL],
8233 [AT_SETUP([ofproto-dpif megaflow - normal$1])
8234 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
8235 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8236 func=`printf '%s_' "$1" | cut -c 4-`
8237 add_${func}of_ports br0 1 2
8238 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8239 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8240 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8242 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8243 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8244 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8249 OFPROTO_DPIF_MEGAFLOW_NORMAL([])
8250 OFPROTO_DPIF_MEGAFLOW_NORMAL([ - pmd])
8252 AT_SETUP([ofproto-dpif megaflow - mpls])
8254 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8255 add_of_ports br0 1 2
8256 AT_DATA([flows.txt], [dnl
8257 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
8258 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
8260 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8261 AT_CHECK([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(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
8262 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
8264 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout_keep_actions], [0], [dnl
8265 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions:push_mpls(label=11,tc=3,ttl=64,bos=0,eth_type=0x8847),2
8266 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x8847),mpls(label=11/0x0,tc=3/0,ttl=64/0x0,bos=1/1), actions:pop_mpls(eth_type=0x800),2
8271 # CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR)
8272 m4_define([CHECK_MEGAFLOW_NETFLOW],
8274 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8275 add_of_ports br0 1 2
8277 dnl NetFlow configuration disables wildcarding relevant fields
8278 on_exit 'kill `cat test-netflow.pid`'
8279 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
8280 AT_CAPTURE_FILE([netflow.log])
8281 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
8283 set Bridge br0 netflow=@nf -- \
8284 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
8285 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
8287 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8288 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8289 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8291 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8292 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0/0xfc,frag=no),icmp(type=8,code=0), actions: <del>
8293 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0/0xfc,frag=no),icmp(type=8,code=0), actions: <del>
8295 OVS_APP_EXIT_AND_WAIT([test-netflow])
8298 AT_SETUP([ofproto-dpif megaflow - netflow - IPv4 collector])
8299 CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
8302 AT_SETUP([ofproto-dpif megaflow - netflow - IPv6 collector])
8303 AT_SKIP_IF([test $HAVE_IPV6 = no])
8304 CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
8307 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND],
8308 [AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding - $1])
8310 [add-port br0 p1 -- set Interface p1 type=$1 ofport_request=1 -- \
8311 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
8312 set interface p2 type=$1 ofport_request=2 -- \
8313 set interface p3 type=$1 ofport_request=3], [], [],
8314 [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
8315 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
8317 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8319 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8320 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8321 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8323 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8324 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8325 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8330 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy])
8331 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy-pmd])
8333 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
8335 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
8336 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
8337 set interface p2 type=dummy ofport_request=2 -- \
8338 set interface p3 type=dummy ofport_request=3])
8339 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
8341 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8343 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8344 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8345 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8347 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8348 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8349 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8354 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
8355 # Create bond0 on br0 with interfaces p0 and p1
8356 # and bond1 on br1 with interfaces p2 and p3
8357 # with p0 patched to p2 and p1 patched to p3.
8359 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
8360 other-config:lacp-time=fast \
8361 other-config:bond-rebalance-interval=0 -- \
8362 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
8363 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
8365 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
8366 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
8367 fail-mode=secure -- \
8368 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
8369 other-config:lacp-time=fast \
8370 other-config:bond-rebalance-interval=0 -- \
8371 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
8372 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
8374 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
8376 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8378 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8379 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
8380 ovs-appctl time/stop
8381 ovs-appctl time/warp 5000
8382 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8383 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8385 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8386 recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8387 recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8392 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
8394 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8395 add_of_ports br0 1 2
8396 AT_DATA([flows.txt], [dnl
8397 table=0 in_port=1,ip actions=resubmit(90)
8398 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
8400 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8401 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8402 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8404 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8405 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8406 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8411 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
8413 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8414 add_of_ports br0 1 2
8415 AT_DATA([flows.txt], [dnl
8416 table=0 in_port=1,ip actions=resubmit(,1)
8417 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
8419 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8420 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8421 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=
8422 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8424 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8425 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8426 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8431 AT_SETUP([ofproto-dpif megaflow - goto_table action])
8433 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8434 add_of_ports br0 1 2
8435 AT_DATA([flows.txt], [dnl
8436 table=0 in_port=1,ip actions=goto_table(1)
8437 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
8439 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
8440 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8441 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8443 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8444 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8445 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8450 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
8451 AT_KEYWORDS([mirror mirrors mirroring])
8453 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8454 add_of_ports br0 1 2 3
8456 set Bridge br0 mirrors=@m --\
8457 --id=@p3 get Port p3 --\
8458 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
8460 AT_DATA([flows.txt], [dnl
8461 in_port=1 actions=output:2
8463 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8464 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8466 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8468 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8469 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions: <del>
8474 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
8476 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8477 add_of_ports br0 1 2 3
8479 set Bridge br0 mirrors=@m --\
8480 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
8481 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
8483 AT_DATA([flows.txt], [dnl
8484 in_port=1 actions=output:2
8486 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8487 AT_CHECK([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(0x8100),vlan(vid=11,pcp=7),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))'])
8488 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8490 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8491 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions: <del>
8492 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=11,pcp=7/0x0),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
8497 AT_SETUP([ofproto-dpif megaflow - move action])
8499 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8500 add_of_ports br0 1 2
8501 AT_DATA([flows.txt], [dnl
8502 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
8503 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
8504 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
8506 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8507 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8508 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8510 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8511 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
8512 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
8517 AT_SETUP([ofproto-dpif megaflow - push action])
8519 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8520 add_of_ports br0 1 2
8521 AT_DATA([flows.txt], [dnl
8522 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
8524 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8525 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8526 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8528 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8529 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
8530 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
8535 AT_SETUP([ofproto-dpif megaflow - learning])
8537 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8538 add_of_ports br0 1 2
8539 AT_DATA([flows.txt], [dnl
8540 table=0 in_port=1 actions=load:2->NXM_NX_REG0[[0..15]],learn(table=1,priority=65535,NXM_OF_ETH_SRC[[]],NXM_OF_VLAN_TCI[[0..11]],output:NXM_NX_REG0[[0..15]]),output:2
8542 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8543 ovs-appctl time/stop
8544 # We send each packet twice because the first packet in each flow causes the
8545 # flow table to change and thus revalidations, which (depending on timing)
8546 # can keep a megaflow from being installed. The revalidations are done by
8547 # the second iteration, allowing the flows to be installed.
8549 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8550 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8551 ovs-appctl time/warp 100
8554 dnl The original flow is missing due to a revalidation.
8555 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8556 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8557 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8562 AT_SETUP([ofproto-dpif megaflow - tunnels])
8564 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
8565 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8566 AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
8567 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
8568 AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
8570 AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
8571 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
8572 ofport_request=4 options:key=flow])
8573 AT_DATA([flows.txt], [dnl
8574 in_port=1,actions=output(2)
8575 in_port=3,actions=output(4)
8577 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8578 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
8579 dnl will cause the packet to be dropped.
8580 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'])
8582 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'])
8583 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'])
8585 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'])
8587 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8588 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(tos=0xfd/0x3,frag=no), actions: <del>
8589 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(tos=0x1,ttl=64,frag=no), actions: <del>
8590 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(tos=0xfd,ttl=128,frag=no), actions: <del>
8595 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
8597 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8598 add_of_ports br0 1 2
8599 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
8600 AT_DATA([flows.txt], [dnl
8601 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
8603 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8604 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8605 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8607 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8608 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
8609 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,ttl=64,frag=no), actions: <del>
8614 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
8616 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8617 add_of_ports br0 1 2
8618 AT_DATA([flows.txt], [dnl
8619 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
8621 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8622 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8623 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8625 dnl The first packet is essentially a no-op, as the new destination MAC is the
8626 dnl same as the original. The second entry actually updates the destination
8628 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8629 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions:2
8630 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions:set(eth(dst=50:54:00:00:00:0a)),2
8635 m4_define([OFPROTO_DPIF_MEGAFLOW_DISABLED],
8636 [AT_SETUP([ofproto-dpif megaflow - disabled$1])
8637 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
8638 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8639 func=`printf '%s_' "$1" | cut -c 4-`
8640 add_${func}of_ports br0 1 2
8641 AT_DATA([flows.txt], [dnl
8642 table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
8643 table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
8645 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
8647 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
8649 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
8650 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8651 for i in 1 2 3 4; do
8652 AT_CHECK([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(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8653 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8654 if [[ $i -eq 1 ]]; then
8659 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8660 skb_priority(0),skb_mark(0),ct_state(-new-est-rel-rpl-inv-trk-snat-dnat),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:2
8661 skb_priority(0),skb_mark(0),ct_state(-new-est-rel-rpl-inv-trk-snat-dnat),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:drop
8663 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_dump | grep 'packets:3'], [0], [dnl
8664 skb_priority(0),skb_mark(0),ct_state(0/0xff),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:318, used:0.0s, actions:2
8665 skb_priority(0),skb_mark(0),ct_state(0/0xff),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:318, used:0.0s, actions:drop
8670 OFPROTO_DPIF_MEGAFLOW_DISABLED([])
8671 OFPROTO_DPIF_MEGAFLOW_DISABLED([ - pmd])
8673 AT_SETUP([ofproto-dpif - datapath port number change])
8674 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
8677 # Trace a flow that should output to p1.
8678 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
8680 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
8683 # Change p1's port number to 5.
8684 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
8686 # Trace a flow that should output to p1 in its new location.
8687 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
8689 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
8694 # Tests the bundling with various bfd and cfm configurations.
8695 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
8696 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
8697 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
8698 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
8699 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
8700 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
8701 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
8702 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
8703 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
8704 set Interface p0 cfm_mpid=1 -- \
8705 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
8707 ovs-appctl time/stop
8708 # advance the clock to stablize everything.
8709 ovs-appctl time/warp 5000 100
8710 # cfm/show should show 'recv' fault.
8711 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
8714 # bfd/show should show 'up'.
8715 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
8716 Local Session State: up
8717 Remote Session State: up
8718 Local Session State: up
8719 Remote Session State: up
8721 # bond/show should show 'may-enable: true' for all slaves.
8722 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
8729 # now disable the bfd on p1.
8730 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
8731 # advance the clock to stablize everything.
8732 ovs-appctl time/warp 5000 100
8733 # cfm/show should show 'recv' fault.
8734 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
8737 # bfd/show should show 'down'.
8738 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
8739 Local Session State: down
8740 Remote Session State: down
8742 # bond/show should show 'may-enable: false' for p0.
8743 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
8748 # now enable the bfd on p1 and disable bfd on p0.
8749 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
8750 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
8751 # advance the clock to stablize everything.
8752 ovs-appctl time/warp 5000 100
8753 # cfm/show should show 'recv' fault.
8754 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
8757 # bfd/show should show 'down'.
8758 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
8759 Local Session State: down
8760 Remote Session State: down
8762 # bond/show should show 'may-enable: false' for p0 and p1.
8763 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
8773 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
8774 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
8777 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
8779 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
8780 # disable bfd on p0.
8781 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
8783 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
8784 AT_CHECK([sed -e '/^.*ofproto_dpif_monitor.*$/d' < ovs-vswitchd.log > tmp && ovs-appctl vlog/close && mv tmp ovs-vswitchd.log && ovs-appctl vlog/reopen])
8787 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
8789 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
8790 # disable cfm on p0.
8791 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
8793 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
8794 AT_CHECK([sed -e '/^.*ofproto_dpif_monitor.*$/d' < ovs-vswitchd.log > tmp && ovs-appctl vlog/close && mv tmp ovs-vswitchd.log && ovs-appctl vlog/reopen])
8796 # enable both bfd and cfm on p0.
8797 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
8799 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
8800 # disable bfd on p0.
8801 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
8802 # check log, there should not be the log of thread terminated.
8803 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
8805 # reenable bfd on p0.
8806 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
8807 # check log, should still be on log of thread created.
8808 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
8809 monitor thread created
8811 # disable bfd and cfm together.
8812 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
8814 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
8819 # this test helps avoid the deadlock between the main thread and monitor thread.
8820 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
8823 for i in `seq 1 199`
8825 AT_CHECK([ovs-vsctl add-port br0 p$i -- set interface p$i type=gre options:remote_ip=1.2.3.4 options:key=$i bfd:enable=true])
8831 AT_BANNER([ofproto-dpif - flow translation resource limits])
8833 dnl Resubmits to later tables do not count against the depth limit, so we
8834 dnl can do 99 of them even though the maximum depth is 64.
8835 AT_SETUP([ofproto-dpif - forward resubmit])
8837 (for i in `seq 0 99`; do
8839 echo "table=$i, actions=resubmit(,$j)"
8841 echo "table=100, actions=local") > flows
8842 AT_CHECK([ovs-ofctl add-flows br0 flows])
8843 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
8845 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 100
8850 dnl Resubmits to the same or an earlier table count against the depth limit,
8851 dnl so only 64 of them are allowed.
8852 AT_SETUP([ofproto-dpif - backward resubmit])
8854 (echo "table=0, actions=resubmit(,66)"
8855 for i in `seq 2 66`; do
8857 echo "table=$i, actions=resubmit(,$j)"
8859 echo "table=1, actions=local") > flows
8860 AT_CHECK([ovs-ofctl add-flows br0 flows])
8861 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
8863 AT_CHECK([tail -1 stdout], [0],
8864 [Translation failed (Recursion too deep), packet is dropped.
8866 AT_CHECK([grep -c 'over max translation depth 64' stdout],
8869 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
8872 AT_SETUP([ofproto-dpif - infinite resubmit])
8874 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
8875 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
8877 AT_CHECK([tail -1 stdout], [0],
8878 [Translation failed (Recursion too deep), packet is dropped.
8880 AT_CHECK([grep -c 'over max translation depth 64' stdout],
8883 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
8886 dnl Without using ofproto/trace, make sure the
8887 dnl ofproto trace is still logged
8888 AT_SETUP([ofproto-dpif - backward resubmit without trace])
8890 (echo "table=0, actions=resubmit(,66)"
8891 for i in `seq 2 66`; do
8893 echo "table=$i, actions=resubmit(,$j)"
8895 echo "table=1, actions=local") > flows
8896 AT_CHECK([ovs-ofctl add-flows br0 flows])
8898 AT_CHECK([ovs-appctl netdev-dummy/receive br0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'], [0], [stdout])
8900 OVS_WAIT_UNTIL([grep 'packet is dropped' ovs-vswitchd.log])
8902 dnl make sure the full ofproto trace dump is present
8903 AT_CHECK([grep -c "^ *resubmit" ovs-vswitchd.log],
8907 OVS_VSWITCHD_STOP(["/over max translation depth/d
8908 /ofproto_dpif_upcall/d"])
8911 AT_SETUP([ofproto-dpif - exponential resubmit chain])
8914 (for i in `seq 1 64`; do
8916 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
8918 echo "in_port=65, actions=local") > flows
8919 AT_CHECK([ovs-ofctl add-flows br0 flows])
8920 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
8921 AT_CHECK([tail -1 stdout], [0],
8922 [Translation failed (Too many resubmits), packet is dropped.
8924 AT_CHECK([grep -c 'over 4096 resubmit actions' stdout], [0], [1
8926 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
8929 AT_SETUP([ofproto-dpif - too many output actions])
8932 (for i in `seq 1 12`; do
8934 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
8936 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
8937 AT_CHECK([ovs-ofctl add-flows br0 flows])
8938 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
8939 AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
8942 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' stdout], [0], [1
8944 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
8947 AT_SETUP([ofproto-dpif - stack too deep])
8950 (for i in `seq 1 12`; do
8952 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
8954 push="push:NXM_NX_REG0[[]]"
8955 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
8956 AT_CHECK([ovs-ofctl add-flows br0 flows])
8957 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
8958 AT_CHECK([tail -1 stdout], [0],
8959 [Translation failed (Stack too deep), packet is dropped.
8961 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' stdout], [0], [1
8963 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
8967 AT_SETUP([ofproto-dpif packet-out controller])
8969 add_of_ports br0 1 2
8971 AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
8973 AT_CAPTURE_FILE([ofctl_monitor.log])
8974 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8977 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
8980 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
8981 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8982 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
8983 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8985 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
8986 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8988 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
8989 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8992 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
8993 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
8997 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0],
8998 [OFPST_TABLE reply (OF1.3) (xid=0x2):
9000 active=1, lookup=0, matched=0
9003 active=0, lookup=0, matched=0
9005 tables 2...253: ditto
9011 AT_SETUP([ofproto-dpif packet-out controller (patch port)])
9014 add-port br0 p1 -- \
9015 set interface p1 type=patch options:peer=p2 -- \
9017 set bridge br1 datapath-type=dummy -- \
9018 set bridge br1 fail-mode=secure -- \
9019 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
9020 add-port br1 p2 -- \
9021 set interface p2 type=patch options:peer=p1 --])
9023 AT_CAPTURE_FILE([ofctl_monitor.log])
9024 AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9027 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
9030 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9031 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9032 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
9033 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9035 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
9036 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9038 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
9039 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9042 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0], [dnl
9043 OFPST_TABLE reply (OF1.3) (xid=0x2):
9045 active=0, lookup=0, matched=0
9047 tables 1...253: ditto
9050 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1], [0], [dnl
9051 OFPST_TABLE reply (OF1.3) (xid=0x2):
9053 active=0, lookup=3, matched=0
9056 active=0, lookup=0, matched=0
9058 tables 2...253: ditto
9064 AT_SETUP([ofproto-dpif packet-out pipeline match field (OpenFlow 1.5)])
9067 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=8}->tun_metadata2"])
9068 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=1,len=4}->tun_metadata3"])
9069 AT_DATA([flows.txt], [dnl
9070 table=0,in_port=1 actions=controller
9071 table=0,tun_id=3 actions=controller
9072 table=0,metadata=5 actions=controller
9073 table=0,reg0=1,reg4=2,reg8=3,reg12=5 actions=controller
9074 table=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_gbp_id=0x01,tun_gbp_flags=0x03 actions=controller
9075 table=0,tun_metadata3=0x11 actions=controller
9077 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
9079 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
9080 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
9081 ovs-appctl -t ovs-ofctl ofctl/barrier
9082 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
9083 AT_CAPTURE_FILE([monitor.log])
9085 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=1 packet=0001020304050010203040501111 actions=table"])
9086 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,tunnel_id=3 packet=0001020304050010203040502222 actions=table"])
9087 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,metadata=5 packet=0001020304050010203040503333 actions=table"])
9088 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,reg0=1,reg4=2,reg8=3,reg12=5 packet=0001020304050010203040503333 actions=table"])
9089 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_gbp_id=0x01,tun_gbp_flags=0x03 packet=0001020304050010203040503333 actions=table"])
9090 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,tun_metadata2=0x22,tun_metadata3=0x11 packet=0001020304050010203040503333 actions=table"])
9092 ovs-appctl -t ovs-ofctl ofctl/barrier
9093 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9095 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
9096 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 in_port=1 (via packet_out) data_len=14 (unbuffered)
9097 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1111
9098 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 tun_id=0x3,in_port=2 (via packet_out) data_len=14 (unbuffered)
9099 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x2222
9100 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 metadata=0x5,in_port=2 (via packet_out) data_len=14 (unbuffered)
9101 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9102 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 reg0=0x1,reg4=0x2,reg8=0x3,reg12=0x5,in_port=2 (via packet_out) data_len=14 (unbuffered)
9103 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9104 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_gbp_id=1,tun_gbp_flags=0x3,in_port=2 (via packet_out) data_len=14 (unbuffered)
9105 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9106 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 tun_metadata2=0x22,tun_metadata3=0x11,in_port=2 (via packet_out) data_len=14 (unbuffered)
9107 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9108 OFPT_BARRIER_REPLY (OF1.5):
9114 AT_SETUP([ofproto-dpif packet-out goto_table])
9116 add_of_ports br0 1 2
9118 AT_DATA([flows.txt], [dnl
9119 table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
9120 table=1 dl_dst=50:54:00:00:00:0a actions=controller
9122 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
9124 AT_CAPTURE_FILE([ofctl_monitor.log])
9125 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9128 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)'
9131 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
9132 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9133 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9134 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9135 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9137 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9138 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9140 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9141 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9144 AT_CHECK([ovs-appctl revalidator/purge], [0])
9145 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
9146 n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=goto_table:1
9147 table=1, n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
9148 OFPST_FLOW reply (OF1.3):
9151 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0], [dnl
9152 OFPST_TABLE reply (OF1.3) (xid=0x2):
9154 active=1, lookup=3, matched=3
9159 active=0, lookup=0, matched=0
9161 tables 3...253: ditto
9168 AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
9170 add_of_ports br0 1 2
9172 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
9173 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
9175 AT_CAPTURE_FILE([ofctl_monitor.log])
9176 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9179 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)'
9182 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
9183 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9184 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9185 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9186 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9188 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9189 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9191 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9192 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9195 AT_CHECK([ovs-appctl revalidator/purge], [0])
9196 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
9197 table=1, n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
9198 OFPST_FLOW reply (OF1.1):
9201 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0], [dnl
9202 OFPST_TABLE reply (OF1.3) (xid=0x2):
9204 active=0, lookup=3, matched=0
9207 active=1, lookup=3, matched=3
9210 active=0, lookup=0, matched=0
9212 tables 3...253: ditto
9218 AT_SETUP([ofproto-dpif - ICMPv6])
9222 AT_CAPTURE_FILE([ofctl_monitor.log])
9224 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9226 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
9228 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9230 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9231 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
9232 icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::260:97ff:fe07:69ea,nd_sll=00:00:86:05:80:da,nd_tll=00:00:00:00:00:00 icmp6_csum:68bd
9238 AT_SETUP([ofproto-dpif - ICMPv6 type match])
9240 add_of_ports br0 1 2 3
9242 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=128,actions=2'])
9243 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=129,actions=3'])
9245 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9247 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128)'])
9248 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128)'])
9249 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129)'])
9250 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129)'])
9252 AT_CHECK([ovs-appctl revalidator/purge], [0])
9254 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
9255 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128), actions:2
9256 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129), actions:3
9259 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
9260 n_packets=2, n_bytes=252, icmp6,icmp_type=128 actions=output:2
9261 n_packets=2, n_bytes=252, icmp6,icmp_type=129 actions=output:3
9268 AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update])
9271 AT_CHECK([ovs-ofctl add-flow br0 icmp6,icmpv6_type=135,action=set_field:fe80::1-\>nd_target,set_field:32:21:14:86:11:74-\>nd_sll,output:controller])
9273 AT_CAPTURE_FILE([ofctl_monitor.log])
9275 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9277 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
9279 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9281 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9282 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered)
9283 icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::1,nd_sll=32:21:14:86:11:74,nd_tll=00:00:00:00:00:00 icmp6_csum:19d3
9289 # Tests the exact match of CFI bit in installed datapath flows matching VLAN.
9290 AT_SETUP([ofproto-dpif - vlan matching])
9292 [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1])
9293 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9295 AT_CHECK([ovs-ofctl del-flows br0])
9296 AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"])
9298 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))'])
9300 OVS_WAIT_UNTIL([grep flow_add: ovs-vswitchd.log])
9301 AT_CHECK([grep 'in_port([[1]])' ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
9302 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=10),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
9307 # Tests in place modification of installed datapath flows.
9308 AT_SETUP([ofproto-dpif - in place modification])
9310 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
9311 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9313 AT_CHECK([ovs-ofctl del-flows br0])
9314 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=mod_vlan_vid:3,output:local])
9316 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
9318 ovs-appctl time/stop
9320 AT_CHECK([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)'])
9322 # Wait for the flow setup to be done.
9323 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
9326 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)'
9329 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9330 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:2, bytes:28, used:0.0s, actions:push_vlan(vid=3,pcp=0),100
9333 AT_CHECK([ovs-ofctl add-flow br0 priority=60000,in_port=1,actions=mod_vlan_vid:4,output:local])
9335 ovs-appctl time/warp 500
9336 ovs-appctl time/warp 500
9339 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)'
9342 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9343 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:5, bytes:70, used:0.0s, actions:push_vlan(vid=4,pcp=0),100
9346 AT_CHECK([grep 'modify' ovs-vswitchd.log | strip_ufid ], [0], [dnl
9347 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x1234), actions:push_vlan(vid=4,pcp=0),100
9352 # Tests in place modification of installed datapath flows with vlans.
9353 AT_SETUP([ofproto-dpif - in place modification (vlan)])
9355 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
9356 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9358 # Always drop misses
9359 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all drop])
9360 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=output:local])
9362 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
9364 ovs-appctl time/stop
9366 AT_CHECK([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)'])
9368 # Check that a correct datapath flow is created.
9369 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
9372 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)'
9375 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9376 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:2, bytes:28, used:0.0s, actions:100
9379 # Delete the flow. Then check that the datapath flow is modified to
9380 # drop the packets. A modified flow inherits the stats, a new
9381 # datapath flow would start from sero.
9382 AT_CHECK([ovs-ofctl del-flows br0])
9384 ovs-appctl time/warp 500
9385 ovs-appctl time/warp 500
9388 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)'
9391 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9392 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:5, bytes:70, used:0.0s, actions:drop
9395 # Add a flow that matches the non-presence of a vlan tag, and check
9396 # that the datapath flow is modified accordingly.
9397 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,vlan_tci=0x0000/0x1fff,actions=output:local])
9399 ovs-appctl time/warp 500
9400 ovs-appctl time/warp 500
9403 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)'
9406 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9407 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:8, bytes:112, used:0.0s, actions:100
9410 # Check that VLAN packets will not hit the same datapath megaflow.
9412 AT_CHECK([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(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x1234))'])
9413 OVS_WAIT_UNTIL([grep 'flow_add:.*vlan(vid=99' ovs-vswitchd.log])
9416 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(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x1234))'
9419 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9420 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:8, bytes:112, used:0.0s, actions:100
9421 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=99,pcp=7/0x0),encap(eth_type(0x1234)), packets:2, bytes:36, used:0.0s, actions:drop
9424 # Check that the new flow matches the CFI bit, while both vid and pcp
9426 AT_CHECK([grep '\(modify\)\|\(flow_add\)' ovs-vswitchd.log | strip_ufid ], [0], [dnl
9427 dpif_netdev|DBG|flow_add: recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), actions:100
9428 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x1234)
9429 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x1234), actions:100
9430 dpif_netdev|DBG|flow_add: recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=99,pcp=7/0x0),encap(eth_type(0x1234)), actions:drop
9435 AT_SETUP([ofproto-dpif - trace (unchanged)])
9437 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
9438 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
9440 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100)'], [0], [stdout])
9441 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
9447 AT_SETUP([ofproto-dpif - conntrack - controller])
9450 add_of_ports br0 1 2
9452 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9454 dnl Allow new UDP connections on p1 for dst port 2, drop everything else.
9455 AT_DATA([flows.txt], [dnl
9457 dnl Store zone in reg4 and packet direction in reg3 (IN=1, OUT=2).
9459 table=0,priority=100,arp,action=normal
9460 table=0,priority=10,in_port=1,ip,action=set_field:1->reg4,set_field:1->reg3,ct(zone=NXM_NX_REG4[[0..15]],table=1)
9461 table=0,priority=10,in_port=2,ip,action=set_field:1->reg4,set_field:2->reg3,ct(zone=NXM_NX_REG4[[0..15]],table=1)
9462 table=0,priority=1,action=drop
9464 dnl Pass tracked traffic through ACL, drop everything else.
9465 dnl Non-REPLY/RELATED packets get the ACL lookup with the packet headers
9466 dnl in the actual packet direction in reg0 (IN=1, OUT=2). REPLY packets
9467 dnl get the ACL lookup using the conntrack tuple and the inverted direction.
9468 dnl RELATED packets get ACL lookup using the conntrack tuple in the direction
9469 dnl of the master connection, as storted in ct_mark.
9471 dnl Incoming non-related packet in the original direction (ACL IN)
9472 table=1 reg3=1, ip, ct_state=-rel-rpl+trk-inv action=set_field:1->reg0,resubmit(,3),goto_table:5
9473 dnl Incoming non-related reply packet (CT ACL OUT)
9474 table=1 reg3=1, ip, ct_state=-rel+rpl+trk-inv action=set_field:2->reg0,resubmit(,3,ct),goto_table:4
9475 dnl Outgoing non-related packet (ACL OUT)
9476 table=1 reg3=2, ip, ct_state=-rel-rpl+trk-inv action=set_field:2->reg0,resubmit(,3),goto_table:5
9477 dnl Outgoing non-related reply packet (CT ACL IN)
9478 table=1 reg3=2, ip, ct_state=-rel+rpl+trk-inv action=set_field:1->reg0,resubmit(,3,ct),goto_table:4
9480 dnl Related packet (CT ACL in the direction of the master connection.)
9481 table=1 ip, ct_state=+rel+trk-inv, action=move:NXM_NX_CT_MARK[[]]->NXM_NX_REG0[[]],resubmit(,3,ct),goto_table:4
9482 dnl Drop everything else.
9483 table=1 priority=0, action=drop
9487 dnl Stateful accept (1->reg2) all incoming (reg0=1) IP connections with
9488 dnl UDP destination port '2'. Store rule ID (1234) in reg1, verdict
9490 table=3 priority=10, reg0=1, udp, udp_dst=2 action=set_field:1234->reg1,set_field:1->reg2
9491 dnl Stateless drop (0->reg2) everything else in both directions. (Rule ID: 1235)
9492 table=3 priority=0, action=set_field:1235->reg1,set_field:0->reg2
9494 dnl Re-process stateful traffic that was not accepted by a stateful rule as
9495 dnl normal traffic in the current direction. This should also delete the
9496 dnl now stale conntrack state, so that new state can be created in it's place.
9498 dnl Stateful accepts go to next table.
9499 table=4 priority=100 reg2=1, action=goto_table:5
9500 dnl Everything else is reprocessed disregarding the CT state, using the actual
9501 dnl packet direction.
9502 table=4 priority=0 action=move:NXM_NX_REG3[[]]->NXM_NX_REG0[[]],resubmit(,3),goto_table:5
9504 dnl "ACL verdict processing table."
9506 dnl Handle stateful (reg2=1) / stateless (reg2=2) accepts and drops (reg2=0)
9508 dnl Drop all non-accepted packets.
9509 table=5 reg2=0 priority=1000 action=drop
9510 dnl Commit new non-related IP connections.
9511 table=5 priority=10 reg2=1 ct_state=+new-rel, ip, action=ct(zone=NXM_NX_REG4[[0..15]],commit,exec(move:NXM_NX_REG3[[0..31]]->NXM_NX_CT_MARK[[0..31]],move:NXM_NX_REG1[[0..31]]->NXM_NX_CT_LABEL[[96..127]])),goto_table:6
9512 dnl Commit new related connections in either direction, which inherit the mark
9513 dnl (the direction of the original direction master tuple) from the master
9515 table=5 priority=10 reg2=1 ct_state=+new+rel, ip, action=ct(zone=NXM_NX_REG4[[0..15]],commit,exec(move:NXM_NX_REG1[[0..31]]->NXM_NX_CT_LABEL[[96..127]])),goto_table:6
9516 dnl Forward everything else, including stateless accepts.
9517 table=5 priority=0 action=goto_table:6
9519 dnl "Forwarding table"
9521 table=6 action=controller
9524 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9526 AT_CAPTURE_FILE([ofctl_monitor.log])
9527 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9529 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9531 dnl OK, now start a new connection from port 1.
9532 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9534 dnl Now try a reply from port 2.
9535 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9537 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9538 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9540 dnl Check this output. We only see the latter two packets, not the first.
9541 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9542 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x1,reg4=0x1,in_port=1 (via action) data_len=106 (unbuffered)
9543 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
9545 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_zone=1,ct_mark=0x1,ct_label=0x4d2000000000000000000000000,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x2,reg4=0x1,in_port=2 (via action) data_len=106 (unbuffered)
9546 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
9549 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9551 dnl OK, now start a second connection from port 1
9552 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=3,dst=2)'])
9554 dnl Now try a reply from port 2.
9555 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=3)'])
9558 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9559 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9561 dnl Check this output. We should see both packets
9562 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9563 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x1,reg4=0x1,in_port=1 (via action) data_len=106 (unbuffered)
9564 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=3,tp_dst=2 udp_csum:551
9566 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_zone=1,ct_mark=0x1,ct_label=0x4d2000000000000000000000000,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=3,ct_tp_dst=2,ip,reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x2,reg4=0x1,in_port=2 (via action) data_len=106 (unbuffered)
9567 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=3 udp_csum:551
9573 AT_SETUP([ofproto-dpif - conntrack - force commit])
9576 add_of_ports br0 1 2
9578 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9580 dnl Allow new connections on p1->p2, but not on p2->p1.
9581 AT_DATA([flows.txt], [dnl
9584 table=0,priority=100,arp,action=normal
9585 table=0,priority=10,in_port=1,udp,action=ct(commit),controller
9586 table=0,priority=10,in_port=2,udp,action=ct(table=1)
9587 table=0,priority=1,action=drop
9591 table=1,priority=10,in_port=2,ct_state=+est,udp,action=ct(force,commit),controller
9592 table=1,priority=1,action=drop
9595 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9597 AT_CAPTURE_FILE([ofctl_monitor.log])
9598 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9600 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9602 dnl OK, now start a new connection from port 1.
9603 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9605 dnl Now try a reply from port 2.
9606 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9608 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9609 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9611 dnl Check this output. We only see the latter two packets, not the first.
9612 dnl Note that the first packet doesn't have the ct_state bits set. This
9613 dnl happens because the ct_state field is available only after recirc.
9614 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9615 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9616 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
9618 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered)
9619 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
9622 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9624 dnl OK, now start a second connection from port 1
9625 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=3,dst=4)'])
9627 dnl Now try a reply from port 2.
9628 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=4,dst=3)'])
9630 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9631 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9633 dnl Check this output. We should see both packets
9634 dnl Note that the first packet doesn't have the ct_state bits set. This
9635 dnl happens because the ct_state field is available only after recirc.
9636 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9637 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9638 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=3,tp_dst=4 udp_csum:54f
9640 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered)
9641 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4,tp_dst=3 udp_csum:54f
9645 dnl Check that the directionality has been changed by force commit.
9647 AT_CHECK([ovs-appctl dpctl/dump-conntrack | sort], [], [dnl
9648 udp,orig=(src=10.1.1.2,dst=10.1.1.1,sport=2,dport=1),reply=(src=10.1.1.1,dst=10.1.1.2,sport=1,dport=2)
9649 udp,orig=(src=10.1.1.2,dst=10.1.1.1,sport=4,dport=3),reply=(src=10.1.1.1,dst=10.1.1.2,sport=3,dport=4)
9655 AT_SETUP([ofproto-dpif - conntrack - ipv6])
9658 add_of_ports br0 1 2
9660 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9662 dnl Allow new connections on p1->p2, but not on p2->p1.
9663 AT_DATA([flows.txt], [dnl
9666 table=0,priority=100,arp,action=normal
9667 table=0,priority=10,in_port=1,udp6,action=ct(commit,zone=0),controller
9668 table=0,priority=10,in_port=2,udp6,action=ct(table=1,zone=0)
9669 table=0,priority=1,action=drop
9672 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp6,action=controller
9673 table=1,priority=1,action=drop
9676 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9678 AT_CAPTURE_FILE([ofctl_monitor.log])
9679 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9681 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x86dd),ipv6(src=2001:db8::2,dst=2001:db8::1,label=0,proto=17,tclass=0x70,hlimit=128,frag=no),udp(src=2,dst=1)'])
9683 dnl OK, now start a new connection from port 1.
9684 AT_CHECK([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(0x86dd),ipv6(src=2001:db8::1,dst=2001:db8::2,label=0,proto=17,tclass=0x70,hlimit=128,frag=no),udp(src=1,dst=2)'])
9686 dnl Now try a reply from port 2.
9687 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x86dd),ipv6(src=2001:db8::2,dst=2001:db8::1,label=0,proto=17,tclass=0x70,hlimit=128,frag=no),udp(src=2,dst=1)'])
9689 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9690 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9692 dnl Check this output. We only see the latter two packets, not the first.
9693 dnl Note that the first packet doesn't have the ct_state bits set. This
9694 dnl happens because the ct_state field is available only after recirc.
9695 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9696 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
9697 udp6,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,ipv6_src=2001:db8::1,ipv6_dst=2001:db8::2,ipv6_label=0x00000,nw_tos=112,nw_ecn=0,nw_ttl=128,tp_src=1,tp_dst=2 udp_csum:bfe2
9698 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=126 ct_state=est|rpl|trk,ct_ipv6_src=2001:db8::1,ct_ipv6_dst=2001:db8::2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ipv6,in_port=2 (via action) data_len=126 (unbuffered)
9699 udp6,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,ipv6_src=2001:db8::2,ipv6_dst=2001:db8::1,ipv6_label=0x00000,nw_tos=112,nw_ecn=0,nw_ttl=128,tp_src=2,tp_dst=1 udp_csum:bfe2
9705 AT_SETUP([ofproto-dpif - conntrack - output action])
9708 add_of_ports br0 1 2
9710 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9712 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9713 AT_DATA([flows.txt], [dnl
9714 dnl The flows are in two separate tables for two reasons:
9715 dnl * To make the pipeline more clear.
9716 dnl * To make megaflows more consistent (we check megaflows below). The
9717 dnl unwildcarding in megaflows depends on the internal ordering of the
9718 dnl subtables, which are sorted using the system qsort(). qsort()
9719 dnl is provided by libc and may or may not be stable, so we can't rely
9720 dnl on that. By having separate tables we have more control over which
9721 dnl subtables are visited, meaning consistent megaflows.
9725 table=0,priority=100,arp,action=normal
9726 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),2
9727 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
9728 table=0,priority=1,action=drop
9732 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=1
9733 table=1,priority=1,action=drop
9736 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9739 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9741 dnl OK, now start a new connection from port 1.
9742 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9744 dnl Now try a reply from port 2.
9745 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9747 dnl OK, now start a second connection from port 1
9748 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9750 dnl Now try a reply from port 2.
9751 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9754 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
9755 ct_state(+new-est+trk),recirc_id(0x1),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:drop
9756 ct_state(-new+est+trk),recirc_id(0x1),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:1
9757 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct(commit),2
9758 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct,recirc(0x1)
9764 AT_SETUP([ofproto-dpif - conntrack - expiration])
9767 add_of_ports br0 1 2
9769 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9771 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9772 AT_DATA([flows.txt], [dnl
9775 table=0,priority=100,arp,action=normal
9776 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0)
9777 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
9778 table=0,priority=1,action=drop
9782 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller
9783 table=1,priority=1,action=drop
9786 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9788 AT_CAPTURE_FILE([ofctl_monitor.log])
9789 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9791 AT_CHECK([ovs-appctl time/stop])
9793 dnl Start a new connection from port 1.
9794 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9796 dnl Now try a reply from port 2.
9797 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9799 ovs-appctl time/warp 100000
9801 dnl Now try another reply from port 2.
9802 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9804 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 3])
9805 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9807 dnl Check this output. Only one reply must be there
9808 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9809 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
9810 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
9812 OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload
9818 AT_SETUP([ofproto-dpif - conntrack - untrackable traffic])
9821 add_of_ports br0 1 2
9823 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9825 AT_DATA([flows.txt], [dnl
9826 ipv6,ct_state=-trk,action=ct(table=0,zone=0)
9827 ct_state=+trk,action=controller
9830 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9832 AT_CAPTURE_FILE([ofctl_monitor.log])
9833 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9835 AT_CHECK([ovs-appctl time/stop])
9837 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'])
9839 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 1])
9840 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9842 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9843 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 ct_state=inv|trk,ipv6,in_port=2 (via action) data_len=86 (unbuffered)
9844 icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::260:97ff:fe07:69ea,nd_sll=00:00:86:05:80:da,nd_tll=00:00:00:00:00:00 icmp6_csum:68bd
9850 AT_SETUP([ofproto-dpif - conntrack - zones])
9853 add_of_ports br0 1 2 3 4
9855 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9857 dnl Allow new connections on p1->p2 or p3->p4.
9858 dnl Allow only established connections p2->p1 and p4->p3
9859 dnl p1,p2 and p3,p4 are on different zones
9860 AT_DATA([flows.txt], [dnl
9863 table=0,priority=100,arp,action=normal
9864 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),controller
9865 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
9866 table=0,priority=10,in_port=3,udp,action=ct(commit,zone=1),controller
9867 table=0,priority=10,in_port=4,udp,action=ct(table=1,zone=1)
9868 table=0,priority=1,action=drop
9872 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller
9873 table=1,priority=10,in_port=4,ct_state=+trk+est-new,udp,action=controller
9874 table=1,priority=1,action=drop
9877 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9879 AT_CAPTURE_FILE([ofctl_monitor.log])
9880 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9882 dnl Basic "only established" test on ports 1,2
9884 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9885 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9886 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9888 dnl Now use the same 5-tuples but on ports 3,4
9890 AT_CHECK([ovs-appctl netdev-dummy/receive p4 'in_port(4),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9891 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9892 AT_CHECK([ovs-appctl netdev-dummy/receive p4 'in_port(4),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9894 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 8])
9895 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9897 dnl Check this output. We only see the latter two packets (for each zone), not the first.
9898 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9899 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9900 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
9902 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
9903 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
9905 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=3 (via action) data_len=106 (unbuffered)
9906 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
9908 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_zone=1,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=4 (via action) data_len=106 (unbuffered)
9909 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
9915 AT_SETUP([ofproto-dpif - conntrack - recirc,commit])
9918 add_of_ports br0 1 2
9920 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9922 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9923 AT_DATA([flows.txt], [dnl
9926 table=0,priority=100,arp,action=normal
9927 table=0,priority=10,udp,action=ct(table=1,zone=0)
9928 table=0,priority=1,action=drop
9932 table=1,priority=10,in_port=1,ct_state=+trk+new,udp,action=ct(commit,zone=0),controller
9933 table=1,priority=10,ct_state=+trk+est,udp,action=controller
9934 table=1,priority=1,action=drop
9937 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9939 AT_CAPTURE_FILE([ofctl_monitor.log])
9940 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9942 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9944 dnl OK, now start a new connection from port 1.
9945 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
9947 dnl Now try a reply from port 2.
9948 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
9950 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9951 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9953 dnl Check this output. We only see the latter two packets, not the first.
9954 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9955 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9956 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
9958 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
9959 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
9965 AT_SETUP([ofproto-dpif - conntrack - ICMP related])
9968 add_of_ports br0 1 2
9970 dnl Allow any traffic from ns0->ns1. Only allow nd, return traffic from ns1->ns0.
9971 AT_DATA([flows.txt], [dnl
9974 table=0,priority=100,arp,action=normal
9975 table=0,priority=10,ip,in_port=1,udp,action=ct(commit,table=1)
9976 table=0,priority=10,ip,in_port=2,action=ct(table=1)
9977 table=0,priority=1,action=drop
9981 table=1,priority=10,in_port=1,ct_state=+trk,action=controller
9982 table=1,priority=10,in_port=2,ct_state=+trk-inv-new,action=controller
9983 table=1,priority=1,action=drop
9986 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9988 AT_CAPTURE_FILE([ofctl_monitor.log])
9989 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9991 dnl 1. Send an ICMP port unreach reply for port 8738, without any previous request
9992 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 ct\(table=1\) 'f64c473528c9c6f54ecb72db080045c0003d2e8700004001f351ac100004ac1000030303553f0000000045000021317040004011b138ac100003ac10000411112222000da5a06369616f0a'])
9994 dnl 2. Send and UDP packet to port 5555
9995 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 1 ct\(commit,table=1\) 'c6f94ecb72dbe64c473528c9080045000021317040004011b138ac100001ac100002a28e15b3000d20966369616f0a'])
9997 dnl 3. Send an ICMP port unreach reply for port 5555, related to the first packet
9998 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 ct\(table=1\) 'e64c473528c9c6f94ecb72db080045c0003d2e8700004001f355ac100002ac1000010303553f0000000045000021317040004011b138ac100001ac100002a28e15b3000d20966369616f0a'])
10000 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
10001 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10003 dnl Check this output. We only see the first and the last packet
10004 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10005 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=47 ct_state=new|trk,ct_nw_src=172.16.0.1,ct_nw_dst=172.16.0.2,ct_nw_proto=17,ct_tp_src=41614,ct_tp_dst=5555,ip,in_port=1 (via action) data_len=47 (unbuffered)
10006 udp,vlan_tci=0x0000,dl_src=e6:4c:47:35:28:c9,dl_dst=c6:f9:4e:cb:72:db,nw_src=172.16.0.1,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=41614,tp_dst=5555 udp_csum:2096
10008 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=75 ct_state=rel|rpl|trk,ct_nw_src=172.16.0.1,ct_nw_dst=172.16.0.2,ct_nw_proto=17,ct_tp_src=41614,ct_tp_dst=5555,ip,in_port=2 (via action) data_len=75 (unbuffered)
10009 icmp,vlan_tci=0x0000,dl_src=c6:f9:4e:cb:72:db,dl_dst=e6:4c:47:35:28:c9,nw_src=172.16.0.2,nw_dst=172.16.0.1,nw_tos=192,nw_ecn=0,nw_ttl=64,icmp_type=3,icmp_code=3 icmp_csum:553f
10015 AT_SETUP([ofproto-dpif - conntrack - ct_mark])
10018 add_of_ports br0 1 2
10020 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10022 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10023 AT_DATA([flows.txt], [dnl
10026 table=0,arp,action=normal
10027 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:1->ct_mark)),controller
10028 table=0,ip,in_port=1,udp,tp_src=3,action=ct(commit,exec(set_field:3->ct_mark)),controller
10029 table=0,ip,in_port=1,udp,tp_src=5,action=ct(commit,exec(set_field:5->ct_mark)),controller
10030 table=0,ip,in_port=2,actions=ct(table=1)
10031 table=0,priority=0,action=drop
10035 table=1,priority=100,ct_state=+trk+rpl,ct_mark=0/4,actions=controller
10036 table=1,priority=1,action=drop
10039 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10041 AT_CAPTURE_FILE([ofctl_monitor.log])
10042 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10044 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
10045 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=3,dst=4)'])
10046 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=5,dst=6)'])
10048 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
10049 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=4,dst=3)'])
10050 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=6,dst=5)'])
10052 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 10])
10053 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10055 dnl Check this output.
10056 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10057 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10058 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
10060 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10061 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=3,tp_dst=4 udp_csum:54f
10063 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10064 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=5,tp_dst=6 udp_csum:54b
10066 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_mark=0x1,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
10067 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
10069 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_mark=0x3,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=3,ct_tp_dst=4,ip,in_port=2 (via action) data_len=106 (unbuffered)
10070 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4,tp_dst=3 udp_csum:54f
10076 AT_SETUP([ofproto-dpif - conntrack - ct_label])
10079 add_of_ports br0 1 2
10081 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10083 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10084 AT_DATA([flows.txt], [dnl
10087 table=0,arp,action=normal
10088 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:000000000000000001->ct_label))
10089 table=0,ip,in_port=1,udp,tp_src=3,action=ct(commit,exec(set_field:000000000000000002->ct_label))
10090 table=0,ip,in_port=2,actions=ct(table=1)
10094 table=1,priority=10,ct_state=+trk+rpl,actions=controller
10095 table=1,priority=1,action=drop
10098 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10100 AT_CAPTURE_FILE([ofctl_monitor.log])
10101 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10103 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
10104 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=3,dst=4)'])
10106 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
10107 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=4,dst=3)'])
10109 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
10110 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10112 dnl Check this output.
10113 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10114 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_label=0x1,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
10115 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
10117 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_label=0x2,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=3,ct_tp_dst=4,ip,in_port=2 (via action) data_len=106 (unbuffered)
10118 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4,tp_dst=3 udp_csum:54f
10124 AT_SETUP([ofproto-dpif - conntrack - ct_label datapath flow])
10127 add_of_ports br0 1 2
10129 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10131 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10132 AT_DATA([flows.txt], [dnl
10133 dnl The flows are in two separate tables for two reasons:
10134 dnl * To make the pipeline more clear.
10135 dnl * To make megaflows more consistent (we check megaflows below). The
10136 dnl unwildcarding in megaflows depends on the internal ordering of the
10137 dnl subtables, which are sorted using the system qsort(). qsort()
10138 dnl is provided by libc and may or may not be stable, so we can't rely
10139 dnl on that. By having separate tables we have more control over which
10140 dnl subtables are visited, meaning consistent megaflows.
10144 table=0,arp,action=normal
10145 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:1->ct_label)),2
10146 table=0,ip,in_port=2,actions=ct(table=1)
10147 table=0,priority=0,action=drop
10151 table=1,priority=10,ct_state=+trk+rpl,ct_label=0x1,actions=1
10152 table=1,priority=1,action=drop
10155 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10157 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
10158 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
10160 # Give time for logs to appear.
10161 ovs-appctl revalidator/wait
10163 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
10164 ct_state(+rpl+trk),ct_label(0x1),recirc_id(0x1),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:1
10165 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no),udp(src=1), actions:ct(commit,label=0x1),2
10166 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:ct,recirc(0x1)
10172 AT_SETUP([ofproto-dpif - conntrack - no output])
10177 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10179 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10180 AT_DATA([flows.txt], [dnl
10181 in_port=1,udp,action=ct(commit,zone=0)
10184 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10186 dnl Start a new connection from port 1.
10187 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
10189 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
10190 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct(commit)
10196 AT_SETUP([ofproto-dpif - conntrack - tcp port reuse])
10199 add_of_ports br0 1 2
10201 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10203 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10204 AT_DATA([flows.txt], [dnl
10207 table=0,priority=100,arp,action=normal
10208 table=0,priority=10,in_port=1,ip,action=ct(commit,table=1)
10209 table=0,priority=10,in_port=2,ip,action=ct(table=1)
10210 table=0,priority=1,action=drop
10214 dnl The following two flows are separated to explicitly count the packets
10215 dnl that create a new connection
10216 table=1,priority=100,cookie=0x1,in_port=1,ip,ct_state=+trk+new-inv-rpl,action=2
10217 table=1,priority=100,in_port=1,ip,ct_state=+trk-new-inv-rpl,action=2
10219 table=1,priority=100,in_port=2,ip,ct_state=+trk+est+rpl-new-inv,action=1
10220 table=1,ip,ct_state=+trk+inv,action=drop
10223 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10225 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a50540000000908004500002ca4e5400040067fe20a0101010a0101020001000259b5d93f0000000060027210dd190000020405b4'])
10226 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a08004500002c00004000400624c80a0101020a010101000200017c35468459b5d940601272101a4f0000020405b4'])
10227 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e6400040067fe50a0101010a0101020001000259b5d9407c35468550107210320c0000'])
10228 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000303b5f40004006e9640a0101020a010101000200017c35468559b5d9405018721074c200007061796c6f61640a'])
10229 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e7400040067fe40a0101010a0101020001000259b5d9407c35468d5010721032040000'])
10230 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000283b6040004006e96b0a0101020a010101000200017c35468d59b5d9405011721032030000'])
10231 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e8400040067fe30a0101010a0101020001000259b5d9407c35468e5010721032030000'])
10232 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e9400040067fe20a0101010a0101020001000259b5d9407c35468e5011721032020000'])
10233 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000283b6140004006e96a0a0101020a010101000200017c35468e59b5d9415010721032020000'])
10235 AT_CHECK([ovs-appctl revalidator/purge])
10236 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10237 dnl Only one new connection
10241 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a50540000000908004500002cc0a74000400664200a0101010a010102000100025b7dbf1f0000000060027210f5710000020405b4'])
10242 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a08004500002c00004000400624c80a0101020a010101000200017c36468f5b7dbf2060127210329b0000020405b4'])
10243 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0a84000400664230a0101010a010102000100025b7dbf207c364690501072104a580000'])
10244 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000030392840004006eb9b0a0101020a010101000200017c3646905b7dbf20501872108d0e00007061796c6f61640a'])
10245 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0a94000400664220a0101010a010102000100025b7dbf207c364698501072104a500000'])
10246 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000028392940004006eba20a0101020a010101000200017c3646985b7dbf20501172104a4f0000'])
10247 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0aa4000400664210a0101010a010102000100025b7dbf207c364699501072104a4f0000'])
10248 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0ab4000400664200a0101010a010102000100025b7dbf207c364699501172104a4e0000'])
10249 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000028392a40004006eba10a0101020a010101000200017c3646995b7dbf21501072104a4e0000'])
10251 AT_CHECK([ovs-appctl revalidator/purge])
10252 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10253 dnl Two new connections
10260 AT_SETUP([ofproto-dpif - conntrack - tcp pick up])
10263 add_of_ports br0 1 2
10265 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10267 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10268 AT_DATA([flows.txt], [dnl
10271 table=0,priority=100,arp,action=normal
10272 table=0,priority=10,in_port=1,tcp,action=ct(commit,table=1)
10273 table=0,priority=10,in_port=2,tcp,action=ct(table=1)
10274 table=0,priority=1,action=drop
10278 table=1,priority=10,cookie=0x1,ip,ct_state=+trk+inv,action=controller
10279 table=1,priority=1,action=drop
10282 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10284 AT_CHECK([ovs-appctl revalidator/purge])
10285 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10286 dnl No dropped packets
10290 AT_CAPTURE_FILE([ofctl_monitor.log])
10291 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10293 dnl The first two packets (SYN, SYN|ACK) are commented out. We're making
10294 dnl sure that the connection tracker is able to pick up already established
10295 dnl connections that use window scaling.
10297 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000030fc2540004006289e0a0101020a01010100020001396bb359000000007002008080cc0000020405b401030307'])
10298 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a50540000000908004500003000004000400624c40a0101010a010102000100028cadbdb3396bb35a70120080365a0000020405b401030307'])
10299 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc264000400628a50a0101020a01010100020001396bb35a8cadbdb45010000a629b0000'])
10300 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000029fc274000400628a30a0101020a01010100020001396bb35a8cadbdb45018000a589200000a'])
10301 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2c84000400632030a0101010a010102000100028cadbdb4396bb35b5010000a629a0000'])
10302 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a08004500022afc284000400626a10a0101020a01010100020001396bb35b8cadbdb45018000a941f0000 dnl
10303 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10304 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10305 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10306 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10307 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10308 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10309 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10310 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10311 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10312 6666666666666666666666666666666666666666666666666666660a'])
10313 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2c94000400632020a0101010a010102000100028cadbdb4396bb55d5010000a60980000'])
10314 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a5054000000090800450001fdf2ca40004006302c0a0101010a010102000100028cadbdb4396bb55d5018000aa60c0000 dnl
10315 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10316 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10317 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10318 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10319 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10320 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10321 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10322 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10323 6565656565656565656565656565656565656565656565656565656565656565656565650a'])
10324 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc294000400628a20a0101020a01010100020001396bb55d8cadbf895010000a5ec30000'])
10325 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc2a4000400628a10a0101020a01010100020001396bb55d8cadbf895011000a5ec20000'])
10326 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2cb4000400632000a0101010a010102000100028cadbf89396bb55e5010000a5ec20000'])
10327 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2cc4000400631ff0a0101010a010102000100028cadbf89396bb55e5011000a5ec10000'])
10328 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028258e40004006ff3d0a0101020a01010100020001396bb55e8cadbf8a5010000a5ec10000'])
10330 AT_CHECK([ovs-appctl revalidator/purge])
10332 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10334 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10337 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10338 dnl No dropped packets
10345 dnl This is a truncated version of "ofproto-dpif - conntrack - controller",
10346 dnl with extra send-to-controller actions following ct_clear to show that
10347 dnl the connection tracking data has been cleared.
10348 AT_SETUP([ofproto-dpif - conntrack - ct_clear])
10351 add_of_ports br0 1 2
10353 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10355 dnl Allow new connections on p1->p2, but not on p2->p1.
10356 AT_DATA([flows.txt], [dnl
10359 table=0,priority=100,arp,action=normal
10360 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),controller,ct_clear,controller
10361 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
10362 table=0,priority=1,action=drop
10366 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller,ct_clear,controller
10367 table=1,priority=1,action=drop
10370 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10372 AT_CAPTURE_FILE([ofctl_monitor.log])
10373 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10375 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
10377 dnl OK, now start a new connection from port 1.
10378 AT_CHECK([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(0x0800),ipv4(src=10.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
10380 dnl Now try a reply from port 2.
10381 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
10383 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 8])
10384 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10386 dnl Check this output. We only see the latter two packets, not the first.
10387 dnl Note that the first packet doesn't have the ct_state bits set. This
10388 dnl happens because the ct_state field is available only after recirc.
10389 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10390 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10391 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
10393 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10394 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:553
10396 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
10397 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
10399 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered)
10400 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:553
10405 AT_SETUP([ofproto-dpif - conntrack - ofproto/trace])
10408 add_of_ports br0 1 2 3 4
10410 AT_DATA([flows.txt], [dnl
10413 table=0,priority=100,arp,action=normal
10414 table=0,priority=10,udp,action=ct(table=1,zone=0)
10415 table=0,priority=10,tcp,action=ct(table=2,zone=1)
10416 table=0,priority=1,action=drop
10420 table=1,priority=10,in_port=1,ct_zone=0,ct_state=+trk+new,udp,action=ct(commit,zone=0),2
10421 table=1,priority=10,in_port=1,ct_zone=0,ct_state=+trk+est,udp,action=2
10422 table=1,priority=10,in_port=2,ct_zone=0,ct_state=+trk+est,udp,action=1
10423 table=1,priority=1,action=drop
10427 table=2,priority=10,in_port=1,tcp,ct_zone=1,ct_state=+trk+new,tcp,action=ct(commit,zone=1),ct(table=3,zone=2)
10428 table=2,priority=10,in_port=1,tcp,ct_zone=1,ct_state=+trk+est,tcp,action=ct(table=3,zone=2)
10429 table=2,priority=1,action=drop
10433 table=3,priority=10,in_port=1,tcp,ct_zone=2,ct_state=+trk+new,tcp,action=ct(commit,zone=2),4
10434 table=3,priority=10,in_port=1,tcp,ct_zone=2,ct_state=+trk+est,tcp,action=3
10435 table=2,priority=1,action=drop
10438 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10440 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=2,udp'], [0], [stdout])
10441 AT_CHECK([tail -1 stdout], [0],
10442 [Datapath actions: drop
10445 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,udp'], [0], [stdout])
10446 AT_CHECK([tail -1 stdout], [0],
10447 [Datapath actions: ct(commit),2
10450 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,tcp'], [0], [stdout])
10451 AT_CHECK([tail -1 stdout], [0],
10452 [Datapath actions: ct(commit,zone=2),4
10455 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,tcp' --ct-next 'trk,est' --ct-next 'trk,est' ], [0], [stdout])
10456 AT_CHECK([tail -1 stdout], [0],
10457 [Datapath actions: 3
10463 AT_SETUP([ofproto - set mtu])
10468 # Check that initial MTU is 1500 for 'br0' and 'p1'.
10469 AT_CHECK([ovs-vsctl get Interface br0 mtu], [0], [dnl
10472 AT_CHECK([ovs-vsctl get Interface p1 mtu], [0], [dnl
10476 # Request new MTU for 'p1'
10477 AT_CHECK([ovs-vsctl set Interface p1 mtu_request=1600])
10479 # Check that the new MTU is applied
10480 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p1 mtu=1600])
10481 # The internal port 'br0' should have the same MTU value as p1, becase it's
10482 # the new bridge minimum.
10483 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
10485 AT_CHECK([ovs-vsctl del-port br0 p1])
10487 # When 'p1' is deleted, the internal port should return to the default MTU
10488 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1500])
10490 # New port with 'mtu_request' in the same transaction.
10491 AT_CHECK([ovs-vsctl add-port br0 p2 -- set int p2 type=dummy mtu_request=1600])
10492 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p2 mtu=1600])
10493 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
10495 # Explicitly set mtu_request on the internal interface. This should prevent
10496 # the MTU from being overriden.
10497 AT_CHECK([ovs-vsctl set int br0 mtu_request=1700])
10498 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1700])
10500 # The new MTU on p2 should not affect br0.
10501 AT_CHECK([ovs-vsctl set int p2 mtu_request=1400])
10502 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p2 mtu=1400])
10503 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1700])
10505 # Remove explicit mtu_request from br0. Now it should track the bridge
10507 AT_CHECK([ovs-vsctl set int br0 mtu_request=[[]]])
10508 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1400])
10513 AT_SETUP([ofproto - fragment prerequisites])
10516 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
10520 AT_DATA([flows.txt], [dnl
10521 priority=10,in_port=1,udp,tp_src=67,tp_dst=68,action=drop
10522 priority=1,in_port=1,udp,action=drop
10525 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10527 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:max-idle=10000])
10529 ovs-appctl time/stop
10530 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=later)'])
10531 ovs-appctl time/warp 5000
10533 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
10534 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=later), actions:drop
10537 dnl Change the flow table. This will trigger revalidation of all the flows.
10538 AT_CHECK([ovs-ofctl add-flow br0 priority=5,in_port=1,action=drop])
10539 AT_CHECK([ovs-appctl revalidator/wait], [0])
10541 dnl We don't want revalidators to delete any flow. If the flow has been
10542 dnl deleted it means that there's some inconsistency with the revalidation.
10543 AT_CHECK([grep flow_del ovs-vswitchd.log], [1])
10548 AT_SETUP([ofproto-dpif - check_pkt_larger action])
10550 add_of_ports br0 1 2 3 4
10552 AT_DATA([flows.txt], [dnl
10553 table=0,in_port=1 actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,1)
10554 table=1,in_port=1,reg0=0x1/0x1 actions=output:2,resubmit(,2)
10555 table=1,in_port=1,actions=output:3,resubmit(,2)
10556 table=2,in_port=1,actions=mod_dl_dst:82:82:82:82:82:82,output:4
10559 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10560 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10561 AT_CHECK([tail -1 stdout], [0], [dnl
10562 Datapath actions: check_pkt_len(size=200,gt(2,set(eth(dst=82:82:82:82:82:82)),4),le(3,set(eth(dst=82:82:82:82:82:82)),4))
10565 dnl Test flow xlate check_pkt_large clone action without using datapath check_pkt_len action.
10566 AT_CHECK([ovs-appctl dpif/set-dp-features br0 check_pkt_len false], [0], [ignore])
10568 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10569 AT_CHECK([tail -3 stdout], [0], [dnl
10570 Datapath actions: 3,set(eth(dst=82:82:82:82:82:82)),4
10571 This flow is handled by the userspace slow path because it:
10572 - Uses action(s) not supported by datapath.
10575 dnl Enable datapath check_pkt_len action
10576 AT_CHECK([ovs-appctl dpif/set-dp-features br0 check_pkt_len true], [0], [ignore])
10578 ovs-ofctl del-flows br0
10580 AT_DATA([flows.txt], [dnl
10581 table=0,in_port=1 actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,1)
10582 table=1,in_port=1,priority=200,reg0=0x1/0x1 actions=output:2
10585 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10586 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10587 AT_CHECK([tail -1 stdout], [0], [dnl
10588 Datapath actions: check_pkt_len(size=200,gt(2),le(drop))
10591 ovs-ofctl del-flows br0
10592 AT_DATA([flows.txt], [dnl
10593 table=0,in_port=1 actions=check_pkt_larger(200)->NXM_NX_REG0[[0]]
10596 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10597 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10598 AT_CHECK([tail -1 stdout], [0], [dnl
10599 Datapath actions: check_pkt_len(size=200,gt(drop),le(drop))
10602 ovs-ofctl del-flows br0
10603 AT_DATA([flows.txt], [dnl
10604 table=0,in_port=1 actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,1)
10605 table=1,in_port=1,priority=200,reg0=0x1/0x1,ip actions=clone(set_field:192.168.3.3->ip_src),clone(set_field:192.168.4.4->ip_dst,output:2),clone(mod_dl_src:80:81:81:81:81:81,set_field:192.168.5.5->ip_dst,output:3),output:4
10606 table=1,in_port=1,priority=0,ip actions=clone(set_field:192.168.3.3->ip_src),clone(set_field:192.168.4.4->ip_dst,output:2),clone(ct(commit),output:3),output:4
10609 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10610 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10611 AT_CHECK([tail -1 stdout], [0], [dnl
10612 Datapath actions: check_pkt_len(size=200,gt(set(ipv4(dst=192.168.4.4)),2,set(eth(src=80:81:81:81:81:81)),set(ipv4(dst=192.168.5.5)),3,set(eth(src=50:54:00:00:00:09)),set(ipv4(dst=10.10.10.1)),4),le(set(ipv4(dst=192.168.4.4)),2,set(ipv4(dst=10.10.10.1)),clone(ct(commit),3),4))
10615 AT_DATA([flows.txt], [dnl
10616 table=0,priority=0 actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,1)
10617 table=1,in_port=1,priority=200,reg0=0x1/0x1,ip actions=clone(set_field:192.168.3.3->ip_src, resubmit(,0))
10618 table=1,in_port=1,priority=0,ip actions=clone(set_field:192.168.3.4->ip_src, resubmit(,0))
10621 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10622 ovs-ofctl dump-flows br0
10624 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10625 AT_CHECK([tail -3 stdout], [0], [dnl
10626 Megaflow: recirc_id=0,eth,ip,reg0=0/0x1,in_port=1,nw_src=10.10.10.2,nw_frag=no
10627 Datapath actions: drop
10628 Translation failed (Recursion too deep), packet is dropped.
10631 ovs-ofctl del-flows br0
10632 AT_DATA([flows.txt], [dnl
10633 table=0,priority=0 actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,1)
10634 table=1,ip,nw_src=192.168.3.3 actions=output:3
10635 table=1,ip,nw_src=192.168.3.4 actions=output:4
10636 table=1,reg0=0x1/0x1,ip actions=clone(set_field:192.168.3.3->ip_src, resubmit(,0))
10637 table=1,ip actions=clone(set_field:192.168.3.4->ip_src, resubmit(,0))
10640 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10641 ovs-ofctl dump-flows br0
10643 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10644 AT_CHECK([tail -1 stdout], [0], [dnl
10645 Datapath actions: check_pkt_len(size=200,gt(set(ipv4(src=192.168.3.3)),check_pkt_len(size=200,gt(3),le(3))),le(set(ipv4(src=192.168.3.4)),check_pkt_len(size=200,gt(4),le(4))))
10648 ovs-ofctl del-flows br0
10649 AT_DATA([flows.txt], [dnl
10650 table=0,in_port=1 actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,1)
10651 table=1,in_port=1,reg0=0x1/0x1 actions=mod_dl_dst:82:82:82:82:82:82,controller(),resubmit(,2)
10652 table=1,in_port=1 actions=resubmit(,2)
10653 table=2,ip,dl_dst=82:82:82:82:82:82 actions=ct(table=3)
10654 table=2,ip,dl_dst=50:54:00:00:00:0a actions=ct(table=3)
10655 table=3,ip,reg0=0x1/0x1 actions=output:2
10656 table=3,ip actions=output:4
10659 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10660 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
10661 AT_CHECK([cat stdout | grep Datapath -B1], [0], [dnl
10662 Megaflow: recirc_id=0,eth,ip,in_port=1,dl_dst=50:54:00:00:00:0a,nw_frag=no
10663 Datapath actions: check_pkt_len(size=200,gt(set(eth(dst=82:82:82:82:82:82)),userspace(pid=0,controller(reason=1,dont_send=1,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535)),ct,recirc(0x2)),le(ct,recirc(0x3)))
10665 Megaflow: recirc_id=0x2,eth,ip,in_port=1,nw_frag=no
10666 Datapath actions: 2
10668 Megaflow: recirc_id=0x3,eth,ip,in_port=1,nw_frag=no
10669 Datapath actions: 4
10675 AT_SETUP([ofproto-dpif - check_pkt_larger with continuation and ct])
10677 add_of_ports --pcap br0 `seq 1 4`
10679 AT_CAPTURE_FILE([ofctl_monitor0.log])
10680 AT_CHECK([ovs-ofctl monitor br0 resume --detach --no-chdir --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log])
10682 AT_DATA([flows.txt], [dnl
10683 table=0,in_port=1 actions=check_pkt_larger(150)->NXM_NX_REG0[[0]],resubmit(,1)
10684 table=1,ip,reg0=0x1/0x1 actions=mod_dl_dst:82:82:82:82:82:82,controller(pause),resubmit(,2)
10685 table=1,ip,reg0=0 actions=mod_dl_dst:83:83:83:83:83:83,controller(pause),resubmit(,2)
10686 table=2,ip,dl_dst=82:82:82:82:82:82 actions=ct(table=3)
10687 table=2,ip,dl_dst=83:83:83:83:83:83 actions=ct(table=3)
10688 table=3,ip,reg0=0x1/0x1 actions=ct(commit),output:2
10689 table=3,ip actions=ct(commit),output:4
10692 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
10694 flow="in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)"
10696 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
10698 OVS_WAIT_UNTIL([test 1 = `ovs-ofctl parse-pcap p4-tx.pcap \
10699 | grep dl_dst=83:83:83:83:83:83 | wc -l`])
10700 AT_CHECK([test 0 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`])
10702 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow" --len 200], [0], [stdout])
10704 OVS_WAIT_UNTIL([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap \
10705 | grep dl_dst=82:82:82:82:82:82 | wc -l`])
10706 AT_CHECK([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`])