tests: Reduce user burden for running "make check".
[cascardo/ovs.git] / tests / ofproto-dpif.at
1 AT_BANNER([ofproto-dpif])
2
3 AT_SETUP([ofproto-dpif - revalidator/wait])
4 OVS_VSWITCHD_START
5 AT_CHECK([ovs-appctl revalidator/wait])
6 OVS_VSWITCHD_STOP
7 AT_CLEANUP
8
9 AT_SETUP([ofproto-dpif - active-backup bonding])
10 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
11 #    and br1 with interfaces p3, p4 and p8.
12 # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
13 OVS_VSWITCHD_START(
14   [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
15    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
16    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
17    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
18    add-br br1 -- \
19    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
20    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
21                   fail-mode=secure -- \
22    add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
23    add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
24    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
25 WAIT_FOR_DUMMY_PORTS([p3], [p4])
26 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
27
28 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
29 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
30 ovs-appctl netdev-dummy/set-admin-state up
31 ovs-appctl time/warp 100
32 ovs-appctl netdev-dummy/set-admin-state p2 down
33 ovs-appctl time/stop
34 ovs-appctl time/warp 100
35 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)'])
36 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)'])
37 ovs-appctl time/warp 100
38 ovs-appctl netdev-dummy/set-admin-state p2 up
39 ovs-appctl netdev-dummy/set-admin-state p1 down
40 ovs-appctl time/warp 100
41 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)'])
42 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)'])
43 ovs-appctl time/warp 200 100
44 sleep 1
45 AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[348]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
46 recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
47 recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
48 recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0d,nw_frag=no, actions: <del>
49 recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0e,nw_frag=no, actions: <del>
50 recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
51 recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
52 ])
53 OVS_VSWITCHD_STOP
54 AT_CLEANUP
55
56 AT_SETUP([ofproto-dpif - balance-slb bonding])
57 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
58 #    and br1 with interfaces p4, p5, p6 and p8.
59 #    p1 <-> p4, p2 <-> p5, p3 <-> p6
60 # Send some traffic, make sure the traffic are spread based on source mac.
61 OVS_VSWITCHD_START(
62   [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
63    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
64    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
65    set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
66    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
67    add-br br1 -- \
68    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
69    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
70                   fail-mode=secure -- \
71    add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
72    add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
73    add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
74    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
75 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
76 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
77 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
78 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
79 ])
80 ovs-appctl time/stop
81 ovs-appctl time/warp 100
82 (
83 for i in `seq 0 100 |xargs printf '%02x\n'`;
84     do
85     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)"
86     AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
87     done
88 )
89 ovs-appctl time/warp 100
90 AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
91 # Make sure there is resonable distribution to all three ports.
92 # We don't want to make this check precise, in case hash function changes.
93 AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
94 AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
95 AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
96 OVS_VSWITCHD_STOP
97 AT_CLEANUP
98
99 AT_SETUP([ofproto-dpif - balance-tcp bonding])
100 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
101 #    and br1 with interfaces bond1(p4, p5, p6) and p8.
102 #    bond0 <-> bond1
103 # Send some traffic, make sure the traffic are spread based on L4 headers.
104 OVS_VSWITCHD_START(
105   [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
106         other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
107    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
108    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
109    set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
110    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
111    add-br br1 -- \
112    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
113    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
114                   fail-mode=secure -- \
115    add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
116         other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
117    set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
118    set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
119    set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
120    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
121 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
122 ])
123 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
124 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
125 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
126 ], [])
127 OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
128 ovs-appctl time/stop
129 ovs-appctl time/warp 100
130 ovs-appctl lacp/show > lacp.txt
131 ovs-appctl bond/show > bond.txt
132 (
133 for i in `seq 0 255` ;
134     do
135     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)"
136     AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
137     done
138 )
139 ovs-appctl time/warp 300 100
140 AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
141 AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
142 # Make sure there is resonable distribution to all three ports.
143 # We don't want to make this check precise, in case hash function changes.
144 AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
145 AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
146 AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
147
148 OVS_VSWITCHD_STOP()
149 AT_CLEANUP
150
151 # Makes sure recirculation does not change the way packet is handled.
152 AT_SETUP([ofproto-dpif - balance-tcp bonding, different recirc flow ])
153 OVS_VSWITCHD_START(
154   [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
155        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
156    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
157    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
158    add-br br1 -- \
159    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
160    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
161        fail-mode=standalone -- \
162    add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
163        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
164    set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
165    set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
166    add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
167    add-br br-int -- \
168    set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
169    set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
170        fail-mode=secure -- \
171    add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
172    add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
173 ])
174 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
175 ])
176
177 # Waits for all ifaces enabled.
178 OVS_WAIT_UNTIL([test `ovs-appctl bond/show | grep -- "may_enable: true" |  wc -l` -ge 4])
179
180 # The dl_vlan flow should not be ever matched,
181 # since recirculation should not change the flow handling.
182 AT_DATA([flows.txt], [dnl
183 table=0 priority=1 in_port=5 actions=mod_vlan_vid:1,output(101)
184 table=0 priority=2 in_port=5 dl_vlan=1 actions=drop
185 ])
186 AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
187
188 # Sends a packet to trigger recirculation.
189 # Should generate recirc_id(0x2),dp_hash(0xc1261ba2/0xff).
190 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)"])
191
192 # Collects flow stats.
193 AT_CHECK([ovs-appctl revalidator/purge], [0])
194
195 # Checks the flow stats in br1, should only be one flow with non-zero
196 # 'n_packets' from internal table.
197 AT_CHECK([ovs-appctl bridge/dump-flows br1 | ofctl_strip | grep -- "n_packets" | grep -- "table_id" | sed -e 's/dp_hash=0x[[0-9a-f]][[0-9a-f]]*/dp_hash=0x0/' -e 's/output:[[0-9]][[0-9]]*/output/'], [0], [dnl
198 table_id=254, n_packets=1, n_bytes=64, priority=20,recirc_id=0x2,dp_hash=0x0/0xff,actions=output
199 ])
200
201 # Checks the flow stats in br-int, should be only one match.
202 AT_CHECK([ovs-ofctl dump-flows br-int | ofctl_strip | sort], [0], [dnl
203  n_packets=1, n_bytes=60, priority=1,in_port=5 actions=mod_vlan_vid:1,output:101
204  priority=2,in_port=5,dl_vlan=1 actions=drop
205 NXST_FLOW reply:
206 ])
207
208 OVS_VSWITCHD_STOP()
209 AT_CLEANUP
210
211 AT_SETUP([ofproto-dpif - resubmit])
212 OVS_VSWITCHD_START
213 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13], [14], [15],
214                     [16], [17], [18], [19], [20], [21])
215 AT_DATA([flows.txt], [dnl
216 table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
217 table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
218 table=0 in_port=3 priority=2000 icmp actions=output(20)
219 table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
220 table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
221 table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
222 ])
223 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
224 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])
225 AT_CHECK([tail -1 stdout], [0],
226   [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
227 ])
228 OVS_VSWITCHD_STOP
229 AT_CLEANUP
230
231 AT_SETUP([ofproto-dpif - goto table])
232 OVS_VSWITCHD_START
233 ADD_OF_PORTS([br0], [1], [10], [11])
234 echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
235 for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
236 echo "table=64 actions=output(11)" >> flows.txt
237 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
238 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])
239 AT_CHECK([tail -1 stdout], [0],
240   [Datapath actions: 10,11
241 ])
242 OVS_VSWITCHD_STOP
243 AT_CLEANUP
244
245 AT_SETUP([ofproto-dpif - write actions])
246 OVS_VSWITCHD_START
247 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
248 AT_DATA([flows.txt], [dnl
249 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
250 table=1 ip actions=write_actions(output(13)),goto_table(2)
251 table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
252 ])
253 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
254 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])
255 AT_CHECK([tail -2 stdout], [0],
256   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
257 Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
258 ])
259 OVS_VSWITCHD_STOP
260 AT_CLEANUP
261
262 AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND)])
263 OVS_VSWITCHD_START
264 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
265 AT_DATA([flows.txt], [dnl
266 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)
267 table=1 icmp6 actions=write_actions(output(13)),goto_table(2)
268 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)
269 ])
270 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
271 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])
272 AT_CHECK([tail -4 stdout], [0],
273   [Megaflow: recirc_id=0,icmp6,in_port=1,nw_frag=no,icmp_type=135,icmp_code=0x0/0xff,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11
274 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
275 This flow is handled by the userspace slow path because it:
276         - Uses action(s) not supported by datapath.
277 ])
278 OVS_VSWITCHD_STOP
279 AT_CLEANUP
280
281 AT_SETUP([ofproto-dpif - clear actions])
282 OVS_VSWITCHD_START
283 ADD_OF_PORTS([br0], [1], [10], [11], [12])
284 AT_DATA([flows.txt], [dnl
285 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
286 table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
287 ])
288 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
289 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])
290 AT_CHECK([tail -2 stdout], [0],
291   [Megaflow: recirc_id=0,tcp,in_port=1,nw_frag=no,tp_src=8
292 Datapath actions: 10,set(tcp(src=91)),11
293 ])
294 OVS_VSWITCHD_STOP
295 AT_CLEANUP
296
297 AT_SETUP([ofproto-dpif - group chaining])
298 OVS_VSWITCHD_START
299 ADD_OF_PORTS([br0], [1], [10], [11])
300 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'])
301 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=123,type=all,bucket=output:10'])
302 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
303 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])
304 AT_CHECK([tail -1 stdout], [0],
305   [Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
306 ])
307 OVS_VSWITCHD_STOP
308 AT_CLEANUP
309
310 AT_SETUP([ofproto-dpif - all group in action list])
311 OVS_VSWITCHD_START
312 ADD_OF_PORTS([br0], [1], [10], [11])
313 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'])
314 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
315 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])
316 # Must match on the source address to be able to restore it's value for
317 # the second bucket
318 AT_CHECK([tail -2 stdout], [0],
319   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
320 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
321 ])
322 OVS_VSWITCHD_STOP
323 AT_CLEANUP
324
325 AT_SETUP([ofproto-dpif - indirect group in action list])
326 OVS_VSWITCHD_START
327 ADD_OF_PORTS([br0], [1], [10])
328 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
329 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
330 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])
331 AT_CHECK([tail -1 stdout], [0],
332   [Datapath actions: 10
333 ])
334 OVS_VSWITCHD_STOP
335 AT_CLEANUP
336
337 AT_SETUP([ofproto-dpif - group actions have no effect afterwards])
338 OVS_VSWITCHD_START
339 ADD_OF_PORTS([br0], [1], [10])
340 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'])
341 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234,output:10'])
342 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])
343 AT_CHECK([tail -1 stdout], [0],
344   [Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2)),10
345 ])
346 OVS_VSWITCHD_STOP
347 AT_CLEANUP
348
349 AT_SETUP([ofproto-dpif - all group in action set])
350 OVS_VSWITCHD_START
351 ADD_OF_PORTS([br0], [1], [10], [11])
352 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'])
353 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
354 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])
355 # Must match on the source address to be able to restore it's value for
356 # the third bucket
357 AT_CHECK([tail -2 stdout], [0],
358   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
359 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
360 ])
361 OVS_VSWITCHD_STOP
362 AT_CLEANUP
363
364 AT_SETUP([ofproto-dpif - indirect group in action set])
365 OVS_VSWITCHD_START
366 ADD_OF_PORTS([br0], [1], [10])
367 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
368 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
369 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])
370 AT_CHECK([tail -1 stdout], [0],
371   [Datapath actions: 10
372 ])
373 OVS_VSWITCHD_STOP
374 AT_CLEANUP
375
376 AT_SETUP([ofproto-dpif - select group])
377 OVS_VSWITCHD_START
378 ADD_OF_PORTS([br0], [1], [10], [11])
379 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
380 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
381
382 # Try a bunch of different flows and make sure that they get distributed
383 # at least somewhat.
384 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
385     AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,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])
386     tail -1 stdout >> results
387 done
388 sort results | uniq -c
389 AT_CHECK([sort results | uniq], [0],
390   [Datapath actions: 10
391 Datapath actions: 11
392 ])
393 OVS_VSWITCHD_STOP
394 AT_CLEANUP
395
396 AT_SETUP([ofproto-dpif - select group with watch port])
397 OVS_VSWITCHD_START
398 ADD_OF_PORTS([br0], [1], [10], [11])
399 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
400 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
401 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,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])
402 AT_CHECK([tail -1 stdout], [0],
403   [Datapath actions: 11
404 ])
405 OVS_VSWITCHD_STOP
406 AT_CLEANUP
407
408 AT_SETUP([ofproto-dpif - select group with weight])
409 OVS_VSWITCHD_START
410 ADD_OF_PORTS([br0], [1], [10], [11], [12])
411 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11,weight=2000,bucket=output:12,weight=0'])
412 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
413 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,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])
414 AT_CHECK([tail -1 stdout], [0],
415   [Datapath actions: 11
416 ])
417 OVS_VSWITCHD_STOP
418 AT_CLEANUP
419
420 AT_SETUP([ofproto-dpif - select group with hash selection method])
421 OVS_VSWITCHD_START
422 ADD_OF_PORTS([br0], [1], [10], [11])
423 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=hash,fields=eth_dst,bucket=output:10,bucket=output:11'])
424 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
425
426 # Try a bunch of different flows and make sure that they get distributed
427 # at least somewhat.
428 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
429     AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,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])
430     tail -1 stdout >> results
431 done
432 sort results | uniq -c
433 AT_CHECK([sort results | uniq], [0],
434   [Datapath actions: 10
435 Datapath actions: 11
436 ])
437
438 > results
439 # Try a bunch of different flows and make sure that they are not distributed
440 # as they only vary a field that is not hashed
441 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
442     AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:$d,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])
443     tail -1 stdout >> results
444 done
445 sort results | uniq -c
446 AT_CHECK([sort results | uniq], [0],
447   [Datapath actions: 10
448 ])
449
450 OVS_VSWITCHD_STOP
451 AT_CLEANUP
452
453 AT_SETUP([ofproto-dpif - fast failover group])
454 OVS_VSWITCHD_START
455 ADD_OF_PORTS([br0], [1], [10], [11])
456 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'])
457 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
458 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])
459 AT_CHECK([tail -1 stdout], [0],
460   [Datapath actions: drop
461 ])
462 OVS_VSWITCHD_STOP
463 AT_CLEANUP
464
465 AT_SETUP([ofproto-dpif - group stats single bucket])
466 OVS_VSWITCHD_START
467 ADD_OF_PORTS([br0], [1], [10], [11])
468 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
469 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
470 (
471 for i in `seq 0 2`;
472     do
473     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)"
474     AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
475     done
476 )
477 AT_CHECK([ovs-appctl revalidator/purge], [0])
478 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
479 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
480  group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=0,byte_count=0
481 OFPST_GROUP reply (OF1.2):
482 ])
483 OVS_VSWITCHD_STOP
484 AT_CLEANUP
485
486 AT_SETUP([ofproto-dpif - group stats all buckets])
487 OVS_VSWITCHD_START
488 ADD_OF_PORTS([br0], [1], [10], [11])
489 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
490 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
491 (
492 for i in `seq 0 2`;
493     do
494     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)"
495     AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
496     done
497 )
498 AT_CHECK([ovs-appctl revalidator/purge], [0])
499 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
500 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
501  group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=3,byte_count=180
502 OFPST_GROUP reply (OF1.2):
503 ])
504 OVS_VSWITCHD_STOP
505 AT_CLEANUP
506
507 AT_SETUP([ofproto-dpif - registers])
508 OVS_VSWITCHD_START
509 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
510 AT_DATA([flows.txt], [dnl
511 in_port=90                 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
512 in_port=91                 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
513 in_port=92                 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
514 in_port=93                 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
515
516 in_port=2                  actions=load:0x000db000->NXM_NX_REG0[[]]
517 in_port=3                  actions=load:0xdea->NXM_NX_REG0[[20..31]]
518 in_port=4                  actions=load:0xeef->NXM_NX_REG0[[0..11]]
519 in_port=5                  actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
520 in_port=6                  actions=load:0x22222222->NXM_NX_REG2[[]]
521 in_port=7                  actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
522 in_port=8                  actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
523 in_port=9,reg0=0xdeadbeef  actions=output:20
524 in_port=10,reg1=0xdeadbeef actions=output:21
525 in_port=11,reg2=0xeef22dea actions=output:22
526
527 dnl Sanilty check all registers
528 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
529 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
530 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
531 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
532
533 ])
534 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
535 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])
536 AT_CHECK([tail -1 stdout], [0],
537   [Datapath actions: 20,21,22,33
538 ])
539 OVS_VSWITCHD_STOP
540 AT_CLEANUP
541
542 dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
543 dnl in the manner documented in ovs-ofctl(8).
544 AT_SETUP([ofproto-dpif - extended registers])
545 OVS_VSWITCHD_START
546 ADD_OF_PORTS([br0], [1], [2], [3])
547 AT_DATA([flows.txt], [dnl
548 table=0     actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
549 table=1,reg2=0xfedcba98,reg3=0x76543210   actions=2
550
551 # These low-priority rules shouldn't match.  They're here only to make really
552 # sure that the test fails if either of the above rules fails to match.
553 table=0,priority=0                        actions=3
554 table=1,priority=0                        actions=3
555 ])
556 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
557 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])
558 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
559 ])
560 OVS_VSWITCHD_STOP
561 AT_CLEANUP
562
563 AT_SETUP([ofproto-dpif - load and move order])
564 OVS_VSWITCHD_START
565 ADD_OF_PORTS([br0], [1], [10], [11])
566 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'])
567 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)'])
568 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])
569 AT_CHECK([tail -2 stdout], [0],
570   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
571 Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
572 ])
573 OVS_VSWITCHD_STOP
574 AT_CLEANUP
575
576 dnl Tests that 1.5 copy-field can copy into the standardized xregs.
577 AT_SETUP([ofproto-dpif - copy-field into extended registers])
578 OVS_VSWITCHD_START
579 ADD_OF_PORTS([br0], [1], [2], [3])
580 AT_DATA([flows.txt], [dnl
581 table=0     actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
582 table=1,xreg0=0x0000505400000005   actions=2
583
584 # These low-priority rules shouldn't match.  They're here only to make really
585 # sure that the test fails if either of the above rules fails to match.
586 table=0,priority=0                        actions=3
587 table=1,priority=0                        actions=3
588 ])
589 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
590 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])
591 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
592 ])
593 OVS_VSWITCHD_STOP
594 AT_CLEANUP
595
596 dnl Tests that 1.5 set-field with mask in the metadata register.
597 AT_SETUP([ofproto-dpif - masked set-field into metadata])
598 OVS_VSWITCHD_START
599 ADD_OF_PORTS([br0], [1], [2], [3])
600 AT_DATA([flows.txt], [dnl
601 table=0     actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1)
602 table=1     actions=set_field:0x6b/0xff->metadata,goto_table(2)
603 table=2,metadata=0xfafafafa5a5a5a6b  actions=2
604
605 # These low-priority rules shouldn't match.  They're here only to make really
606 # sure that the test fails if either of the above rules fails to match.
607 table=0,priority=0                        actions=3
608 table=1,priority=0                        actions=3
609 table=2,priority=0                        actions=3
610 ])
611 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
612 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])
613 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
614 ])
615 OVS_VSWITCHD_STOP
616 AT_CLEANUP
617
618
619 AT_SETUP([ofproto-dpif - actset_output])
620 OVS_VSWITCHD_START
621 ADD_OF_PORTS(
622   [br0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13])
623 AT_DATA([flows.txt], [dnl
624 table=0,actset_output=unset     actions=write_actions(output(2)),goto_table(1)
625 table=1     actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
626
627 # Verify that actset_output got set.
628 table=2,priority=20,actset_output=2  actions=4,goto_table(3)
629 table=2,priority=10                  actions=5,goto_table(3)
630
631 # Verify that xreg0 got copied properly from actset_output.
632 table=3,priority=20,xreg0=2  actions=6,goto_table(4)
633 table=3,priority=10          actions=7,goto_table(4)
634
635 # Verify that adding a group action unsets actset_output.
636 table=4 actions=write_actions(group(5)),goto_table(5)
637 table=5,priority=20,actset_output=unset  actions=8,goto_table(6)
638 table=5,priority=10                      actions=9,goto_table(6)
639
640 # Verify that adding another output action doesn't change actset_output
641 # (since there's still a group).
642 table=6 actions=write_actions(output(3)),goto_table(7)
643 table=7,priority=20,actset_output=unset  actions=10,goto_table(8)
644 table=7,priority=10                      actions=11,goto_table(8)
645
646 # Verify that clearing the action set, then writing an output action,
647 # causes actset_output to be set again.
648 table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
649 table=9,priority=20,actset_output=2 actions=12
650 table=9,priority=10                 actions=13
651 ])
652 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
653 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])
654 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
655 ])
656 OVS_VSWITCHD_STOP
657 AT_CLEANUP
658 AT_SETUP([ofproto-dpif - push-pop])
659 OVS_VSWITCHD_START
660 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
661 AT_DATA([flows.txt], [dnl
662 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
663 in_port=2            actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
664 in_port=3            actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
665 in_port=4            actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
666 in_port=5            actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
667
668 ])
669 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
670 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])
671 AT_CHECK([tail -1 stdout], [0],
672   [Datapath actions: 33,22,21,20
673 ])
674 OVS_VSWITCHD_STOP
675 AT_CLEANUP
676
677 AT_SETUP([ofproto-dpif - output])
678 OVS_VSWITCHD_START
679 ADD_OF_PORTS([br0], [1], [9], [10], [11], [55], [66], [77], [88])
680 AT_DATA([flows.txt], [dnl
681 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
682 in_port=2 actions=output:9
683 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
684 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
685 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
686 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
687 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
688 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
689 ])
690 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
691 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])
692 AT_CHECK([tail -1 stdout], [0],
693   [Datapath actions: 9,55,10,55,66,11,77,88,9,1
694 ])
695 OVS_VSWITCHD_STOP
696 AT_CLEANUP
697
698 AT_SETUP([ofproto-dpif - dec_ttl])
699 OVS_VSWITCHD_START
700 ADD_OF_PORTS([br0], [1], [2], [3], [4])
701 AT_DATA([flows.txt], [dnl
702 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
703 table=1 in_port=1 action=dec_ttl,output:3
704 ])
705 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
706 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])
707 AT_CHECK([tail -4 stdout], [0],
708   [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=2,nw_frag=no
709 Datapath actions: set(ipv4(ttl=1)),2,4
710 This flow is handled by the userspace slow path because it:
711         - Sends "packet-in" messages to the OpenFlow controller.
712 ])
713 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])
714 AT_CHECK([tail -2 stdout], [0],
715   [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=3,nw_frag=no
716 Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
717 ])
718 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])
719 AT_CHECK([tail -2 stdout], [0],
720   [Megaflow: recirc_id=0,ipv6,in_port=1,nw_ttl=128,nw_frag=no
721 Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
722 ])
723
724 AT_CAPTURE_FILE([ofctl_monitor.log])
725 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
726 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])
727 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
728 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
729 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
730 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
731 ])
732 OVS_VSWITCHD_STOP
733 AT_CLEANUP
734
735 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
736 dnl buffer to be resized just before pushing the id of the dec_ttl action.
737 dnl Thus the implementation must account for this by using the
738 dnl reallocated buffer rather than the original buffer.
739 dnl
740 dnl A number of similar rules are added to try and exercise
741 dnl xrealloc sufficiently that it returns a different base pointer
742 AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
743 OVS_VSWITCHD_START
744 ADD_OF_PORTS([br0], [1])
745 (for i in `seq 0 255`; do
746   printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
747  done) > flows.txt
748 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
749 OVS_VSWITCHD_STOP
750 AT_CLEANUP
751
752 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
753 dnl buffer to be resized just before pushing the id of the dec_ttl action.
754 dnl Thus the implementation must account for this by using the
755 dnl reallocated buffer rather than the original buffer.
756 dnl
757 dnl A number of similar rules are added to try and exercise
758 dnl xrealloc sufficiently that it returns a different base pointer
759 AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
760 OVS_VSWITCHD_START
761 ADD_OF_PORTS([br0], [1])
762 (for i in `seq 0 255`; do
763   printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
764  done) > flows.txt
765 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
766 OVS_VSWITCHD_STOP
767 AT_CLEANUP
768
769 dnl A note action at offset 24 in ofpacts will cause the ofpacts
770 dnl buffer to be resized just before pushing the id of the dec_ttl action.
771 dnl Thus the implementation must account for this by using the
772 dnl reallocated buffer rather than the original buffer.
773 dnl
774 dnl A number of similar rules are added to try and exercise
775 dnl xrealloc sufficiently that it returns a different base pointer
776 AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
777 OVS_VSWITCHD_START
778 ADD_OF_PORTS([br0], [1])
779 (for i in `seq 0 255`; do
780   printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
781  done) > flows.txt
782 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
783 OVS_VSWITCHD_STOP
784 AT_CLEANUP
785
786 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
787 OVS_VSWITCHD_START
788 ADD_OF_PORTS([br0], [1], [2])
789
790 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
791
792 # "in_port" defaults to OFPP_NONE if it's not specified.
793 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"
794 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
795 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
796 1
797 2
798 100
799 ])
800
801 OVS_VSWITCHD_STOP
802 AT_CLEANUP
803
804 AT_SETUP([ofproto-dpif - DSCP])
805 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
806 ADD_OF_PORTS([br0], [9])
807 AT_DATA([flows.txt], [dnl
808 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
809 ])
810 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
811 AT_CHECK([ovs-vsctl -- \
812         set Port p1 qos=@newqos --\
813         --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
814         --id=@q1 create Queue dscp=1 --\
815         --id=@q2 create Queue dscp=2], [0], [ignore])
816 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])
817 AT_CHECK([tail -2 stdout], [0],
818   [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no
819 Datapath actions: dnl
820 100,dnl
821 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
822 set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
823 1,dnl
824 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
825 set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
826 set(ipv4(tos=0/0xfc)),1,100
827 ])
828 OVS_VSWITCHD_STOP
829 AT_CLEANUP
830
831 AT_SETUP([ofproto-dpif - output/flood flags])
832 OVS_VSWITCHD_START
833 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
834
835 AT_DATA([flows.txt], [dnl
836 in_port=local actions=local,flood
837 in_port=1 actions=flood
838 in_port=2 actions=all
839 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
840 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
841 ])
842 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
843 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
844 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
845
846 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])
847 AT_CHECK([tail -1 stdout \
848 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
849 1
850 2
851 3
852 4
853 7
854 ])
855
856 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])
857 AT_CHECK([tail -1 stdout \
858 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
859 100
860 2
861 3
862 4
863 7
864 ])
865
866 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])
867 AT_CHECK([tail -1 stdout \
868 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
869 1
870 100
871 3
872 4
873 6
874 7
875 ])
876
877 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])
878 AT_CHECK([tail -1 stdout], [0],
879   [Datapath actions: 100,1,2,4,6,7
880 ])
881
882 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])
883 AT_CHECK([tail -1 stdout], [0],
884   [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
885 ])
886 OVS_VSWITCHD_STOP
887 AT_CLEANUP
888
889 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
890 OVS_VSWITCHD_START([dnl
891    add-port br0 p1 -- set Interface p1 type=dummy
892 ])
893 ON_EXIT([kill `cat ovs-ofctl.pid`])
894
895 AT_CAPTURE_FILE([ofctl_monitor.log])
896
897 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
898
899 for i in 1 2 3 ; do
900     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)'
901 done
902 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
903 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
904 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
905 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
906 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:0
907 dnl
908 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
909 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:0
910 dnl
911 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
912 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:0
913 ])
914
915 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
916 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
917 NXST_FLOW reply:
918 ])
919
920 OVS_VSWITCHD_STOP
921 AT_CLEANUP
922
923 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
924 OVS_VSWITCHD_START([dnl
925    add-port br0 p1 -- set Interface p1 type=dummy
926 ])
927 ON_EXIT([kill `cat ovs-ofctl.pid`])
928
929 AT_CAPTURE_FILE([ofctl_monitor.log])
930 AT_CHECK([ovs-ofctl del-flows br0])
931
932 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
933
934 dnl Test that missed packets are droped
935 for i in 1 2 3 ; do
936     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)'
937 done
938 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
939
940 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
941 ])
942
943 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
944 AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
945 OFPST_FLOW reply (OF1.3):
946 ])
947
948 OVS_VSWITCHD_STOP
949 AT_CLEANUP
950
951 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
952 OVS_VSWITCHD_START([dnl
953    add-port br0 p1 -- set Interface p1 type=dummy
954 ])
955 ON_EXIT([kill `cat ovs-ofctl.pid`])
956
957 AT_CAPTURE_FILE([ofctl_monitor.log])
958 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
959
960 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
961
962 for i in 1 2 3 ; do
963     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)'
964 done
965 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
966 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
967 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
968 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
969 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:0
970 dnl
971 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
972 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:0
973 dnl
974 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
975 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:0
976 ])
977
978 AT_CHECK([ovs-appctl revalidator/purge], [0])
979 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
980  n_packets=3, n_bytes=180, actions=goto_table:1
981 OFPST_FLOW reply (OF1.2):
982 ])
983
984 OVS_VSWITCHD_STOP
985 AT_CLEANUP
986
987 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
988 OVS_VSWITCHD_START([dnl
989    add-port br0 p1 -- set Interface p1 type=dummy
990 ])
991 ON_EXIT([kill `cat ovs-ofctl.pid`])
992
993 AT_CAPTURE_FILE([ofctl_monitor.log])
994 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
995
996 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
997
998 for i in 1 2 3 ; do
999     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)'
1000 done
1001
1002 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1003 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1004 ])
1005
1006 AT_CHECK([ovs-appctl revalidator/purge], [0])
1007 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1008  n_packets=3, n_bytes=180, actions=resubmit(1,1)
1009 OFPST_FLOW reply (OF1.2):
1010 ])
1011
1012 OVS_VSWITCHD_STOP
1013 AT_CLEANUP
1014
1015 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
1016 OVS_VSWITCHD_START([dnl
1017    add-port br0 p1 -- set Interface p1 type=dummy
1018 ])
1019 ON_EXIT([kill `cat ovs-ofctl.pid`])
1020
1021 AT_CAPTURE_FILE([ofctl_monitor.log])
1022 AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
1023 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1024
1025 dnl Miss table 0, Hit table 1
1026 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1027
1028 for i in 1 2 3 ; do
1029     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)'
1030 done
1031 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1032 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1033
1034 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1035 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1036 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:0
1037 dnl
1038 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1039 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:0
1040 dnl
1041 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1042 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:0
1043 ])
1044
1045 dnl Hit table 0, Miss all other tables, sent to controller
1046 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1047
1048 for i in 1 2 3 ; do
1049     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)'
1050 done
1051 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1052 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1053
1054 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1055 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1056 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:0
1057 dnl
1058 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1059 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:0
1060 dnl
1061 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1062 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:0
1063 ])
1064
1065 AT_CHECK([ovs-appctl revalidator/purge], [0])
1066 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1067  table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1068 OFPST_FLOW reply (OF1.2):
1069 ])
1070
1071 OVS_VSWITCHD_STOP
1072 AT_CLEANUP
1073
1074 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
1075 OVS_VSWITCHD_START([dnl
1076    add-port br0 p1 -- set Interface p1 type=dummy
1077 ])
1078 ON_EXIT([kill `cat ovs-ofctl.pid`])
1079
1080 AT_CAPTURE_FILE([ofctl_monitor.log])
1081 AT_DATA([flows.txt], [dnl
1082 table=0 actions=goto_table(1)
1083 table=2 dl_src=10:11:11:11:11:11 actions=controller
1084 ])
1085 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1086 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1087
1088 dnl Hit table 0, Miss table 1, Hit table 2
1089 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1090
1091 for i in 1 2 3 ; do
1092     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)'
1093 done
1094 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1095 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1096
1097 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1098 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1099 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:0
1100 dnl
1101 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1102 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:0
1103 dnl
1104 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1105 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:0
1106 ])
1107
1108 dnl Hit table 1, Miss all other tables, sent to controller
1109 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1110
1111 for i in 1 2 3 ; do
1112     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)'
1113 done
1114 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1115 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1116
1117 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1118 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1119 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:0
1120 dnl
1121 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1122 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:0
1123 dnl
1124 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1125 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:0
1126 ])
1127
1128 AT_CHECK([ovs-appctl revalidator/purge], [0])
1129 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1130  n_packets=6, n_bytes=360, actions=goto_table:1
1131  table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1132 OFPST_FLOW reply (OF1.2):
1133 ])
1134
1135 OVS_VSWITCHD_STOP
1136 AT_CLEANUP
1137
1138 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1139 OVS_VSWITCHD_START([dnl
1140    add-port br0 p1 -- set Interface p1 type=dummy
1141 ])
1142 ON_EXIT([kill `cat ovs-ofctl.pid`])
1143
1144 AT_CAPTURE_FILE([ofctl_monitor.log])
1145 AT_DATA([flows.txt], [dnl
1146 table=0 actions=resubmit(1,1)
1147 table=2 dl_src=10:11:11:11:11:11 actions=controller
1148 ])
1149 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1150 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1151
1152 dnl Hit table 0, Miss table 1, Dropped
1153 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1154
1155 for i in 1 2 3 ; do
1156     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)'
1157 done
1158 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1159
1160 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1161 ])
1162
1163 dnl Hit table 1, Dropped
1164 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1165
1166 for i in 1 2 3 ; do
1167     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)'
1168 done
1169 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1170
1171 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1172 ])
1173
1174 AT_CHECK([ovs-appctl revalidator/purge], [0])
1175 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1176  n_packets=6, n_bytes=360, actions=resubmit(1,1)
1177  table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1178 OFPST_FLOW reply (OF1.2):
1179 ])
1180
1181 OVS_VSWITCHD_STOP
1182 AT_CLEANUP
1183
1184 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1185 OVS_VSWITCHD_START([dnl
1186    add-port br0 p1 -- set Interface p1 type=dummy
1187 ])
1188 ON_EXIT([kill `cat ovs-ofctl.pid`])
1189
1190 AT_CAPTURE_FILE([ofctl_monitor.log])
1191 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1192
1193 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1194
1195 dnl Test that missed packets are droped
1196 for i in 1 2 3 ; do
1197     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)'
1198 done
1199 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1200
1201 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1202 ])
1203
1204 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1205 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1206 NXST_FLOW reply:
1207 ])
1208
1209 OVS_VSWITCHD_STOP
1210 AT_CLEANUP
1211
1212 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1213 OVS_VSWITCHD_START([dnl
1214    add-port br0 p1 -- set Interface p1 type=dummy
1215 ])
1216 ON_EXIT([kill `cat ovs-ofctl.pid`])
1217
1218 AT_CAPTURE_FILE([ofctl_monitor.log])
1219 AT_CHECK([ovs-ofctl del-flows br0])
1220 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1221 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1222
1223 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1224
1225 dnl Test that missed packets are droped
1226 for i in 1 2 3 ; do
1227     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)'
1228 done
1229 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1230
1231 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1232 ])
1233
1234 AT_CHECK([ovs-appctl revalidator/purge], [0])
1235 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1236  n_packets=3, n_bytes=180, actions=goto_table:1
1237 OFPST_FLOW reply (OF1.2):
1238 ])
1239
1240 OVS_VSWITCHD_STOP
1241 AT_CLEANUP
1242
1243 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1244 OVS_VSWITCHD_START([dnl
1245    add-port br0 p1 -- set Interface p1 type=dummy
1246 ])
1247 ON_EXIT([kill `cat ovs-ofctl.pid`])
1248
1249 AT_CAPTURE_FILE([ofctl_monitor.log])
1250 AT_CHECK([ovs-ofctl del-flows br0])
1251 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1252 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1253
1254 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1255
1256 dnl Test that missed packets are droped
1257 for i in 1 2 3 ; do
1258     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)'
1259 done
1260 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1261
1262 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1263 ])
1264
1265 AT_CHECK([ovs-appctl revalidator/purge], [0])
1266 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1267  n_packets=3, n_bytes=180, actions=resubmit(1,1)
1268 OFPST_FLOW reply (OF1.2):
1269 ])
1270
1271 OVS_VSWITCHD_STOP
1272 AT_CLEANUP
1273
1274 AT_SETUP([ofproto-dpif - controller])
1275 OVS_VSWITCHD_START([dnl
1276    add-port br0 p1 -- set Interface p1 type=dummy
1277 ])
1278 ON_EXIT([kill `cat ovs-ofctl.pid`])
1279
1280 AT_CAPTURE_FILE([ofctl_monitor.log])
1281 AT_DATA([flows.txt], [dnl
1282 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1283 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1284 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1285
1286 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1287 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)
1288 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)
1289 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1290 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)
1291 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1292 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1293 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1294 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
1295 ])
1296 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1297
1298 dnl Flow miss.
1299 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1300
1301 for i in 1 2 3 ; do
1302     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)'
1303 done
1304 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1305 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1306
1307 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1308 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1309 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:0
1310 dnl
1311 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1312 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:0
1313 dnl
1314 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1315 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:0
1316 ])
1317
1318 dnl Singleton controller action.
1319 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1320
1321 for i in 1 2 3 ; do
1322     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)'
1323 done
1324 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1325 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1326
1327 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1328 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1329 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:0
1330 dnl
1331 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1332 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:0
1333 dnl
1334 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1335 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:0
1336 ])
1337
1338 dnl Modified controller action.
1339 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1340
1341 for i in 1 2 3 ; do
1342     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)'
1343 done
1344 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1345 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1346
1347 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1348 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1349 tcp,dl_vlan=15,dl_vlan_pcp=0,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:0
1350 dnl
1351 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1352 tcp,dl_vlan=15,dl_vlan_pcp=0,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:0
1353 dnl
1354 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1355 tcp,dl_vlan=15,dl_vlan_pcp=0,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:0
1356 ])
1357
1358 dnl Modified VLAN controller action.
1359 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1360
1361 for i in 1 2 3; do
1362     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)'
1363 done
1364 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1365 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1366
1367 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1368 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1369 ip,dl_vlan=99,dl_vlan_pcp=1,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
1370 dnl
1371 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1372 ip,dl_vlan=99,dl_vlan_pcp=1,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
1373 dnl
1374 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1375 ip,dl_vlan=99,dl_vlan_pcp=1,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
1376 ])
1377
1378 dnl Checksum TCP.
1379 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1380
1381 for i in 1 ; do
1382     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)'
1383 done
1384 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1385 ovs-appctl -t ovs-ofctl exit
1386
1387 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1388 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1389 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:0
1390 dnl
1391 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1392 tcp,dl_vlan=80,dl_vlan_pcp=0,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:0
1393 dnl
1394 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)
1395 tcp,dl_vlan=80,dl_vlan_pcp=0,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:0
1396 dnl
1397 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)
1398 tcp,dl_vlan=80,dl_vlan_pcp=0,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:0
1399 dnl
1400 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)
1401 tcp,dl_vlan=80,dl_vlan_pcp=0,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:1a03
1402 dnl
1403 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)
1404 tcp,dl_vlan=80,dl_vlan_pcp=0,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:3205
1405 dnl
1406 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)
1407 tcp,dl_vlan=80,dl_vlan_pcp=0,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:31b8
1408 dnl
1409 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)
1410 tcp,dl_vlan=80,dl_vlan_pcp=0,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:316d
1411 dnl
1412 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)
1413 tcp,dl_vlan=80,dl_vlan_pcp=0,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:316d
1414 ])
1415
1416 dnl Checksum UDP.
1417 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1418
1419 for i in 1 ; do
1420     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'
1421 done
1422 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1423 ovs-appctl -t ovs-ofctl exit
1424
1425 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1426 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1427 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
1428 dnl
1429 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1430 udp,dl_vlan=80,dl_vlan_pcp=0,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
1431 dnl
1432 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)
1433 udp,dl_vlan=80,dl_vlan_pcp=0,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
1434 dnl
1435 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)
1436 udp,dl_vlan=80,dl_vlan_pcp=0,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
1437 dnl
1438 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)
1439 udp,dl_vlan=80,dl_vlan_pcp=0,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
1440 dnl
1441 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)
1442 udp,dl_vlan=80,dl_vlan_pcp=0,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
1443 dnl
1444 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)
1445 udp,dl_vlan=80,dl_vlan_pcp=0,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
1446 dnl
1447 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)
1448 udp,dl_vlan=80,dl_vlan_pcp=0,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
1449 dnl
1450 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)
1451 udp,dl_vlan=80,dl_vlan_pcp=0,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
1452 ])
1453
1454 dnl Modified ARP controller action.
1455 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1456
1457 for i in 1 2 3; do
1458     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)'
1459 done
1460
1461 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1462 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1463 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1464 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1465 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
1466 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1467 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
1468 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1469 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
1470 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1471 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
1472 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1473 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
1474 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1475 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
1476 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1477 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
1478 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1479 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
1480 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1481 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
1482 ])
1483
1484 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1485
1486 dnl Checksum SCTP.
1487 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1488
1489 for i in 1 ; do
1490     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'
1491 done
1492
1493 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1494 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1495 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1496 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1497 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1498 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
1499 dnl
1500 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 reg0=0x1,in_port=1 (via action) data_len=102 (unbuffered)
1501 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1502 dnl
1503 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)
1504 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1505 dnl
1506 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)
1507 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1508 dnl
1509 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)
1510 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1511 dnl
1512 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)
1513 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1514 dnl
1515 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)
1516 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1517 dnl
1518 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)
1519 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1520 dnl
1521 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)
1522 sctp,dl_vlan=80,dl_vlan_pcp=0,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
1523 ])
1524
1525 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1526  cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1527  cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1528  cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1529  cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1530  cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1531  cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1532  cookie=0x7, table=5, n_packets=3, n_bytes=218, 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)
1533  cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1534  cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1535  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1536  cookie=0xd, n_packets=3, n_bytes=180, 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
1537  n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1538 NXST_FLOW reply:
1539 ])
1540
1541 OVS_VSWITCHD_STOP
1542 AT_CLEANUP
1543
1544 AT_SETUP([ofproto-dpif - MPLS handling])
1545 OVS_VSWITCHD_START([dnl
1546    add-port br0 p1 -- set Interface p1 type=dummy
1547 ])
1548 ON_EXIT([kill `cat ovs-ofctl.pid`])
1549
1550 AT_CAPTURE_FILE([ofctl_monitor.log])
1551 AT_DATA([flows.txt], [dnl
1552 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
1553 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
1554 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
1555 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
1556 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
1557 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
1558 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
1559 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
1560 cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
1561 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1562 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1563 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
1564
1565 cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1566 cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1567 cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1568 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
1569 cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,OXM_OF_IPV4_SRC[[0..7]]),controller
1570 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
1571 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
1572
1573 cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1574 cookie=0xd table=1 arp actions=controller
1575
1576 cookie=0xdeadbeef table=2 dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
1577 cookie=0xd dl_src=60:66:66:66:00:09 actions=resubmit(,2),controller
1578 cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1579 cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1580
1581 cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1582 cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1583 cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1584
1585 cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1586 cookie=0xe dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1587 cookie=0xe dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1588
1589 cookie=0xe dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1590 cookie=0xe dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1591 cookie=0xe dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1592
1593 cookie=0xf dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1594 cookie=0xf dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1595 cookie=0xf dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1596
1597 cookie=0x5 dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1598 cookie=0x5 dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1599 cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
1600 ])
1601 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1602
1603 dnl Modified MPLS controller action.
1604 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1605
1606 for i in 1 2 3; do
1607     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)'
1608 done
1609 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1610 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1611
1612 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1613 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1614 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
1615 dnl
1616 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1617 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
1618 dnl
1619 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1620 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
1621 ])
1622
1623 dnl Modified MPLS controller action.
1624 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1625
1626 for i in 1 2 3; do
1627     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)'
1628 done
1629 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1630 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1631
1632 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1633 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1634 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
1635 dnl
1636 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1637 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
1638 dnl
1639 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1640 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
1641 ])
1642
1643 dnl Modified MPLS controller action.
1644 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1645
1646 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)
1647
1648 for i in 1 2 3; do
1649     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)'
1650 done
1651 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1652 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1653
1654 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1655 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1656 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
1657 dnl
1658 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1659 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
1660 dnl
1661 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1662 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
1663 ])
1664
1665 dnl Modified MPLS controller action.
1666 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1667
1668 for i in 1 2 3; do
1669     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))'
1670 done
1671 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1672 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1673
1674 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1675 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1676 mpls,dl_vlan=99,dl_vlan_pcp=7,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
1677 dnl
1678 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1679 mpls,dl_vlan=99,dl_vlan_pcp=7,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
1680 dnl
1681 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1682 mpls,dl_vlan=99,dl_vlan_pcp=7,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
1683 ])
1684
1685 dnl Modified MPLS controller action.
1686 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1687
1688 for i in 1 2 3; do
1689     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)'
1690 done
1691 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1692 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1693
1694 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1695 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1696 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
1697 dnl
1698 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1699 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
1700 dnl
1701 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1702 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
1703 ])
1704
1705 dnl Modified MPLS controller action.
1706 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1707
1708 for i in 1 2 3; do
1709     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)'
1710 done
1711 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1712 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1713
1714 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1715 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1716 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
1717 dnl
1718 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1719 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
1720 dnl
1721 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1722 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
1723 ])
1724
1725 dnl Modified MPLS controller action.
1726 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1727
1728 for i in 1 2 3; do
1729     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)'
1730 done
1731 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1732 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1733
1734 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1735 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1736 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
1737 dnl
1738 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1739 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
1740 dnl
1741 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1742 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
1743 ])
1744
1745 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1746
1747 dnl Modified MPLS controller action.
1748 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1749
1750 for i in 1 2 3; do
1751     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)'
1752 done
1753 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1754 ovs-appctl -t ovs-ofctl exit
1755
1756 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1757 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1758 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
1759 dnl
1760 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1761 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
1762 dnl
1763 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1764 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
1765 ])
1766
1767 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1768
1769 dnl Modified MPLS controller action.
1770 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1771
1772 for i in 1 2 3; do
1773     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)'
1774 done
1775 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1776 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1777
1778 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1779 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1780 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
1781 dnl
1782 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1783 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
1784 dnl
1785 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1786 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
1787 ])
1788
1789 dnl Modified MPLS actions.
1790 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1791
1792 for i in 1 2 3; do
1793     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)'
1794 done
1795 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1796 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1797
1798 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1799 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1800 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
1801 dnl
1802 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1803 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
1804 dnl
1805 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1806 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
1807 ])
1808
1809 dnl Modified MPLS ipv6 controller action.
1810 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1811
1812 for i in 1 2 3; do
1813     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)'
1814 done
1815 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1816 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1817
1818 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1819 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1820 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
1821 dnl
1822 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1823 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
1824 dnl
1825 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1826 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
1827 ])
1828
1829
1830 dnl Modified MPLS pop action.
1831 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1832 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)
1833 dnl             (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1834
1835 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1836
1837 for i in 1 2 3; do
1838     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'
1839 done
1840 #for i in 2 3; do
1841 #    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)'
1842 #done
1843 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1844 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1845
1846 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1847 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1848 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
1849 dnl
1850 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1851 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
1852 dnl
1853 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1854 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
1855 ])
1856
1857 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1858
1859 dnl Modified MPLS pop action.
1860 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1861 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)
1862 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1863 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1864 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1865
1866 for i in 1 2 3; do
1867     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'
1868 done
1869 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1870 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1871
1872 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1873 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1874 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
1875 dnl
1876 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1877 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
1878 dnl
1879 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1880 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
1881 ])
1882
1883 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1884
1885 dnl Modified MPLS pop action.
1886 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1887 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)
1888 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1889 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1890 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1891
1892 for i in 1 2 3; do
1893     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'
1894 done
1895 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1896 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1897
1898 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1899 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1900 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
1901 dnl
1902 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1903 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
1904 dnl
1905 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1906 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
1907 ])
1908
1909 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1910
1911 dnl Modified MPLS pop action.
1912 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1913 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)
1914 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1915 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1916 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1917
1918 for i in 1 2 3; do
1919     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'
1920 done
1921 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1922 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1923
1924 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1925 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1926 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
1927 dnl
1928 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1929 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
1930 dnl
1931 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1932 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
1933 ])
1934
1935 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1936
1937 dnl Modified MPLS pop action.
1938 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1939 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)
1940 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1941 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1942 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1943
1944 for i in 1 2 3; do
1945     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'
1946 done
1947 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1948 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1949
1950 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1951 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1952 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
1953 dnl
1954 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1955 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
1956 dnl
1957 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1958 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
1959 ])
1960
1961 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1962
1963 dnl Modified MPLS pop action.
1964 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1965 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)
1966 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1967 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1968 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1969
1970 for i in 1 2 3; do
1971     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'
1972 done
1973 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1974 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1975
1976 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1977 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1978 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.106,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:76db
1979 dnl
1980 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1981 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.106,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:76db
1982 dnl
1983 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1984 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.106,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:76db
1985 ])
1986
1987 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1988
1989 dnl Modified MPLS pop action.
1990 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1991 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)
1992 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1993 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1994 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1995
1996 for i in 1 2 3; do
1997     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'
1998 done
1999 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2000 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2001
2002 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2003 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2004 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,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
2005 dnl
2006 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2007 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,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
2008 dnl
2009 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2010 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,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
2011 ])
2012
2013 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2014
2015 dnl Modified MPLS pop action.
2016 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2017 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)
2018 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2019 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2020 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2021
2022 for i in 1 2 3; do
2023     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'
2024 done
2025 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2026 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2027
2028 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2029 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2030 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
2031 dnl
2032 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2033 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
2034 dnl
2035 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2036 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
2037 ])
2038
2039 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2040
2041 dnl Modified MPLS pop action.
2042 dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
2043 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)
2044 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2045
2046 for i in 1 2 3; do
2047     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'
2048 done
2049 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2050 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2051
2052 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2053 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2054 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
2055 dnl
2056 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2057 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
2058 dnl
2059 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2060 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
2061 ])
2062
2063 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2064
2065 dnl Modified MPLS pop action.
2066 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2067 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)
2068 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2069 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2070 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2071
2072 for i in 1 2 3; do
2073     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'
2074 done
2075 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2076 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2077
2078 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2079 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2080 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
2081 dnl
2082 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2083 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
2084 dnl
2085 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2086 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
2087 ])
2088
2089 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2090
2091 dnl Modified MPLS pop action.
2092 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2093 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)
2094 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2095 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2096 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2097
2098 for i in 1 2 3; do
2099     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'
2100 done
2101 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2102 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2103
2104 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2105 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2106 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
2107 dnl
2108 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2109 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
2110 dnl
2111 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2112 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
2113 ])
2114
2115 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2116
2117 dnl Modified MPLS pop action.
2118 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2119 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)
2120 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2121 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2122 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2123
2124 for i in 1 2 3; do
2125     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'
2126 done
2127 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2128 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2129
2130 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2131 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2132 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
2133 dnl
2134 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2135 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
2136 dnl
2137 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2138 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
2139 ])
2140
2141 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2142
2143 dnl Modified MPLS pop action.
2144 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2145 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)
2146 dnl             (label 20, exp 0, [S], ttl 31)
2147 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2148 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2149 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2150
2151 for i in 1 2 3; do
2152     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'
2153 done
2154 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2155 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2156
2157 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2158 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2159 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
2160 dnl
2161 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2162 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
2163 dnl
2164 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2165 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
2166 ])
2167
2168 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2169
2170 dnl Modified MPLS pop action.
2171 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2172 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)
2173 dnl             (label 20, exp 0, [S], ttl 31)
2174 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2175 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2176 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2177
2178 for i in 1 2 3; do
2179     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'
2180 done
2181 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2182 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2183
2184 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2185 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2186 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
2187 dnl
2188 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2189 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
2190 dnl
2191 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2192 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
2193 ])
2194
2195 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2196
2197 dnl Modified MPLS pop action.
2198 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2199 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)
2200 dnl             (label 20, exp 0, [S], ttl 31)
2201 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2202 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2203 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2204
2205 for i in 1 2 3; do
2206     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'
2207 done
2208 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2209 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2210
2211 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2212 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2213 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
2214 dnl
2215 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2216 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
2217 dnl
2218 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2219 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
2220 ])
2221
2222 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2223
2224 dnl Modified MPLS pop action.
2225 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2226 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)
2227 dnl             (label 20, exp 0, [S], ttl 31)
2228 dnl             (tos 0x0, ttl 254, 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 0x7744 (correct), seq 42:46, win 10000, length 4
2230 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2231
2232 for i in 1 2 3; do
2233     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'
2234 done
2235 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2236 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2237
2238 AT_CHECK([cat 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: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
2241 dnl
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: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
2244 dnl
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: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
2247 ])
2248
2249 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2250
2251 dnl Modified MPLS pop action.
2252 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2253 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)
2254 dnl             (label 20, exp 0, [S], ttl 31)
2255 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2256 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2257 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2258
2259 for i in 1 2 3; do
2260     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'
2261 done
2262
2263 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2264 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2265
2266 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2267 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2268 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
2269 dnl
2270 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2271 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
2272 dnl
2273 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2274 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
2275 ])
2276
2277 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2278
2279 dnl Modified MPLS pop action.
2280 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2281 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)
2282 dnl             (label 20, exp 0, [S], ttl 31)
2283 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2284 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2285 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2286
2287 for i in 1 2 3; do
2288     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'
2289 done
2290 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2291 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2292
2293 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2294 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2295 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
2296 dnl
2297 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2298 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
2299 dnl
2300 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2301 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
2302 ])
2303
2304 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2305
2306 dnl Modified MPLS pop action.
2307 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2308 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)
2309 dnl             (label 20, exp 0, ttl 31)
2310 dnl             (label 20, exp 0, [S], ttl 30)
2311 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2312 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2313 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2314
2315 for i in 1 2 3; do
2316     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'
2317 done
2318 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2319 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2320
2321 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2322 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2323 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
2324 dnl
2325 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2326 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
2327 dnl
2328 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2329 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
2330 ])
2331
2332 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2333
2334 dnl Modified MPLS pop action.
2335 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2336 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)
2337 dnl             (label 20, exp 0, ttl 31)
2338 dnl             (label 20, exp 0, [S], ttl 30)
2339 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2340 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2341 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2342
2343 for i in 1 2 3; do
2344     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'
2345 done
2346 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2347 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2348
2349 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2350 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2351 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
2352 dnl
2353 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2354 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
2355 dnl
2356 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2357 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
2358 ])
2359
2360 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2361
2362 dnl Modified MPLS pop action.
2363 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2364 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)
2365 dnl             (label 20, exp 0, ttl 31)
2366 dnl             (label 20, exp 0, [S], ttl 30)
2367 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2368 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2369 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2370
2371 for i in 1 2 3; do
2372     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'
2373 done
2374 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2375 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2376
2377 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2378 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2379 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
2380 dnl
2381 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2382 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
2383 dnl
2384 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2385 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
2386 ])
2387
2388 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2389
2390 dnl Modified MPLS pop action.
2391 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2392 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)
2393 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2394 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2395 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2396
2397 for i in 1 2 3; do
2398     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'
2399 done
2400 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2401 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2402
2403 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2404 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2405 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
2406 dnl
2407 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2408 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
2409 dnl
2410 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2411 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
2412 ])
2413
2414 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2415
2416 dnl Modified MPLS pop action.
2417 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2418 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)
2419 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2420 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2421 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2422
2423 for i in 1 2 3; do
2424     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'
2425 done
2426 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2427 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2428
2429 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2430 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2431 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
2432 dnl
2433 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2434 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
2435 dnl
2436 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2437 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
2438 ])
2439
2440 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2441
2442 dnl Modified MPLS pop action.
2443 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2444 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)
2445 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2446 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2447 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2448
2449 for i in 1 2 3; do
2450     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'
2451 done
2452 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2453 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2454
2455 AT_CHECK([STRIP_METADATA  ofctl_monitor.log], [0], [dnl
2456 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2457 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
2458 dnl
2459 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2460 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
2461 dnl
2462 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2463 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
2464 ])
2465
2466 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2467
2468 dnl Modified MPLS pop action.
2469 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2470 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)
2471 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2472 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2473 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2474
2475 for i in 1 2 3; do
2476     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'
2477 done
2478
2479 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2480 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2481
2482 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2483 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2484 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
2485 dnl
2486 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2487 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
2488 dnl
2489 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2490 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
2491 ])
2492
2493 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2494
2495 dnl Modified MPLS pop action.
2496 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2497 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)
2498 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2499 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2500 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2501
2502 for i in 1 2 3; do
2503     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'
2504 done
2505 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2506 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2507
2508 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2509 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2510 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
2511 dnl
2512 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2513 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
2514 dnl
2515 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2516 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
2517 ])
2518
2519 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2520
2521 dnl Modified MPLS pop action.
2522 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2523 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)
2524 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2525 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2526 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2527
2528 for i in 1 2 3; do
2529     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'
2530 done
2531
2532 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2533 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2534
2535 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2536 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2537 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
2538 dnl
2539 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2540 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
2541 dnl
2542 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2543 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
2544 ])
2545
2546 AT_CHECK([ovs-appctl revalidator/purge], [0])
2547 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2548  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
2549  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
2550  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
2551  cookie=0xa, n_packets=3, n_bytes=180, 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
2552  cookie=0xa, n_packets=3, n_bytes=180, 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
2553  cookie=0xa, n_packets=3, n_bytes=180, 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
2554  cookie=0xa, n_packets=3, n_bytes=180, 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
2555  cookie=0xa, n_packets=3, n_bytes=180, 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
2556  cookie=0xa, n_packets=3, n_bytes=180, 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
2557  cookie=0xa, n_packets=3, n_bytes=180, 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
2558  cookie=0xa, n_packets=3, n_bytes=180, 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
2559  cookie=0xa, n_packets=3, n_bytes=180, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2560  cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2561  cookie=0xc, n_packets=3, n_bytes=180, 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
2562  cookie=0xd, n_packets=3, n_bytes=180, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2563  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2564  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
2565  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
2566  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
2567  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,256,0,NXM_OF_IP_SRC[[0..7]]),CONTROLLER:65535
2568  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
2569  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
2570  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=resubmit(,2),CONTROLLER:65535
2571  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
2572  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
2573  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
2574  cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2575  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
2576  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
2577  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
2578  cookie=0xd, table=1, n_packets=3, n_bytes=168, arp actions=CONTROLLER:65535
2579  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
2580  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
2581  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
2582  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
2583  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
2584  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
2585  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
2586  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
2587  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
2588 NXST_FLOW reply:
2589 ])
2590
2591 OVS_VSWITCHD_STOP
2592 AT_CLEANUP
2593
2594 AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2595 OVS_VSWITCHD_START([dnl
2596    add-port br0 p1 -- set Interface p1 type=dummy
2597 ])
2598 ON_EXIT([kill `cat ovs-ofctl.pid`])
2599
2600 AT_CAPTURE_FILE([ofctl_monitor.log])
2601 AT_DATA([flows.txt], [dnl
2602 table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2603 table=1 ip,ip_dscp=8 actions=controller
2604 ])
2605 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2606
2607
2608 dnl Modified MPLS pop action.
2609 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2610 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)
2611 dnl             (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2612 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2613 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2614
2615 for i in 1 2 3; do
2616     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'
2617 done
2618 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2619 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2620
2621 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2622 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2623 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
2624 dnl
2625 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2626 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
2627 dnl
2628 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2629 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
2630 ])
2631
2632 AT_CHECK([ovs-appctl revalidator/purge], [0])
2633 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2634  n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
2635  table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
2636 OFPST_FLOW reply (OF1.2):
2637 ])
2638
2639 OVS_VSWITCHD_STOP
2640 AT_CLEANUP
2641
2642 AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
2643 OVS_VSWITCHD_START([dnl
2644    add-port br0 p1 -- set Interface p1 type=dummy
2645 ])
2646 ON_EXIT([kill `cat ovs-ofctl.pid`])
2647
2648 dnl N.B: The first (and only) action that accesses L3 data after the
2649 dnl pop_mpls action is present in write_actions. This exercises recirculation
2650 dnl triggered in write_actions due to a previous action not in write actions.
2651 AT_CAPTURE_FILE([ofctl_monitor.log])
2652 AT_DATA([flows.txt], [dnl
2653 mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
2654 ])
2655 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2656
2657 dnl Modified MPLS pop action.
2658 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2659 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)
2660 dnl             (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2661 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2662 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2663
2664 for i in 1 2 3; do
2665     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'
2666 done
2667 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2668 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2669
2670 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2671 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2672 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
2673 dnl
2674 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2675 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
2676 dnl
2677 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2678 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
2679 ])
2680
2681 AT_CHECK([ovs-appctl revalidator/purge], [0])
2682 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2683  n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
2684 OFPST_FLOW reply (OF1.2):
2685 ])
2686
2687 OVS_VSWITCHD_STOP
2688 AT_CLEANUP
2689
2690 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
2691 OVS_VSWITCHD_START([dnl
2692    add-port br0 p1 -- set Interface p1 type=dummy
2693 ])
2694 ON_EXIT([kill `cat ovs-ofctl.pid`])
2695
2696 AT_CAPTURE_FILE([ofctl_monitor.log])
2697 # A table-miss flow has priority 0 and no match
2698 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2699
2700 dnl Singleton controller action.
2701 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2702
2703 for i in 1 2 3 ; do
2704     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)'
2705 done
2706 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2707 ovs-appctl -t ovs-ofctl exit
2708
2709 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2710 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2711 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:0
2712 dnl
2713 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2714 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:0
2715 dnl
2716 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2717 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:0
2718 ])
2719
2720 AT_CHECK([ovs-appctl revalidator/purge], [0])
2721 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2722  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2723 NXST_FLOW reply:
2724 ])
2725
2726 OVS_VSWITCHD_STOP
2727 AT_CLEANUP
2728
2729
2730 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
2731 OVS_VSWITCHD_START([dnl
2732    add-port br0 p1 -- set Interface p1 type=dummy
2733 ])
2734 ON_EXIT([kill `cat ovs-ofctl.pid`])
2735
2736 AT_CAPTURE_FILE([ofctl_monitor.log])
2737 # A table-miss flow has priority 0 and no match
2738 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2739
2740 dnl Singleton controller action.
2741 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2742
2743 for i in 1 2 3 ; do
2744     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)'
2745 done
2746 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2747 ovs-appctl -t ovs-ofctl exit
2748
2749 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2750
2751 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2752 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2753 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:0
2754 dnl
2755 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2756 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:0
2757 dnl
2758 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2759 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:0
2760 ])
2761
2762 AT_CHECK([ovs-appctl revalidator/purge], [0])
2763 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2764  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2765 OFPST_FLOW reply (OF1.3):
2766 ])
2767
2768 OVS_VSWITCHD_STOP
2769 AT_CLEANUP
2770
2771 AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)])
2772 OVS_VSWITCHD_START([dnl
2773    add-port br0 p1 -- set Interface p1 type=dummy
2774 ])
2775 ON_EXIT([kill `cat ovs-ofctl.pid`])
2776
2777 ovs-appctl time/stop
2778
2779 AT_CAPTURE_FILE([ofctl_monitor.log])
2780 # A table-miss flow has priority 0 and no match
2781 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2782
2783 dnl Singleton controller action.
2784 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2785
2786 # Become slave (OF 1.3), which should disable everything except port status.
2787 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2788
2789 # Ensure that ovs-vswitchd gets a chance to reply before sending another command.
2790 ovs-appctl time/warp 500 100
2791
2792 # Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
2793 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
2794
2795 ovs-appctl time/warp 500 100
2796 for i in 1 2 3 ; do
2797     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)'
2798 done
2799 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2800 ovs-appctl -t ovs-ofctl exit
2801
2802 AT_CHECK([ovs-appctl revalidator/purge], [0])
2803 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2804 send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1
2805 OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1
2806 dnl
2807 send: OFPT_SET_ASYNC (OF1.3) (xid=0x2):
2808  master:
2809        PACKET_IN: (off)
2810      PORT_STATUS: (off)
2811     FLOW_REMOVED: (off)
2812
2813  slave:
2814        PACKET_IN: no_match
2815      PORT_STATUS: (off)
2816     FLOW_REMOVED: (off)
2817 dnl
2818 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2819 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:0
2820 dnl
2821 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2822 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:0
2823 dnl
2824 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2825 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:0
2826 ])
2827
2828 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2829
2830 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2831  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2832 OFPST_FLOW reply (OF1.3):
2833 ])
2834
2835 OVS_VSWITCHD_STOP
2836 AT_CLEANUP
2837
2838
2839 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)])
2840 OVS_VSWITCHD_START([dnl
2841    add-port br0 p1 -- set Interface p1 type=dummy
2842 ])
2843 ON_EXIT([kill `cat ovs-ofctl.pid`])
2844
2845 AT_CAPTURE_FILE([ofctl_monitor.log])
2846 # A table-miss flow has priority 0 and no match
2847 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2848
2849 dnl Singleton controller action.
2850 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2851
2852 for i in 1 2 3 ; do
2853     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)'
2854 done
2855 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2856 ovs-appctl -t ovs-ofctl exit
2857
2858 AT_CHECK([ovs-appctl revalidator/purge], [0])
2859 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2860 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2861 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:0
2862 dnl
2863 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2864 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:0
2865 dnl
2866 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2867 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:0
2868 ])
2869
2870 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2871
2872 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2873  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2874 OFPST_FLOW reply (OF1.4):
2875 ])
2876
2877 OVS_VSWITCHD_STOP
2878 AT_CLEANUP
2879
2880
2881 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
2882 OVS_VSWITCHD_START([dnl
2883    add-port br0 p1 -- set Interface p1 type=dummy
2884 ])
2885 ON_EXIT([kill `cat ovs-ofctl.pid`])
2886
2887 AT_CAPTURE_FILE([ofctl_monitor.log])
2888 AT_DATA([flows.txt], [dnl
2889 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
2890 table=1 actions=output(CONTROLLER),goto_table(2)
2891 table=2 actions=group:1234
2892 ])
2893 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2894 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flows br0 flows.txt])
2895
2896 dnl Singleton controller action.
2897 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2898
2899 for i in 1 2 3 ; do
2900     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)'
2901 done
2902 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2903 ovs-appctl -t ovs-ofctl exit
2904
2905 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2906
2907 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2908 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2909 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:0
2910 dnl
2911 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2912 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:0
2913 dnl
2914 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2915 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:0
2916 dnl
2917 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2918 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:0
2919 dnl
2920 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2921 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:0
2922 dnl
2923 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2924 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:0
2925 dnl
2926 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2927 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:0
2928 dnl
2929 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2930 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:0
2931 dnl
2932 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2933 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:0
2934 ])
2935
2936 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2937
2938 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2939  n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
2940  table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2
2941  table=2, n_packets=3, n_bytes=180, actions=group:1234
2942 OFPST_FLOW reply (OF1.3):
2943 ])
2944
2945 OVS_VSWITCHD_STOP
2946 AT_CLEANUP
2947
2948
2949 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.4)])
2950 OVS_VSWITCHD_START([dnl
2951    add-port br0 p1 -- set Interface p1 type=dummy
2952 ])
2953 ON_EXIT([kill `cat ovs-ofctl.pid`])
2954
2955 AT_CAPTURE_FILE([ofctl_monitor.log])
2956 AT_DATA([flows.txt], [dnl
2957 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
2958 table=1 actions=output(CONTROLLER),goto_table(2)
2959 table=2 actions=group:1234
2960 ])
2961 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2962 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flows br0 flows.txt])
2963
2964 dnl Singleton controller action.
2965 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2966
2967 for i in 1 2 3 ; do
2968     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)'
2969 done
2970 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2971 ovs-appctl -t ovs-ofctl exit
2972
2973 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2974
2975 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2976 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2977 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:0
2978 dnl
2979 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2980 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:0
2981 dnl
2982 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
2983 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:0
2984 dnl
2985 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2986 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:0
2987 dnl
2988 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2989 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:0
2990 dnl
2991 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
2992 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:0
2993 dnl
2994 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2995 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:0
2996 dnl
2997 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2998 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:0
2999 dnl
3000 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
3001 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:0
3002 ])
3003
3004 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3005
3006 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3007  n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3008  table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2
3009  table=2, n_packets=3, n_bytes=180, actions=group:1234
3010 OFPST_FLOW reply (OF1.4):
3011 ])
3012
3013 OVS_VSWITCHD_STOP
3014 AT_CLEANUP
3015
3016
3017 AT_SETUP([ofproto-dpif - ARP modification slow-path])
3018 OVS_VSWITCHD_START
3019 ADD_OF_PORTS([br0], [1], [2])
3020
3021 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
3022 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'
3023
3024 # Input some packets that should follow the arp modification slow-path.
3025 for i in 1 2 3; do
3026     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)'
3027 done
3028 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3029
3030 # Check the packets that were output.
3031 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
3032 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
3033 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
3034 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
3035 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
3036 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
3037 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
3038 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
3039 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
3040 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
3041 ])
3042
3043 OVS_VSWITCHD_STOP
3044 AT_CLEANUP
3045
3046 AT_SETUP([ofproto-dpif - VLAN handling])
3047 OVS_VSWITCHD_START(
3048   [set Bridge br0 fail-mode=standalone -- \
3049    add-port br0 p1                                  trunks=10,12 -- \
3050    add-port br0 p2                           tag=10              -- \
3051    add-port br0 p3                           tag=12              \
3052                    other-config:priority-tags=true               -- \
3053    add-port br0 p4                           tag=12              -- \
3054    add-port br0 p5 vlan_mode=native-tagged   tag=10              -- \
3055    add-port br0 p6 vlan_mode=native-tagged   tag=10 trunks=10,12 -- \
3056    add-port br0 p7 vlan_mode=native-untagged tag=12              -- \
3057    add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
3058                    other-config:priority-tags=true               -- \
3059    set Interface p1 type=dummy -- \
3060    set Interface p2 type=dummy -- \
3061    set Interface p3 type=dummy -- \
3062    set Interface p4 type=dummy -- \
3063    set Interface p5 type=dummy -- \
3064    set Interface p6 type=dummy -- \
3065    set Interface p7 type=dummy -- \
3066    set Interface p8 type=dummy --])
3067
3068 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
3069 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
3070 dnl actions.
3071 for tuple in \
3072         "100 none 0 drop" \
3073         "100 0    0 drop" \
3074         "100 0    1 drop" \
3075         "100 10   0 1,5,6,7,8,pop_vlan,2" \
3076         "100 10   1 1,5,6,7,8,pop_vlan,2" \
3077         "100 11   0 5,7" \
3078         "100 11   1 5,7" \
3079         "100 12   0 1,5,6,pop_vlan,3,4,7,8" \
3080         "100 12   1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3081         "1  none 0 drop" \
3082         "1  0    0 drop" \
3083         "1  0    1 drop" \
3084         "1  10   0 5,6,7,8,100,pop_vlan,2" \
3085         "1  10   1 5,6,7,8,100,pop_vlan,2" \
3086         "1  11   0 drop" \
3087         "1  11   1 drop" \
3088         "1  12   0 5,6,100,pop_vlan,3,4,7,8" \
3089         "1  12   1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3090         "2  none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3091         "2  0    0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3092         "2  0    1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
3093         "2  10   0 drop" \
3094         "2  10   1 drop" \
3095         "2  11   0 drop" \
3096         "2  11   1 drop" \
3097         "2  12   0 drop" \
3098         "2  12   1 drop" \
3099         "3  none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3100         "3  0    0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3101         "3  0    1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3102         "3  10   0 drop" \
3103         "3  10   1 drop" \
3104         "3  11   0 drop" \
3105         "3  11   1 drop" \
3106         "3  12   0 drop" \
3107         "3  12   1 drop" \
3108         "4  none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3109         "4  0    0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3110         "4  0    1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3111         "4  10   0 drop" \
3112         "4  10   1 drop" \
3113         "4  11   0 drop" \
3114         "4  11   1 drop" \
3115         "4  12   0 drop" \
3116         "4  12   1 drop" \
3117         "5  none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3118         "5  0    0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3119         "5  0    1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
3120         "5  10   0 1,6,7,8,100,pop_vlan,2" \
3121         "5  10   1 1,6,7,8,100,pop_vlan,2" \
3122         "5  11   0 7,100" \
3123         "5  11   1 7,100" \
3124         "5  12   0 1,6,100,pop_vlan,3,4,7,8" \
3125         "5  12   1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3126         "6  none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3127         "6  0    0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3128         "6  0    1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
3129         "6  10   0 1,5,7,8,100,pop_vlan,2" \
3130         "6  10   1 1,5,7,8,100,pop_vlan,2" \
3131         "6  11   0 drop" \
3132         "6  11   1 drop" \
3133         "6  12   0 1,5,100,pop_vlan,3,4,7,8" \
3134         "6  12   1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3135         "7  none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3136         "7  0    0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3137         "7  0    1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
3138         "7  10   0 1,5,6,8,100,pop_vlan,2" \
3139         "7  10   1 1,5,6,8,100,pop_vlan,2" \
3140         "7  11   0 5,100" \
3141         "7  11   1 5,100" \
3142         "7  12   0 1,5,6,100,pop_vlan,3,4,8" \
3143         "7  12   1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
3144         "8  none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3145         "8  0    0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3146         "8  0    1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3147         "8  10   0 1,5,6,7,100,pop_vlan,2" \
3148         "8  10   1 1,5,6,7,100,pop_vlan,2" \
3149         "8  11   0 drop" \
3150         "8  11   1 drop" \
3151         "8  12   0 1,5,6,100,pop_vlan,3,4,7" \
3152         "8  12   1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
3153 do
3154   set $tuple
3155   in_port=$1
3156   vlan=$2
3157   pcp=$3
3158   expected=$4
3159
3160   if test $vlan = none; then
3161     flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
3162   else
3163     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))"
3164   fi
3165
3166   echo "----------------------------------------------------------------------"
3167   echo "in_port=$in_port vlan=$vlan pcp=$pcp"
3168
3169   AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3170   actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3171
3172   AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3173   mv stdout expout
3174   AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3175 done
3176
3177 OVS_VSWITCHD_STOP
3178 AT_CLEANUP
3179
3180 AT_SETUP([ofproto-dpif - MPLS handling])
3181 OVS_VSWITCHD_START([dnl
3182    add-port br0 p1 -- set Interface p1 type=dummy
3183 ])
3184 ON_EXIT([kill `cat ovs-ofctl.pid`])
3185
3186 AT_CAPTURE_FILE([ofctl_monitor.log])
3187 AT_DATA([flows.txt], [dnl
3188 dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
3189 dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
3190 dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
3191 ])
3192 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3193
3194 dnl In this test, we push an MPLS tag to an ethernet packet.
3195 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3196
3197 for i in 1 2 3; do
3198     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)'
3199 done
3200 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3201 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3202
3203 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3204 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3205 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
3206 00000000  50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3207 00000010  01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3208 00000020  00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3209 00000030  00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3210 dnl
3211 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3212 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
3213 00000000  50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3214 00000010  01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3215 00000020  00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3216 00000030  00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3217 dnl
3218 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3219 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
3220 00000000  50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3221 00000010  01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3222 00000020  00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3223 00000030  00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3224 ])
3225
3226 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3227 dnl copied exactly, except for the BOS bit.
3228 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3229
3230 for i in 1 2 3; do
3231     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)'
3232 done
3233 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3234 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3235
3236 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3237 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3238 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
3239 00000000  50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3240 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3241 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3242 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3243 dnl
3244 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3245 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
3246 00000000  50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3247 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3248 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3249 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3250 dnl
3251 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3252 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
3253 00000000  50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3254 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3255 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3256 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3257 ])
3258
3259 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3260 dnl copied exactly, except for the BOS bit. The ethertype should be updated
3261 dnl to the MPLS ethertype of the MPLS push action which differs to that
3262 dnl of the input packet.
3263 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3264
3265 for i in 1 2 3; do
3266     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)'
3267 done
3268 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3269 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
3270
3271 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3272 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3273 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
3274 00000000  50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3275 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3276 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3277 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3278 dnl
3279 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3280 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
3281 00000000  50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3282 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3283 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3284 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3285 dnl
3286 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3287 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
3288 00000000  50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3289 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3290 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3291 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3292 ])
3293
3294 OVS_VSWITCHD_STOP
3295 AT_CLEANUP
3296
3297 AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
3298 OVS_VSWITCHD_START([dnl
3299    add-port br0 p1 -- set Interface p1 type=dummy
3300 ])
3301 ON_EXIT([kill `cat ovs-ofctl.pid`])
3302
3303 AT_CAPTURE_FILE([ofctl_monitor.log])
3304 AT_DATA([flows.txt], [dnl
3305 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
3306 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
3307 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
3308 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
3309 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
3310 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
3311 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
3312 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
3313 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
3314 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
3315 ])
3316 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3317
3318 dnl Modified MPLS controller action.
3319 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3320 dnl both of these in the final flow
3321 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3322
3323 for i in 1 2 3; do
3324     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)'
3325 done
3326 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3327 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3328
3329 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3330 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3331 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3332 00000000  50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3333 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3334 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3335 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3336 00000040  00 00 00 00
3337 dnl
3338 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3339 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3340 00000000  50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3341 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3342 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3343 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3344 00000040  00 00 00 00
3345 dnl
3346 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3347 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3348 00000000  50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3349 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3350 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3351 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3352 00000040  00 00 00 00
3353 ])
3354
3355 dnl Modified MPLS controller action.
3356 dnl In this test, the input packet in vlan-tagged, which should be stripped
3357 dnl before we push the MPLS and VLAN tags.
3358 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3359
3360 for i in 1 2 3; do
3361     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))'
3362 done
3363 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3364 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3365
3366 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3367 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3368 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3369 00000000  50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3370 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3371 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3372 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3373 dnl
3374 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3375 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3376 00000000  50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3377 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3378 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3379 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3380 dnl
3381 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3382 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3383 00000000  50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3384 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3385 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3386 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3387 ])
3388
3389 dnl Modified MPLS controller action.
3390 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3391 dnl both of these in the final flow
3392 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3393
3394 for i in 1 2 3; do
3395     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)'
3396 done
3397 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3398 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3399
3400 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3401 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3402 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3403 00000000  52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3404 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3405 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3406 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3407 00000040  00 00 00 00
3408 dnl
3409 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3410 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3411 00000000  52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3412 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3413 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3414 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3415 00000040  00 00 00 00
3416 dnl
3417 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3418 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3419 00000000  52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3420 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3421 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3422 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3423 00000040  00 00 00 00
3424 ])
3425
3426 dnl Modified MPLS controller action.
3427 dnl In this test, the input packet in vlan-tagged, which should be stripped
3428 dnl before we push the MPLS and VLAN tags.
3429 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3430
3431 for i in 1 2 3; do
3432     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))'
3433 done
3434 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3435 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3436
3437 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3438 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3439 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3440 00000000  50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3441 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3442 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3443 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3444 dnl
3445 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3446 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3447 00000000  50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3448 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3449 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3450 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3451 dnl
3452 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3453 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3454 00000000  50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3455 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3456 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3457 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3458 ])
3459
3460 dnl Modified MPLS controller action.
3461 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3462 dnl actions are reordered, so we see both of these in the final flow.
3463 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3464
3465 for i in 1 2 3; do
3466     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)'
3467 done
3468 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3469 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3470
3471 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3472 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3473 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3474 00000000  50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3475 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3476 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3477 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3478 00000040  00 00 00 00
3479 dnl
3480 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3481 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3482 00000000  50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3483 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3484 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3485 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3486 00000040  00 00 00 00
3487 dnl
3488 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3489 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3490 00000000  50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3491 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3492 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3493 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3494 00000040  00 00 00 00
3495 ])
3496
3497 dnl Modified MPLS controller action.
3498 dnl In this test, the input packet in vlan-tagged, which should be stripped
3499 dnl before we push the MPLS and VLAN tags.
3500 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3501
3502 for i in 1 2 3; do
3503     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))'
3504 done
3505 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3506 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3507
3508 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3509 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3510 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3511 00000000  50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3512 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3513 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3514 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3515 dnl
3516 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3517 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3518 00000000  50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3519 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3520 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3521 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3522 dnl
3523 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3524 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3525 00000000  50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3526 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3527 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3528 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3529 ])
3530
3531 dnl Modified MPLS controller action.
3532 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3533 dnl actions are reordered, so we see both of these in the final flow.
3534 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3535
3536 for i in 1 2 3; do
3537     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)'
3538 done
3539 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3540 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3541
3542 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3543 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3544 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3545 00000000  50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3546 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3547 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3548 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3549 00000040  00 00 00 00
3550 dnl
3551 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3552 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3553 00000000  50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3554 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3555 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3556 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3557 00000040  00 00 00 00
3558 dnl
3559 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3560 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3561 00000000  50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3562 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3563 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3564 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3565 00000040  00 00 00 00
3566 ])
3567
3568 dnl Modified MPLS controller action.
3569 dnl In this test, the input packet in vlan-tagged, which should be stripped
3570 dnl before we push the MPLS and VLAN tags.
3571 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
3572
3573 for i in 1 2 3; do
3574     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))'
3575 done
3576 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3577 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3578
3579 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3580 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3581 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3582 00000000  50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3583 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3584 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3585 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3586 dnl
3587 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3588 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3589 00000000  50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3590 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3591 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3592 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3593 dnl
3594 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3595 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3596 00000000  50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3597 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3598 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3599 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3600 ])
3601
3602 dnl Modified MPLS controller action.
3603 dnl In this test, the input packet in vlan-tagged, which should be stripped
3604 dnl before we push the MPLS and VLAN tags.
3605 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3606
3607 for i in 1 2 3; do
3608     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))'
3609 done
3610 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3611 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3612
3613 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3614 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3615 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3616 00000000  50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3617 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3618 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3619 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3620 dnl
3621 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3622 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3623 00000000  50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3624 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3625 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3626 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3627 dnl
3628 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3629 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3630 00000000  50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3631 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3632 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3633 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3634 ])
3635
3636 dnl Modified MPLS controller action.
3637 dnl In this test, the input packet in vlan-tagged, which should be modified
3638 dnl before we push MPLS and VLAN tags.
3639 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3640
3641 for i in 1 2 3; do
3642     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))'
3643 done
3644 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3645 ovs-appctl -t ovs-ofctl exit
3646
3647 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3648 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3649 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3650 00000000  50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3651 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3652 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3653 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3654 dnl
3655 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3656 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3657 00000000  50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3658 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3659 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3660 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3661 dnl
3662 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3663 mpls,dl_vlan=99,dl_vlan_pcp=1,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
3664 00000000  50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3665 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3666 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3667 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3668 ])
3669
3670 AT_CHECK([ovs-appctl revalidator/purge], [0])
3671 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3672  cookie=0xa, n_packets=3, n_bytes=180, 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
3673  cookie=0xa, n_packets=3, n_bytes=180, 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
3674  cookie=0xa, n_packets=3, n_bytes=180, 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
3675  cookie=0xa, n_packets=3, n_bytes=180, 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
3676  cookie=0xa, n_packets=3, n_bytes=180, 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
3677  cookie=0xa, n_packets=3, n_bytes=180, 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
3678  cookie=0xa, n_packets=3, n_bytes=180, 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
3679  cookie=0xa, n_packets=3, n_bytes=180, 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
3680  cookie=0xa, n_packets=3, n_bytes=180, 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
3681  cookie=0xa, n_packets=3, n_bytes=180, 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
3682 OFPST_FLOW reply (OF1.2):
3683 ])
3684
3685 OVS_VSWITCHD_STOP
3686 AT_CLEANUP
3687
3688 AT_SETUP([ofproto-dpif - fragment handling - trace])
3689 OVS_VSWITCHD_START
3690 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3691 AT_DATA([flows.txt], [dnl
3692 priority=75 tcp ip_frag=no    tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
3693 priority=75 tcp ip_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
3694 priority=50 tcp ip_frag=no              actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
3695 priority=50 tcp ip_frag=first           actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
3696 priority=50 tcp ip_frag=later           actions=output:6
3697 ])
3698 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3699
3700 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"
3701 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3702 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3703 later_flow="$base_flow,frag=later)"
3704
3705     # mode    no  first  later
3706 for tuple in \
3707     'normal    1     5      6' \
3708     'drop      1  drop   drop' \
3709     'nx-match  1     2      6'
3710 do
3711   set $tuple
3712   mode=$1
3713   no=$2
3714   first=$3
3715   later=$4
3716
3717   AT_CHECK([ovs-ofctl set-frags br0 $mode])
3718   for type in no first later; do
3719     eval flow=\$${type}_flow exp_output=\$$type
3720     printf "\n%s\n" "----$mode $type-----"
3721     AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3722     : > expout
3723     if test $mode = drop && test $type != no; then
3724         echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
3725         echo "Datapath actions: $exp_output" >> expout
3726     elif test $type = later; then
3727         echo "Datapath actions: $exp_output" >> expout
3728     else
3729         echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout
3730     fi
3731     AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
3732   done
3733 done
3734 OVS_VSWITCHD_STOP
3735 AT_CLEANUP
3736
3737 AT_SETUP([ofproto-dpif - fragment handling - upcall])
3738 OVS_VSWITCHD_START
3739 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3740 AT_DATA([flows.txt], [dnl
3741 priority=75 tcp ip_frag=no    tp_dst=80 actions=set_field:81->tcp_dst,output:1
3742 priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2
3743 priority=50 tcp ip_frag=no              actions=set_field:81->tcp_dst,output:4
3744 priority=50 tcp ip_frag=first           actions=set_field:81->tcp_dst,output:5
3745 priority=50 tcp ip_frag=later           actions=output:6
3746 ])
3747 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3748
3749 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"
3750 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3751 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3752 later_flow="$base_flow,frag=later)"
3753
3754 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3755
3756 mode=normal
3757
3758 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3759 for type in no first later; do
3760   eval flow=\$${type}_flow
3761   printf "\n%s\n" "----$mode $type-----"
3762
3763   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3764 done
3765
3766 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3767 flow-dump from non-dpdk interfaces:
3768 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3769 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),5
3770 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3771 ])
3772
3773 mode=drop
3774
3775 AT_CHECK([ovs-appctl revalidator/purge], [0])
3776 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3777 for type in no first later; do
3778   eval flow=\$${type}_flow
3779   printf "\n%s\n" "----$mode $type-----"
3780
3781   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3782 done
3783
3784 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3785 flow-dump from non-dpdk interfaces:
3786 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3787 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop
3788 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop
3789 ])
3790
3791 mode=nx-match
3792
3793 AT_CHECK([ovs-appctl revalidator/purge], [0])
3794 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3795 for type in no first later; do
3796   eval flow=\$${type}_flow
3797   printf "\n%s\n" "----$mode $type-----"
3798
3799   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3800 done
3801
3802 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3803 flow-dump from non-dpdk interfaces:
3804 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3805 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),2
3806 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3807 ])
3808
3809 OVS_VSWITCHD_STOP
3810 AT_CLEANUP
3811
3812 AT_SETUP([ofproto-dpif - fragment handling - actions])
3813 OVS_VSWITCHD_START
3814 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3815
3816 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])
3817 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3818 source field tcp_dst lacks correct prerequisites
3819 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3820 ])
3821
3822 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])
3823 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3824 destination field tcp_src lacks correct prerequisites
3825 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3826 ])
3827
3828 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr])
3829 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3830 set_field udp_src lacks correct prerequisities
3831 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3832 ])
3833
3834 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr])
3835 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3836 set_field udp_dst lacks correct prerequisities
3837 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3838 ])
3839
3840 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr])
3841 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3842 set_field sctp_src lacks correct prerequisities
3843 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3844 ])
3845
3846 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr])
3847 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3848 set_field sctp_dst lacks correct prerequisities
3849 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3850 ])
3851
3852 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])
3853 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3854 source field tcp_dst lacks correct prerequisites
3855 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3856 ])
3857
3858 AT_DATA([flows.txt], [dnl
3859 priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1
3860 ])
3861 AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt])
3862
3863 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3864
3865 mode=normal
3866
3867 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3868 for frag in 4000 6000 6008 4010; do
3869   printf "\n%s\n" "----$mode $frag-----"
3870
3871   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"])
3872 done
3873
3874 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3875 flow-dump from non-dpdk interfaces:
3876 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=33419), packets:0, bytes:0, used:never, actions:set(tcp(src=33322)),1
3877 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=33419), packets:0, bytes:0, used:never, actions:set(tcp(src=33322)),1
3878 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1
3879 ])
3880
3881 AT_CHECK([ovs-appctl revalidator/purge], [0])
3882 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3883 for frag in 4000 6000 6008 4010; do
3884   printf "\n%s\n" "----$mode $frag truncated transport header -----"
3885
3886   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"])
3887 done
3888
3889 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3890 flow-dump from non-dpdk interfaces:
3891 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3892 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3893 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3894 ])
3895
3896 AT_CHECK([ovs-appctl revalidator/purge], [0])
3897 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3898 for frag in 4000 6000 6001 4002; do
3899   printf "\n%s\n" "----$mode $frag missing transport header-----"
3900
3901   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"])
3902 done
3903
3904 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3905 flow-dump from non-dpdk interfaces:
3906 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3907 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3908 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3909 ])
3910
3911 OVS_VSWITCHD_STOP
3912 AT_CLEANUP
3913
3914 AT_SETUP([ofproto-dpif - exit])
3915 OVS_VSWITCHD_START
3916 ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14])
3917 AT_DATA([flows.txt], [dnl
3918 in_port=1 actions=output:10,exit,output:11
3919 in_port=2 actions=output:12,resubmit:1,output:12
3920 in_port=3 actions=output:13,resubmit:2,output:14
3921 ])
3922 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3923 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])
3924 AT_CHECK([tail -1 stdout], [0],
3925   [Datapath actions: 10
3926 ])
3927 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])
3928 AT_CHECK([tail -1 stdout], [0],
3929   [Datapath actions: 12,10
3930 ])
3931 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])
3932 AT_CHECK([tail -1 stdout], [0],
3933   [Datapath actions: 13,12,10
3934 ])
3935 OVS_VSWITCHD_STOP
3936 AT_CLEANUP
3937
3938
3939 AT_SETUP([ofproto-dpif - mirroring, select_all])
3940 OVS_VSWITCHD_START
3941 ADD_OF_PORTS([br0], 1, 2, 3)
3942 ovs-vsctl \
3943         set Bridge br0 mirrors=@m --\
3944         --id=@p3 get Port p3 --\
3945         --id=@m create Mirror name=mymirror select_all=true output_port=@p3
3946
3947 AT_DATA([flows.txt], [dnl
3948 in_port=1 actions=output:2
3949 in_port=2 actions=output:1
3950 ])
3951 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3952
3953 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)"
3954 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3955 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3956   [Datapath actions: 2,3
3957 ])
3958
3959 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)"
3960 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3961 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3962   [Datapath actions: 1,3
3963 ])
3964
3965 OVS_VSWITCHD_STOP
3966 AT_CLEANUP
3967
3968
3969 AT_SETUP([ofproto-dpif - mirroring, select_src])
3970 OVS_VSWITCHD_START
3971 ADD_OF_PORTS([br0], 1, 2, 3)
3972 ovs-vsctl \
3973         set Bridge br0 mirrors=@m --\
3974         --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
3975         --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
3976
3977 AT_DATA([flows.txt], [dnl
3978 in_port=1 actions=output:2
3979 in_port=2 actions=output:1
3980 ])
3981 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3982
3983 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)"
3984 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3985 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3986   [Datapath actions: 2,3
3987 ])
3988
3989 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)"
3990 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3991 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3992   [Datapath actions: 1
3993 ])
3994 OVS_VSWITCHD_STOP
3995 AT_CLEANUP
3996
3997 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
3998 OVS_VSWITCHD_START
3999 ADD_OF_PORTS([br0], 1, 2)
4000 ovs-vsctl \
4001         set Bridge br0 mirrors=@m --\
4002         --id=@p2 get Port p2 --\
4003         --id=@m create Mirror name=mymirror select_all=true output_port=@p2
4004
4005 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4006
4007 # "in_port" defaults to OFPP_NONE if it's not specified.
4008 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"
4009 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4010 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4011   [Datapath actions: 1,2
4012 ])
4013
4014 OVS_VSWITCHD_STOP
4015 AT_CLEANUP
4016
4017
4018 AT_SETUP([ofproto-dpif - mirroring, select_dst])
4019 OVS_VSWITCHD_START
4020 ADD_OF_PORTS([br0], 1, 2, 3)
4021 ovs-vsctl \
4022         set Bridge br0 mirrors=@m --\
4023         --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4024         --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
4025
4026 AT_DATA([flows.txt], [dnl
4027 in_port=1 actions=output:2
4028 in_port=2 actions=output:1
4029 ])
4030 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4031
4032 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)"
4033 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4034 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4035   [Datapath actions: 2,3
4036 ])
4037
4038 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)"
4039 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4040 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4041   [Datapath actions: 1
4042 ])
4043
4044 OVS_VSWITCHD_STOP
4045 AT_CLEANUP
4046
4047
4048 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
4049 OVS_VSWITCHD_START
4050 ADD_OF_PORTS([br0], 1, 2, 3)
4051 ovs-vsctl \
4052         set Bridge br0 mirrors=@m --\
4053         --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4054         --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
4055
4056 AT_DATA([flows.txt], [dnl
4057 in_port=1, actions=output:2
4058 ])
4059 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4060
4061 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)"
4062 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4063 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4064   [Datapath actions: 2
4065 ])
4066
4067 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))"
4068 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4069 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4070   [Datapath actions: 2
4071 ])
4072
4073 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))"
4074 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4075 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4076   [Datapath actions: 2,3
4077 ])
4078
4079 OVS_VSWITCHD_STOP
4080 AT_CLEANUP
4081
4082
4083 AT_SETUP([ofproto-dpif - mirroring, output_port])
4084 OVS_VSWITCHD_START
4085 ADD_OF_PORTS([br0], 1, 2, 3)
4086 ovs-vsctl \
4087         set Bridge br0 mirrors=@m --\
4088         --id=@p3 get Port p3 --\
4089         --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4090
4091 AT_DATA([flows.txt], [dnl
4092 in_port=1 actions=mod_vlan_vid:17,output:2
4093 in_port=2 actions=output:1
4094 ])
4095 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4096
4097 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)"
4098 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4099 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4100   [Datapath actions: push_vlan(vid=17,pcp=0),2,pop_vlan,3
4101 ])
4102
4103 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)"
4104 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4105 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4106   [Datapath actions: 1,3
4107 ])
4108
4109 OVS_VSWITCHD_STOP
4110 AT_CLEANUP
4111
4112 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
4113 OVS_VSWITCHD_START
4114 ADD_OF_PORTS([br0], 1, 2)
4115 ovs-vsctl \
4116         set Bridge br0 mirrors=@m --\
4117         --id=@m create Mirror name=mymirror select_all=true output_vlan=12
4118
4119 AT_DATA([flows.txt], [dnl
4120 in_port=1 actions=output:2
4121 in_port=2 actions=mod_vlan_vid:17,output:1
4122 ])
4123 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4124
4125 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)"
4126 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4127 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4128
4129 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
4130 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4131 mv stdout expout
4132 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4133
4134 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)"
4135 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4136 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4137
4138 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
4139 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4140 mv stdout expout
4141 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4142
4143 OVS_VSWITCHD_STOP
4144 AT_CLEANUP
4145
4146 # Two testcases below are for the ofproto/trace command
4147 # The first one tests all correct syntax:
4148 # ofproto/trace [dp_name] odp_flow [-generate|packet]
4149 # ofproto/trace br_name br_flow [-generate|packet]
4150 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
4151 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4152 ADD_OF_PORTS([br0], 1, 2, 3)
4153
4154 AT_DATA([flows.txt], [dnl
4155 in_port=1 actions=output:2
4156 in_port=2 actions=output:1
4157 ])
4158 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4159
4160 odp_flow="in_port(p1)"
4161 br_flow="in_port=1"
4162 # Test command: ofproto/trace odp_flow with in_port as a name.
4163 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4164 AT_CHECK([tail -1 stdout], [0], [dnl
4165 Datapath actions: 2
4166 ])
4167
4168 odp_flow="in_port(1)"
4169 # Test command: ofproto/trace odp_flow
4170 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4171 AT_CHECK([tail -1 stdout], [0], [dnl
4172 Datapath actions: 2
4173 ])
4174
4175 # Test command: ofproto/trace dp_name odp_flow
4176 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
4177 AT_CHECK([tail -1 stdout], [0], [dnl
4178 Datapath actions: 2
4179 ])
4180 # Test commmand: ofproto/trace br_name br_flow
4181 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4182 AT_CHECK([tail -1 stdout], [0], [dnl
4183 Datapath actions: 2
4184 ])
4185
4186 # Delete the inserted flows
4187 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
4188 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
4189
4190 # This section below tests the [-generate] option
4191 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
4192 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"
4193
4194 # Test command: ofproto/trace odp_flow
4195 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4196 # Check for no MAC learning entry
4197 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4198  port  VLAN  MAC                Age
4199 ])
4200
4201 # Test command: ofproto/trace br_name br_flow
4202 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4203 # Check for no MAC learning entry
4204 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4205  port  VLAN  MAC                Age
4206 ])
4207
4208 # Test command: ofproto/trace odp_flow -generate
4209 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
4210 # Check for the MAC learning entry
4211 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4212  port  VLAN  MAC                Age
4213     3     0  50:54:00:00:00:05    ?
4214 ])
4215
4216 # Test command: ofproto/trace dp_name odp_flow -generate
4217 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4218   "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
4219   -generate], [0], [stdout])
4220 # Check for both MAC learning entries
4221 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4222  port  VLAN  MAC                Age
4223     3     0  50:54:00:00:00:05    ?
4224     1     0  50:54:00:00:00:06    ?
4225 ])
4226
4227 # Test command: ofproto/trace br_name br_flow -generate
4228 AT_CHECK([ovs-appctl ofproto/trace br0 \
4229   "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
4230   -generate], [0], [stdout])
4231 # Check for both MAC learning entries.
4232 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4233  port  VLAN  MAC                Age
4234     3     0  50:54:00:00:00:05    ?
4235     1     0  50:54:00:00:00:06    ?
4236     2     0  50:54:00:00:00:07    ?
4237 ])
4238
4239 # This section beflow tests the [packet] option
4240 # The ovs-tcpundump of packets between port1 and port2
4241 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4242 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
4243
4244 # Construct the MAC learning table
4245 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4246   "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
4247   -generate], [0], [stdout])
4248
4249 # Construct the MAC learning table
4250 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4251   "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
4252   -generate], [0], [stdout])
4253
4254 # Test command: ofproto/trace odp_flow packet
4255 AT_CHECK([ovs-appctl ofproto/trace \
4256   "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4257 AT_CHECK([tail -1 stdout], [0], [dnl
4258 Datapath actions: 2
4259 ])
4260 AT_CHECK([head -n 2 stdout], [0], [dnl
4261 Bridge: br0
4262 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
4263 ])
4264
4265 # Test command: ofproto/trace dp_name odp_flow packet
4266 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4267   "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4268 AT_CHECK([tail -1 stdout], [0], [dnl
4269 Datapath actions: 2
4270 ])
4271 AT_CHECK([head -n 2 stdout], [0], [dnl
4272 Bridge: br0
4273 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
4274 ])
4275
4276 # Test command: ofproto/trace br_name br_flow packet
4277 AT_CHECK([ovs-appctl ofproto/trace br0 \
4278   "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
4279 AT_CHECK([tail -1 stdout], [0], [dnl
4280 Datapath actions: 1
4281 ])
4282 AT_CHECK([head -n 2 stdout], [0], [dnl
4283 Bridge: br0
4284 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
4285 ])
4286
4287 OVS_VSWITCHD_STOP
4288 AT_CLEANUP
4289
4290 # The second test tests the corner cases
4291 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
4292 OVS_VSWITCHD_START
4293 ADD_OF_PORTS([br0], 1, 2)
4294
4295 # Define flows
4296 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
4297 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
4298 # Define options
4299 generate="-generate"
4300 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4301
4302 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
4303 m4_foreach(
4304 [option],
4305 [[],
4306 ["$generate"],
4307 ["$pkt"]],
4308 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
4309   [2], [], [stderr])
4310 AT_CHECK([tail -2 stderr], [0], [dnl
4311 Cannot find the datapath
4312 ovs-appctl: ovs-vswitchd: server returned an error
4313 ])])
4314
4315 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
4316 m4_foreach(
4317 [option],
4318 [[],
4319 ["$generate"],
4320 ["$pkt"]],
4321 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
4322   [2], [], [stderr])
4323 AT_CHECK([tail -2 stderr], [0], [dnl
4324 Cannot find the datapath
4325 ovs-appctl: ovs-vswitchd: server returned an error
4326 ])])
4327
4328 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
4329 m4_foreach(
4330 [option],
4331 [[],
4332 ["$generate"],
4333 ["$pkt"]],
4334 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
4335   [2], [], [stderr])
4336 AT_CHECK([tail -2 stderr], [0], [dnl
4337 Cannot find the datapath
4338 ovs-appctl: ovs-vswitchd: server returned an error
4339 ])])
4340
4341 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
4342 m4_foreach(
4343 [option],
4344 [[],
4345 ["$generate"],
4346 ["$pkt"]],
4347 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
4348   [2], [], [stderr])
4349 AT_CHECK([tail -2 stderr], [0], [dnl
4350 Cannot find the datapath
4351 ovs-appctl: ovs-vswitchd: server returned an error
4352 ])])
4353
4354 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
4355 m4_foreach(
4356 [option],
4357 [[],
4358 ["$generate"],
4359 ["$pkt"]],
4360 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
4361   [2], [], [stderr])
4362 AT_CHECK([tail -2 stderr], [0], [dnl
4363 Unknown bridge name
4364 ovs-appctl: ovs-vswitchd: server returned an error
4365 ])])
4366
4367 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
4368 m4_foreach(
4369 [option],
4370 [[],
4371 ["$generate"],
4372 ["$pkt"]],
4373 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
4374   [2], [], [stderr])
4375 AT_CHECK([tail -2 stderr], [0], [dnl
4376 Must specify bridge name
4377 ovs-appctl: ovs-vswitchd: server returned an error
4378 ])])
4379
4380 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
4381 AT_CHECK([ovs-appctl ofproto/trace \
4382   ovs-dummy "$odp_flow" garbage_option],
4383   [2], [stdout],[stderr])
4384 AT_CHECK([tail -2 stderr], [0], [dnl
4385 Trailing garbage in packet data
4386 ovs-appctl: ovs-vswitchd: server returned an error
4387 ])
4388
4389 # Test incorrect command: ofproto/trace with 4 arguments
4390 AT_CHECK([ovs-appctl ofproto/trace \
4391   arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
4392 AT_CHECK([tail -2 stderr], [0], [dnl
4393 "ofproto/trace" command takes at most 3 arguments
4394 ovs-appctl: ovs-vswitchd: server returned an error
4395 ])
4396
4397 # Test incorrect command: ofproto/trace with 0 argument
4398 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
4399 AT_CHECK([tail -2 stderr], [0], [dnl
4400 "ofproto/trace" command requires at least 1 arguments
4401 ovs-appctl: ovs-vswitchd: server returned an error
4402 ])
4403
4404 OVS_VSWITCHD_STOP
4405 AT_CLEANUP
4406
4407 # The third test checks that the output of "ovs-dpctl -m" is valid to trace.
4408 AT_SETUP([ofproto-dpif - ofproto/trace from dpctl output])
4409 OVS_VSWITCHD_START([dnl
4410     set Open_vSwitch . other_config:max-idle=10000 \
4411     -- add-port br0 p1 -- set Interface p1 type=dummy])
4412
4413 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)'])
4414 ovs-appctl revalidator/wait
4415 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows1.txt])
4416
4417 odp_flow=`cat dp_flows1.txt`
4418 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
4419 Bridge: br0
4420 Flow: <cleared>
4421 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
4422
4423 Rule: table=254 cookie=0 priority=0,reg0=0x2
4424 OpenFlow actions=drop
4425
4426 Final flow: <cleared>
4427 Megaflow: <cleared>
4428 Datapath actions: drop
4429 ])
4430
4431 dnl Now, try again without megaflows:
4432 ovs-appctl upcall/disable-megaflows
4433
4434 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)'])
4435 ovs-appctl revalidator/wait
4436 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows2.txt])
4437
4438 odp_flow=`cat dp_flows2.txt`
4439 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
4440 Bridge: br0
4441 Flow: <cleared>
4442 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
4443
4444 Rule: table=254 cookie=0 priority=0,reg0=0x2
4445 OpenFlow actions=drop
4446
4447 Final flow: <cleared>
4448 Megaflow: <cleared>
4449 Datapath actions: drop
4450 ])
4451
4452 OVS_VSWITCHD_STOP
4453 AT_CLEANUP
4454
4455 AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
4456 OVS_VSWITCHD_START
4457 ADD_OF_PORTS([br0], 1, 2, 3)
4458
4459 AT_DATA([flows.txt], [dnl
4460 in_port=1 actions=output:2
4461 in_port=2 actions=output:1
4462 ])
4463 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4464
4465 AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
4466 AT_CHECK([tail -1 stdout], [0], [dnl
4467 Datapath actions: push_vlan(vid=123,pcp=0),2
4468 ])
4469
4470 OVS_VSWITCHD_STOP
4471 AT_CLEANUP
4472
4473
4474 m4_define([OFPROTO_TRACE],
4475   [flow="$2"
4476    AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
4477    actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4478    expected="$4"
4479    AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
4480      [0], [stdout])
4481    mv stdout expout
4482    AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
4483      [0], [expout])])
4484
4485 AT_SETUP([ofproto-dpif - MAC learning])
4486 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4487 ADD_OF_PORTS([br0], 1, 2, 3)
4488
4489 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)'
4490
4491 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
4492 OFPROTO_TRACE(
4493   [ovs-dummy],
4494   [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
4495   [-generate],
4496   [1,2,100])
4497
4498 # Check for the MAC learning entry.
4499 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4500  port  VLAN  MAC                Age
4501     3     0  50:54:00:00:00:05    ?
4502 ])
4503
4504 # Trace a packet arrival destined for the learned MAC.
4505 # (This will also learn a MAC.)
4506 OFPROTO_TRACE(
4507   [ovs-dummy],
4508   [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
4509   [-generate],
4510   [3])
4511
4512 # Check for both MAC learning entries.
4513 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4514  port  VLAN  MAC                Age
4515     3     0  50:54:00:00:00:05    ?
4516     1     0  50:54:00:00:00:06    ?
4517 ])
4518
4519 # Trace a packet arrival that updates the first learned MAC entry.
4520 OFPROTO_TRACE(
4521   [ovs-dummy],
4522   [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
4523   [-generate],
4524   [1,3,100])
4525
4526 # Check that the MAC learning entry was updated.
4527 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4528  port  VLAN  MAC                Age
4529     1     0  50:54:00:00:00:06    ?
4530     2     0  50:54:00:00:00:05    ?
4531 ])
4532
4533 # Add another bridge.
4534 AT_CHECK(
4535   [ovs-vsctl \
4536      -- add-br br1 \
4537      -- set bridge br1 datapath-type=dummy])
4538 ADD_OF_PORTS([br1], 4, 5)
4539
4540 # Trace some packet arrivals in br1 to create MAC learning entries there too.
4541 OFPROTO_TRACE(
4542   [ovs-dummy],
4543   [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
4544   [-generate],
4545   [5,101])
4546 OFPROTO_TRACE(
4547   [ovs-dummy],
4548   [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
4549   [-generate],
4550   [4,101])
4551
4552 # Check that the MAC learning entries were added.
4553 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4554  port  VLAN  MAC                Age
4555     4     0  50:54:00:00:00:06    ?
4556     5     0  50:54:00:00:00:07    ?
4557 ])
4558
4559 # Delete port p1 and see that its MAC learning entry disappeared, and
4560 # that the MAC learning entry for the same MAC was also deleted from br1.
4561 AT_CHECK([ovs-vsctl del-port p1])
4562 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4563  port  VLAN  MAC                Age
4564     2     0  50:54:00:00:00:05    ?
4565 ])
4566 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4567  port  VLAN  MAC                Age
4568     5     0  50:54:00:00:00:07    ?
4569 ])
4570
4571 OVS_VSWITCHD_STOP
4572 AT_CLEANUP
4573
4574 AT_SETUP([ofproto-dpif - MAC table overflow])
4575 OVS_VSWITCHD_START(
4576   [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
4577 ADD_OF_PORTS([br0], 1, 2, 3)
4578
4579 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)'
4580
4581 AT_CHECK([ovs-appctl time/stop])
4582
4583 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
4584 for i in 0 1 2 3 4 5 6 7 8 9; do
4585     OFPROTO_TRACE(
4586       [ovs-dummy],
4587       [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
4588       [-generate],
4589       [1,2,100])
4590     ovs-appctl time/warp 1000
4591 done
4592
4593 # Check for the MAC learning entries.
4594 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4595   [0], [dnl
4596     3     0  50:54:00:00:00:00
4597     3     0  50:54:00:00:00:01
4598     3     0  50:54:00:00:00:02
4599     3     0  50:54:00:00:00:03
4600     3     0  50:54:00:00:00:04
4601     3     0  50:54:00:00:00:05
4602     3     0  50:54:00:00:00:06
4603     3     0  50:54:00:00:00:07
4604     3     0  50:54:00:00:00:08
4605     3     0  50:54:00:00:00:09
4606  port  VLAN  MAC                Age
4607 ])
4608
4609 # Trace another ARP packet on another MAC.
4610 OFPROTO_TRACE(
4611   [ovs-dummy],
4612   [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
4613   [-generate],
4614   [1,2,100])
4615
4616 # Check that the new one chased the oldest one out of the table.
4617 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
4618   [0], [dnl
4619     3     0  50:54:00:00:00:01    ?
4620     3     0  50:54:00:00:00:02    ?
4621     3     0  50:54:00:00:00:03    ?
4622     3     0  50:54:00:00:00:04    ?
4623     3     0  50:54:00:00:00:05    ?
4624     3     0  50:54:00:00:00:06    ?
4625     3     0  50:54:00:00:00:07    ?
4626     3     0  50:54:00:00:00:08    ?
4627     3     0  50:54:00:00:00:09    ?
4628     3     0  50:54:00:00:00:10    ?
4629  port  VLAN  MAC                Age
4630 ])
4631 OVS_VSWITCHD_STOP
4632 AT_CLEANUP
4633
4634 AT_SETUP([ofproto-dpif - MAC table overflow fairness])
4635 OVS_VSWITCHD_START(
4636   [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
4637 ADD_OF_PORTS([br0], 1, 2, 3, 4, 5, 6)
4638
4639 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)'
4640
4641 AT_CHECK([ovs-appctl time/stop])
4642
4643 # Trace packets with 2 different source MACs arriving on each of the 5
4644 # ports, filling up the 10-entry learning table.
4645 for i in 0 1 2 3 4 5 6 7 8 9; do
4646     p=`expr $i / 2 + 1`
4647     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
4648     ovs-appctl time/warp 1000
4649 done
4650
4651 # Check for the MAC learning entries.
4652 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4653   [0], [dnl
4654     1     0  50:54:00:00:00:00
4655     1     0  50:54:00:00:00:01
4656     2     0  50:54:00:00:00:02
4657     2     0  50:54:00:00:00:03
4658     3     0  50:54:00:00:00:04
4659     3     0  50:54:00:00:00:05
4660     4     0  50:54:00:00:00:06
4661     4     0  50:54:00:00:00:07
4662     5     0  50:54:00:00:00:08
4663     5     0  50:54:00:00:00:09
4664  port  VLAN  MAC                Age
4665 ])
4666
4667 # Now trace 16 new MACs on another port.
4668 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
4669     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
4670     ovs-appctl time/warp 1000
4671 done
4672
4673 # Check the results.
4674 #
4675 # Our eviction algorithm on overflow is that an arbitrary (but deterministic)
4676 # one of the ports with the most learned MACs loses the least recently used
4677 # one.  Thus, the new port will end up with 3 MACs, 3 of the old ports with 1
4678 # MAC each, and the other 2 of the old ports with 2 MACs each.
4679 #
4680 # (If someone changes lib/heap.c to do something different with equal-priority
4681 # nodes, then the output below could change, but it would still follow the
4682 # rules explained above.)
4683 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4684   [0], [dnl
4685     1     0  50:54:00:00:00:01
4686     2     0  50:54:00:00:00:03
4687     3     0  50:54:00:00:00:04
4688     3     0  50:54:00:00:00:05
4689     4     0  50:54:00:00:00:07
4690     5     0  50:54:00:00:00:08
4691     5     0  50:54:00:00:00:09
4692     6     0  50:54:00:00:0d:ff
4693     6     0  50:54:00:00:0e:ff
4694     6     0  50:54:00:00:0f:ff
4695  port  VLAN  MAC                Age
4696 ])
4697 OVS_VSWITCHD_STOP
4698 AT_CLEANUP
4699
4700 # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS)
4701 #
4702 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
4703 #
4704 # IP_VERSION_TYPE is used in AT_SETUP
4705 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
4706   [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector])
4707   AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
4708   OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4709
4710   ON_EXIT([kill `cat test-sflow.pid`])
4711   AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
4712   AT_CAPTURE_FILE([sflow.log])
4713   SFLOW_PORT=`parse_listening_port < test-sflow.log`
4714   ovs-appctl time/stop
4715
4716   ADD_OF_PORTS([br0], 1, 2)
4717   ovs-vsctl \
4718      set Interface br0 options:ifindex=1002 -- \
4719      set Interface p1 options:ifindex=1004 -- \
4720      set Interface p2 options:ifindex=1003 -- \
4721      set Bridge br0 sflow=@sf -- \
4722      --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
4723        header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
4724
4725   dnl open with ARP packets to seed the bridge-learning.  The output
4726   dnl ifIndex numbers should be reported predictably after that.
4727   dnl Since we set sampling=1 we should see all of these packets
4728   dnl reported. Sorting the output by data-source and seqNo makes
4729   dnl it deterministic. Ensuring that we send at least two packets
4730   dnl into each port means we get to check the seq nos are
4731   dnl incrementing correctly.
4732   dnl because packets from different ports can be handled by separate
4733   dnl threads, put some sleeps
4734
4735   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)'
4736   sleep 1
4737   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)'
4738   sleep 1
4739   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)'
4740   sleep 1
4741   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)'
4742   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)'
4743
4744   dnl sleep long enough to get more than one counter sample
4745   dnl from each datasource so we can check sequence numbers
4746   ovs-appctl time/warp 3000 100
4747   OVS_VSWITCHD_STOP
4748   ovs-appctl -t test-sflow exit
4749
4750   AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
4751         /g']], [0], [dnl
4752 HEADER
4753         dgramSeqNo=1
4754         ds=127.0.0.1>2:1000
4755         fsSeqNo=1
4756         in_vlan=0
4757         in_priority=0
4758         out_vlan=0
4759         out_priority=0
4760         meanSkip=1
4761         samplePool=1
4762         dropEvents=0
4763         in_ifindex=1004
4764         in_format=0
4765         out_ifindex=2
4766         out_format=2
4767         hdr_prot=1
4768         pkt_len=64
4769         stripped=4
4770         hdr_len=60
4771         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-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4772 HEADER
4773         dgramSeqNo=1
4774         ds=127.0.0.1>2:1000
4775         fsSeqNo=2
4776         in_vlan=0
4777         in_priority=0
4778         out_vlan=0
4779         out_priority=0
4780         meanSkip=1
4781         samplePool=2
4782         dropEvents=0
4783         in_ifindex=1003
4784         in_format=0
4785         out_ifindex=2
4786         out_format=2
4787         hdr_prot=1
4788         pkt_len=64
4789         stripped=4
4790         hdr_len=60
4791         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-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4792 HEADER
4793         dgramSeqNo=1
4794         ds=127.0.0.1>2:1000
4795         fsSeqNo=3
4796         in_vlan=0
4797         in_priority=0
4798         out_vlan=0
4799         out_priority=0
4800         meanSkip=1
4801         samplePool=3
4802         dropEvents=0
4803         in_ifindex=1004
4804         in_format=0
4805         out_ifindex=1003
4806         out_format=0
4807         hdr_prot=1
4808         pkt_len=64
4809         stripped=4
4810         hdr_len=60
4811         hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-01-C0-A8-00-02-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4812 HEADER
4813         dgramSeqNo=1
4814         ds=127.0.0.1>2:1000
4815         fsSeqNo=4
4816         in_vlan=0
4817         in_priority=0
4818         out_vlan=0
4819         out_priority=0
4820         meanSkip=1
4821         samplePool=4
4822         dropEvents=0
4823         in_ifindex=1003
4824         in_format=0
4825         out_ifindex=1004
4826         out_format=0
4827         hdr_prot=1
4828         pkt_len=64
4829         stripped=4
4830         hdr_len=60
4831         hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-02-C0-A8-00-01-00-00-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4832 HEADER
4833         dgramSeqNo=1
4834         ds=127.0.0.1>2:1000
4835         fsSeqNo=5
4836         in_vlan=0
4837         in_priority=0
4838         out_vlan=0
4839         out_priority=0
4840         meanSkip=1
4841         samplePool=5
4842         dropEvents=0
4843         in_ifindex=1003
4844         in_format=0
4845         out_ifindex=1004
4846         out_format=0
4847         hdr_prot=1
4848         pkt_len=64
4849         stripped=4
4850         hdr_len=60
4851         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-00-00-00-00-00-00
4852 ])
4853
4854   AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -18 | sed 's/ /\
4855         /g']], [0], [dnl
4856 IFCOUNTERS
4857         dgramSeqNo=2
4858         ds=127.0.0.1>0:1002
4859         csSeqNo=1
4860         ifindex=1002
4861         type=6
4862         ifspeed=100000000
4863         direction=0
4864         status=0
4865         in_octets=0
4866         in_unicasts=0
4867         in_multicasts=0
4868         in_broadcasts=4294967295
4869         in_discards=0
4870         in_errors=0
4871         in_unknownprotos=4294967295
4872         out_octets=120
4873         out_unicasts=2
4874         out_multicasts=4294967295
4875         out_broadcasts=4294967295
4876         out_discards=0
4877         out_errors=0
4878         promiscuous=0
4879 IFCOUNTERS
4880         dgramSeqNo=2
4881         ds=127.0.0.1>0:1003
4882         csSeqNo=1
4883         ifindex=1003
4884         type=6
4885         ifspeed=100000000
4886         direction=0
4887         status=0
4888         in_octets=138
4889         in_unicasts=3
4890         in_multicasts=0
4891         in_broadcasts=4294967295
4892         in_discards=0
4893         in_errors=0
4894         in_unknownprotos=4294967295
4895         out_octets=120
4896         out_unicasts=2
4897         out_multicasts=4294967295
4898         out_broadcasts=4294967295
4899         out_discards=0
4900         out_errors=0
4901         promiscuous=0
4902 IFCOUNTERS
4903         dgramSeqNo=2
4904         ds=127.0.0.1>0:1004
4905         csSeqNo=1
4906         ifindex=1004
4907         type=6
4908         ifspeed=100000000
4909         direction=0
4910         status=0
4911         in_octets=84
4912         in_unicasts=2
4913         in_multicasts=0
4914         in_broadcasts=4294967295
4915         in_discards=0
4916         in_errors=0
4917         in_unknownprotos=4294967295
4918         out_octets=180
4919         out_unicasts=3
4920         out_multicasts=4294967295
4921         out_broadcasts=4294967295
4922         out_discards=0
4923         out_errors=0
4924         promiscuous=0
4925 IFCOUNTERS
4926         dgramSeqNo=3
4927         ds=127.0.0.1>0:1002
4928         csSeqNo=2
4929         ifindex=1002
4930         type=6
4931         ifspeed=100000000
4932         direction=0
4933         status=0
4934         in_octets=0
4935         in_unicasts=0
4936         in_multicasts=0
4937         in_broadcasts=4294967295
4938         in_discards=0
4939         in_errors=0
4940         in_unknownprotos=4294967295
4941         out_octets=120
4942         out_unicasts=2
4943         out_multicasts=4294967295
4944         out_broadcasts=4294967295
4945         out_discards=0
4946         out_errors=0
4947         promiscuous=0
4948 IFCOUNTERS
4949         dgramSeqNo=3
4950         ds=127.0.0.1>0:1003
4951         csSeqNo=2
4952         ifindex=1003
4953         type=6
4954         ifspeed=100000000
4955         direction=0
4956         status=0
4957         in_octets=138
4958         in_unicasts=3
4959         in_multicasts=0
4960         in_broadcasts=4294967295
4961         in_discards=0
4962         in_errors=0
4963         in_unknownprotos=4294967295
4964         out_octets=120
4965         out_unicasts=2
4966         out_multicasts=4294967295
4967         out_broadcasts=4294967295
4968         out_discards=0
4969         out_errors=0
4970         promiscuous=0
4971 IFCOUNTERS
4972         dgramSeqNo=3
4973         ds=127.0.0.1>0:1004
4974         csSeqNo=2
4975         ifindex=1004
4976         type=6
4977         ifspeed=100000000
4978         direction=0
4979         status=0
4980         in_octets=84
4981         in_unicasts=2
4982         in_multicasts=0
4983         in_broadcasts=4294967295
4984         in_discards=0
4985         in_errors=0
4986         in_unknownprotos=4294967295
4987         out_octets=180
4988         out_unicasts=3
4989         out_multicasts=4294967295
4990         out_broadcasts=4294967295
4991         out_discards=0
4992         out_errors=0
4993         promiscuous=0
4994 OPENFLOWPORT
4995         datapath_id=18364758544493064720
4996         port_no=1
4997 OPENFLOWPORT
4998         datapath_id=18364758544493064720
4999         port_no=1
5000 OPENFLOWPORT
5001         datapath_id=18364758544493064720
5002         port_no=2
5003 OPENFLOWPORT
5004         datapath_id=18364758544493064720
5005         port_no=2
5006 OPENFLOWPORT
5007         datapath_id=18364758544493064720
5008         port_no=65534
5009 OPENFLOWPORT
5010         datapath_id=18364758544493064720
5011         port_no=65534
5012 PORTNAME
5013         portName=br0
5014 PORTNAME
5015         portName=br0
5016 PORTNAME
5017         portName=p1
5018 PORTNAME
5019         portName=p1
5020 PORTNAME
5021         portName=p2
5022 PORTNAME
5023         portName=p2
5024 ])
5025   AT_CLEANUP])
5026
5027 CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4])
5028 CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6])
5029
5030 dnl Test sFlow LAG structures
5031 AT_SETUP([ofproto-dpif - sFlow LACP structures])
5032 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
5033 OVS_VSWITCHD_START([dnl
5034                     add-bond br0 bond p1 p2 --                          \
5035                     set Port bond lacp=active bond-mode=active-backup   \
5036                     other_config:lacp-time="fast"                       \
5037                     other_config:lacp-system-id=11:22:33:44:55:66       \
5038                     other_config:lacp-system-priority=54321 --          \
5039                     set Interface p1 type=dummy                         \
5040                     other_config:lacp-port-id=11                        \
5041                     other_config:lacp-port-priority=111                 \
5042                     other_config:lacp-aggregation-key=3333 --           \
5043                     set Interface p2 type=dummy                         \
5044                     other_config:lacp-port-id=22                        \
5045                     other_config:lacp-port-priority=222                 \
5046                     other_config:lacp-aggregation-key=3333 ])
5047
5048 ON_EXIT([kill `cat test-sflow.pid`])
5049 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5050 AT_CAPTURE_FILE([sflow.log])
5051 SFLOW_PORT=`parse_listening_port < test-sflow.log`
5052
5053 ovs-appctl time/stop
5054
5055 ovs-vsctl \
5056       set Interface p1 options:ifindex=1003 --                  \
5057       set Bridge br0 sflow=@sf --                               \
5058       --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\"   \
5059       header=128 sampling=1 polling=1
5060
5061 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5062 AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
5063 AT_CHECK([ovs-appctl revalidator/purge], [0])
5064 OVS_VSWITCHD_STOP
5065 ovs-appctl -t test-sflow exit
5066 AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
5067         /g']], [0], [dnl
5068 LACPCOUNTERS
5069         sysID=11:22:33:44:55:66
5070         partnerID=00:00:00:00:00:00
5071         aggID=3333
5072         actorAdmin=0x7
5073         actorOper=0xbf
5074         partnerAdmin=0x0
5075         partnerOper=0x2
5076         LACPUDsRx=0
5077         markerPDUsRx=4294967295
5078         markerRespPDUsRx=4294967295
5079         unknownRx=4294967295
5080         illegalRx=0
5081         LACPUDsTx=1
5082         markerPDUsTx=4294967295
5083         markerRespPDUsTx=4294967295
5084 ])
5085
5086 AT_CLEANUP
5087
5088 # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
5089 #
5090 # Test that basic NetFlow reports flow statistics correctly:
5091 # The initial packet of a flow are correctly accounted.
5092 # Later packets within a flow are correctly accounted.
5093 # Flow actions changing (in this case, due to MAC learning)
5094 # cause a record to be sent.
5095 #
5096 # IP_VERSION_TYPE is used in AT_SETUP
5097 m4_define([CHECK_NETFLOW_EXPIRATION],
5098   [AT_SETUP([ofproto-dpif - NetFlow flow expiration - $2 collector])
5099   OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5100   ADD_OF_PORTS([br0], 1, 2)
5101
5102   ovs-appctl time/stop
5103   ON_EXIT([kill `cat test-netflow.pid`])
5104   AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
5105   AT_CAPTURE_FILE([netflow.log])
5106   NETFLOW_PORT=`parse_listening_port < test-netflow.log`
5107
5108   ovs-vsctl \
5109      set Bridge br0 netflow=@nf -- \
5110      --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5111        engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
5112
5113   for delay in 1000 30000; do
5114       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)'
5115       sleep 1  # ensure the order in which these two packets are processed
5116       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)'
5117
5118       ovs-appctl time/warp $delay
5119   done
5120
5121   ovs-appctl time/warp 6000
5122   ovs-appctl revalidator/wait
5123   OVS_VSWITCHD_STOP
5124   ovs-appctl -t test-netflow exit
5125
5126   AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
5127
5128   AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
5129
5130   combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
5131   separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
5132   AT_CHECK([test $separate = 2 || test $combined = 1], [0])
5133
5134   AT_CLEANUP])
5135
5136 CHECK_NETFLOW_EXPIRATION([127.0.0.1], [IPv4])
5137 CHECK_NETFLOW_EXPIRATION([[[::1]]], [IPv6])
5138
5139 # CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
5140 #
5141 # Test that basic NetFlow reports active expirations correctly.
5142 #
5143 # IP_VERSION_TYPE is used in AT_SETUP
5144 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
5145   [AT_SETUP([ofproto-dpif - NetFlow active expiration - $2 collector])
5146
5147   OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5148   ADD_OF_PORTS([br0], 1, 2)
5149
5150   ON_EXIT([kill `cat test-netflow.pid`])
5151   AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
5152   AT_CAPTURE_FILE([netflow.log])
5153   NETFLOW_PORT=`parse_listening_port < test-netflow.log`
5154
5155   ovs-vsctl \
5156      set Bridge br0 netflow=@nf -- \
5157      --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5158        engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
5159
5160   AT_CHECK([ovs-appctl time/stop])
5161   n=1
5162   while test $n -le 60; do
5163       n=`expr $n + 1`
5164
5165       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)'
5166       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)'
5167
5168       ovs-appctl time/warp 1000
5169   done
5170
5171   ovs-appctl time/warp 10000
5172
5173   ovs-appctl revalidator/wait
5174   OVS_VSWITCHD_STOP
5175   ovs-appctl -t test-netflow exit
5176
5177   # Count the number of reported packets:
5178   # - From source to destination before MAC learning kicks in (just one).
5179   # - From source to destination after that.
5180   # - From destination to source.
5181   n_learn=0
5182   n_in=0
5183   n_out=0
5184   n_other=0
5185   n_recs=0
5186   none=0
5187   while read line; do
5188       pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
5189       case $pkts in
5190            [[0-9]]*) ;;
5191        *) continue ;;
5192       esac
5193
5194       case $line in
5195           "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
5196               counter=n_learn
5197           ;;
5198       "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
5199           counter=n_in
5200           ;;
5201       "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
5202           counter=n_out
5203           ;;
5204       *)
5205           counter=n_other
5206           ;;
5207       esac
5208       eval $counter=\`expr \$$counter + \$pkts\`
5209       n_recs=`expr $n_recs + 1`
5210   done < netflow.log
5211
5212   # There should be exactly 1 MAC learning packet,
5213   # exactly 59 other packets in that direction,
5214   # and exactly 60 packets in the other direction.
5215   AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
5216 ])
5217
5218   AT_CLEANUP])
5219
5220 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1], [IPv4])
5221 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]], [IPv6])
5222
5223 AT_SETUP([ofproto-dpif - flow stats])
5224 OVS_VSWITCHD_START
5225 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
5226 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
5227
5228 ovs-appctl time/stop
5229
5230 for i in `seq 1 10`; do
5231     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)'
5232 done
5233
5234 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
5235 AT_CHECK([ovs-appctl revalidator/purge], [0])
5236 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5237 AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
5238  cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
5239  cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
5240 ])
5241 OVS_VSWITCHD_STOP
5242 AT_CLEANUP
5243
5244 AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
5245 OVS_VSWITCHD_START
5246 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
5247 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
5248
5249 ovs-appctl time/stop
5250
5251 for i in `seq 1 10`; do
5252     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)'
5253 done
5254
5255 ovs-appctl time/warp 100
5256 AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
5257 ovs-appctl time/warp 1000
5258
5259 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5260 AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
5261  cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
5262  cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
5263 ])
5264 OVS_VSWITCHD_STOP
5265 AT_CLEANUP
5266
5267 AT_SETUP([ofproto-dpif - idle_age and hard_age increase over time])
5268 OVS_VSWITCHD_START
5269
5270 # get_ages DURATION HARD IDLE
5271 #
5272 # Fetch the flow duration, hard age, and idle age into the variables
5273 # whose names are given as arguments.  Rounds DURATION down to the
5274 # nearest integer.  If hard_age doesn't appear in the output, sets
5275 # HARD to "none".  If idle_age doesn't appear in the output, sets IDLE
5276 # to 0.
5277 get_ages () {
5278     AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5279
5280     duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
5281     AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
5282     AS_VAR_COPY([$1], [duration])
5283
5284     hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
5285     if test X"$hard" = X; then
5286         hard=none
5287     else
5288         AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
5289     fi
5290     AS_VAR_COPY([$2], [hard])
5291
5292     idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
5293     if test X"$idle" = X; then
5294         idle=0
5295     else
5296         AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
5297     fi
5298     AS_VAR_COPY([$3], [idle])
5299 }
5300
5301 # Add a flow and get its initial hard and idle age.
5302 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
5303 get_ages duration1 hard1 idle1
5304
5305 ovs-appctl time/stop
5306 # Warp time forward by 10 seconds, then modify the flow's actions.
5307 ovs-appctl time/warp 10000
5308 get_ages duration2 hard2 idle2
5309 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
5310
5311 # Warp time forward by 10 seconds.
5312 ovs-appctl time/warp 10000
5313 get_ages duration3 hard3 idle3
5314
5315 # Warp time forward 10 more seconds, then pass some packets through the flow,
5316 # then warp forward a few more times because idle times are only updated
5317 # occasionally.
5318 ovs-appctl time/warp 10000
5319 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)'
5320 ovs-appctl time/warp 3000 1000
5321 sleep 1
5322 get_ages duration4 hard4 idle4
5323
5324 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
5325 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
5326 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
5327
5328 # Duration should increase steadily over time.
5329 AT_CHECK([test $duration1 -lt $duration2])
5330 AT_CHECK([test $duration2 -lt $duration3])
5331 AT_CHECK([test $duration3 -lt $duration4])
5332
5333 # Hard age should be "none" initially because it's the same as flow_duration,
5334 # then it should increase.
5335 AT_CHECK([test $hard1 = none])
5336 AT_CHECK([test $hard2 = none])
5337 AT_CHECK([test $hard3 != none])
5338 AT_CHECK([test $hard4 != none])
5339 AT_CHECK([test $hard3 -lt $hard4])
5340
5341 # Idle age should increase from 1 to 2 to 3, then decrease.
5342 AT_CHECK([test $idle1 -lt $idle2])
5343 AT_CHECK([test $idle2 -lt $idle3])
5344 AT_CHECK([test $idle3 -gt $idle4])
5345
5346 # Check some invariant relationships.
5347 AT_CHECK([test $duration1 = $idle1])
5348 AT_CHECK([test $duration2 = $idle2])
5349 AT_CHECK([test $duration3 = $idle3])
5350 AT_CHECK([test $idle3 -gt $hard3])
5351 AT_CHECK([test $idle4 -lt $hard4])
5352 AT_CHECK([test $hard4 -lt $duration4])
5353
5354 OVS_VSWITCHD_STOP
5355 AT_CLEANUP
5356
5357 AT_SETUP([ofproto-dpif - fin_timeout])
5358 OVS_VSWITCHD_START
5359 ovs-appctl time/stop
5360 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
5361 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5362 [NXST_FLOW reply:
5363  idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5364 ])
5365
5366 # Check that a TCP SYN packet does not change the timeout.  (Because
5367 # flow stats updates are mainly what implements the fin_timeout
5368 # feature, we warp forward a couple of times to ensure that flow stats
5369 # run before re-checking the flow table.)
5370 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
5371 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5372 warped
5373 ])
5374 AT_CHECK([ovs-appctl revalidator/purge], [0])
5375 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5376 [NXST_FLOW reply:
5377  n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5378 ])
5379 # Check that a TCP FIN packet does change the timeout.
5380 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
5381 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5382 warped
5383 ])
5384 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5385 [NXST_FLOW reply:
5386  n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
5387 ])
5388 OVS_VSWITCHD_STOP
5389 AT_CLEANUP
5390
5391 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
5392 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5393 ADD_OF_PORTS([br0], [1], [2])
5394 ADD_OF_PORTS([br1], [3])
5395
5396 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
5397 dummy@br0
5398 dummy@br1
5399 ])
5400 OVS_VSWITCHD_STOP
5401 AT_CLEANUP
5402
5403 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
5404 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5405 ADD_OF_PORTS([br0], [1], [2])
5406 ADD_OF_PORTS([br1], [3])
5407
5408 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5409 dummy@ovs-dummy: hit:0 missed:0
5410         br0:
5411                 br0 65534/100: (dummy)
5412                 p1 1/1: (dummy)
5413                 p2 2/2: (dummy)
5414         br1:
5415                 br1 65534/101: (dummy)
5416                 p3 3/3: (dummy)
5417 ])
5418 OVS_VSWITCHD_STOP
5419 AT_CLEANUP
5420
5421 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
5422 # bump max-idle to avoid the flows being reclaimed behind us
5423 OVS_VSWITCHD_START([add-br br1 -- \
5424                     set bridge br1 datapath-type=dummy fail-mode=secure -- \
5425                     set Open_vSwitch . other_config:max-idle=10000])
5426 ADD_OF_PORTS([br0], [1], [2])
5427 ADD_OF_PORTS([br1], [3])
5428
5429 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)'])
5430 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)'])
5431 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)'])
5432 ovs-appctl revalidator/wait
5433 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5434 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5435 recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5436 ])
5437
5438 AT_CHECK([ovs-appctl dpif/dump-flows br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5439 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5440 ])
5441
5442 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5443 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p1),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
5444 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p2),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
5445 ])
5446
5447 AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5448 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p3),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
5449 ])
5450
5451 OVS_VSWITCHD_STOP
5452 AT_CLEANUP
5453
5454 AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow])
5455
5456 OVS_VSWITCHD_START([add-br br1 -- \
5457                     set bridge br1 datapath-type=dummy fail-mode=secure -- \
5458                     set Open_vSwitch . other_config:max-idle=10000])
5459 ADD_OF_PORTS([br0], [1], [2])
5460
5461 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)'])
5462 ovs-appctl revalidator/wait
5463 AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
5464
5465 UFID=`sed -n 's/\(ufid:[[-0-9a-fA-F]]*\).*/\1/p' stdout`
5466 AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
5467 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5468 ])
5469
5470 OVS_VSWITCHD_STOP
5471 AT_CLEANUP
5472
5473 AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
5474 OVS_VSWITCHD_START([dnl
5475    add-port br0 p1 -- set Interface p1 type=dummy
5476 ])
5477 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5478 ON_EXIT([kill `cat ovs-ofctl.pid`])
5479
5480 AT_CAPTURE_FILE([ofctl_monitor.log])
5481 AT_DATA([flows.txt], [dnl
5482 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5483 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5484 ])
5485 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5486
5487 dnl Packet is sent to userspace because a MPLS push or pop action is applied to
5488 dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
5489 dnl
5490 dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
5491 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)
5492 dnl         (label 20, exp 0, [S], ttl 32)
5493 dnl         (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5494 dnl     192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
5495
5496 for dl_src in 00 01; do
5497     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"])
5498 done
5499 sleep 1  # wait for the datapath flow installed
5500 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5501 recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:00,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller))
5502 recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:01,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller))
5503 ])
5504
5505 OVS_VSWITCHD_STOP
5506 AT_CLEANUP
5507
5508
5509 AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
5510 OVS_VSWITCHD_START([dnl
5511    add-port br0 p1 -- set Interface p1 type=dummy
5512 ])
5513 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5514 ON_EXIT([kill `cat ovs-ofctl.pid`])
5515
5516 AT_CAPTURE_FILE([ofctl_monitor.log])
5517 AT_DATA([flows.txt], [dnl
5518 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5519 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5520 ])
5521 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5522
5523 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
5524 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
5525 dnl can't determine the resulting MPLS label after MPLS push/pop actions.
5526 dnl
5527 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
5528 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)
5529 dnl         (label 20, exp 0, ttl 32)
5530 dnl         (label 20, exp 0, ttl 32)
5531 dnl         (label 20, exp 0, [S], ttl 32)
5532 dnl         (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5533 dnl     192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
5534
5535 for dl_src in 00 01; do
5536     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"])
5537 done
5538 sleep 1  # wait for the datapath flow installed
5539 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5540 recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:00,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller))
5541 recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:01,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller))
5542 ])
5543
5544 OVS_VSWITCHD_STOP
5545 AT_CLEANUP
5546
5547 AT_SETUP([ofproto-dpif - patch ports])
5548 OVS_VSWITCHD_START([add-br br1 \
5549 -- set bridge br1 datapath-type=dummy fail-mode=secure \
5550 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
5551 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5552
5553 ADD_OF_PORTS([br0], [2])
5554 ADD_OF_PORTS([br1], [3])
5555
5556 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5557 ], [])
5558 AT_CHECK([ovs-appctl time/stop])
5559 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5560
5561 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
5562 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
5563
5564 for i in $(seq 1 10); do
5565     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)'
5566     if [[ $i -eq 1 ]]; then
5567         sleep 1
5568     fi
5569 done
5570
5571 for i in $(seq 1 5); do
5572     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)'
5573     if [[ $i -eq 1 ]]; then
5574         sleep 1
5575     fi
5576 done
5577
5578 AT_CHECK([ovs-appctl time/warp 500], [0],
5579 [warped
5580 ])
5581 sleep 1  # wait for log writer
5582
5583 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5584 dummy@ovs-dummy: hit:13 missed:2
5585         br0:
5586                 br0 65534/100: (dummy)
5587                 p2 2/2: (dummy)
5588                 pbr0 1/none: (patch: peer=pbr1)
5589         br1:
5590                 br1 65534/101: (dummy)
5591                 p3 3/3: (dummy)
5592                 pbr1 1/none: (patch: peer=pbr0)
5593 ])
5594
5595 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5596 recirc_id=0,ip,in_port=100,nw_frag=no, actions:101,3,2
5597 recirc_id=0,ip,in_port=101,nw_frag=no, actions:100,2,3
5598 ])
5599
5600 AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
5601 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(100),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:540, used:0.0s, actions:101,3,2
5602 ])
5603 AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
5604 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(101),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:240, used:0.0s, actions:100,2,3
5605 ])
5606
5607 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
5608 OFPST_PORT reply (xid=0x4): 1 ports
5609   port  1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
5610            tx pkts=10, bytes=600, drop=0, errs=0, coll=0
5611 ])
5612
5613 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
5614 OFPST_PORT reply (xid=0x4): 1 ports
5615   port  1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
5616            tx pkts=5, bytes=300, drop=0, errs=0, coll=0
5617 ])
5618
5619 OVS_VSWITCHD_STOP
5620 AT_CLEANUP
5621
5622 AT_SETUP([ofproto-dpif - patch ports - stack])
5623 OVS_VSWITCHD_START([add-br br1 \
5624 -- set bridge br1 datapath-type=dummy fail-mode=secure \
5625 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
5626 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5627
5628 ADD_OF_PORTS([br0], [2])
5629 ADD_OF_PORTS([br1], [3])
5630
5631 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5632 ], [])
5633 AT_CHECK([ovs-appctl time/stop])
5634 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5635
5636 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"])
5637 # Try to pop from empty stack, and push and leave data to stack.
5638 AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"])
5639
5640 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)'
5641
5642 AT_CHECK([ovs-appctl time/warp 500], [0],
5643 [warped
5644 ])
5645
5646 OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1])
5647
5648 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5649 dummy@ovs-dummy: hit:0 missed:1
5650         br0:
5651                 br0 65534/100: (dummy)
5652                 p2 2/2: (dummy)
5653                 pbr0 1/none: (patch: peer=pbr1)
5654         br1:
5655                 br1 65534/101: (dummy)
5656                 p3 3/3: (dummy)
5657                 pbr1 1/none: (patch: peer=pbr0)
5658 ])
5659
5660 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5661 recirc_id=0,ip,in_port=100,nw_src=192.168.0.1,nw_frag=no, actions:101,set(ipv4(src=255.255.255.254)),2
5662 ])
5663
5664 AT_CHECK([cat ovs-vswitchd.log | grep -e '|nx_match|WARN|' | sed "s/^.*|WARN|//"], [0], [dnl
5665 Failed to pop from an empty stack. On flow
5666 ])
5667
5668 OVS_VSWITCHD_STOP(["/Failed to pop from an empty stack/d"])
5669 AT_CLEANUP
5670
5671 AT_SETUP([ofproto-dpif - port duration])
5672 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
5673 ADD_OF_PORTS([br0], 1, 2)
5674
5675 ovs-appctl time/stop
5676 ovs-appctl time/warp 10000
5677
5678 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
5679 AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
5680 [dnl
5681            duration=?s
5682            duration=?s
5683            duration=?s
5684 ])
5685 OVS_VSWITCHD_STOP
5686 AT_CLEANUP
5687
5688 dnl ----------------------------------------------------------------------
5689 AT_BANNER([ofproto-dpif -- megaflows])
5690
5691 AT_SETUP([ofproto-dpif megaflow - port classification])
5692 OVS_VSWITCHD_START
5693 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5694 ADD_OF_PORTS([br0], [1], [2])
5695 AT_DATA([flows.txt], [dnl
5696 table=0 in_port=1 actions=output(2)
5697 ])
5698 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5699 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)'])
5700 sleep 1
5701 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)'])
5702 sleep 1
5703 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5704 recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
5705 ])
5706 OVS_VSWITCHD_STOP
5707 AT_CLEANUP
5708
5709 AT_SETUP([ofproto-dpif megaflow - L2 classification])
5710 OVS_VSWITCHD_START
5711 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5712 ADD_OF_PORTS([br0], [1], [2])
5713 AT_DATA([flows.txt], [dnl
5714 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
5715 ])
5716 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5717 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)'])
5718 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)'])
5719 sleep 1
5720 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5721 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5722 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b/ff:ff:00:00:00:02,nw_frag=no, actions: <del>
5723 ])
5724 OVS_VSWITCHD_STOP
5725 AT_CLEANUP
5726
5727 AT_SETUP([ofproto-dpif megaflow - L3 classification])
5728 OVS_VSWITCHD_START
5729 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5730 ADD_OF_PORTS([br0], [1], [2])
5731 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], [])
5732 AT_DATA([flows.txt], [dnl
5733 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
5734 ])
5735 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5736 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)'])
5737 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)'])
5738 sleep 1
5739 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5740 recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
5741 recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
5742 ])
5743 OVS_VSWITCHD_STOP
5744 AT_CLEANUP
5745
5746 AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
5747 OVS_VSWITCHD_START
5748 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5749 ADD_OF_PORTS([br0], [1], [2])
5750 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], [])
5751 AT_DATA([flows.txt], [dnl
5752 table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
5753 ])
5754 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5755 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)'])
5756 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)'])
5757 sleep 1
5758 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5759 recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:1:2:3:4:5,nw_frag=no, actions: <del>
5760 recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:5:4:3:2:1/0:0:0:4::,nw_frag=no, actions: <del>
5761 ])
5762 OVS_VSWITCHD_STOP
5763 AT_CLEANUP
5764
5765 AT_SETUP([ofproto-dpif megaflow - L4 classification])
5766 OVS_VSWITCHD_START
5767 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5768 ADD_OF_PORTS([br0], [1], [2])
5769 AT_DATA([flows.txt], [dnl
5770 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
5771 ])
5772 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5773 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)'])
5774 sleep 1
5775 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)'])
5776 sleep 1
5777 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5778 recirc_id=0,icmp,in_port=1,nw_frag=no,icmp_type=0x8/0xff, actions: <del>
5779 ])
5780 OVS_VSWITCHD_STOP
5781 AT_CLEANUP
5782
5783 AT_SETUP([ofproto-dpif megaflow - normal])
5784 OVS_VSWITCHD_START
5785 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5786 ADD_OF_PORTS([br0], [1], [2])
5787 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5788 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)'])
5789 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)'])
5790 sleep 1
5791 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5792 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
5793 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
5794 ])
5795 OVS_VSWITCHD_STOP
5796 AT_CLEANUP
5797
5798 AT_SETUP([ofproto-dpif megaflow - mpls])
5799 OVS_VSWITCHD_START
5800 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5801 ADD_OF_PORTS([br0], [1], [2])
5802 AT_DATA([flows.txt], [dnl
5803 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
5804 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
5805 ])
5806 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5807 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)'])
5808 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)'])
5809 sleep 1
5810 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5811 recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:09,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1, actions: <del>
5812 recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:0b,mpls_bos=1, actions: <del>
5813 ])
5814 OVS_VSWITCHD_STOP
5815 AT_CLEANUP
5816
5817 # CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR, IP_VERSION_TYPE)
5818 #
5819 # IP_VERSION_TYPE is used in AT_SETUP
5820 m4_define([CHECK_MEGAFLOW_NETFLOW],
5821   [AT_SETUP([ofproto-dpif megaflow - netflow - $2 collector])
5822   OVS_VSWITCHD_START
5823   AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5824   ADD_OF_PORTS([br0], [1], [2])
5825
5826   dnl NetFlow configuration disables wildcarding relevant fields
5827   ON_EXIT([kill `cat test-netflow.pid`])
5828   AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
5829   AT_CAPTURE_FILE([netflow.log])
5830   NETFLOW_PORT=`parse_listening_port < test-netflow.log`
5831   ovs-vsctl \
5832      set Bridge br0 netflow=@nf -- \
5833      --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5834        engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
5835
5836   AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5837   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)'])
5838   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)'])
5839   sleep 1
5840   AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5841 recirc_id=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_frag=no,icmp_type=0x8/0xff,icmp_code=0x0/0xff, actions: <del>
5842 recirc_id=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_frag=no,icmp_type=0x8/0xff,icmp_code=0x0/0xff, actions: <del>
5843 ])
5844   OVS_VSWITCHD_STOP
5845   AT_CLEANUP])
5846
5847 CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
5848 CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
5849
5850 AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
5851 OVS_VSWITCHD_START(
5852   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
5853    add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
5854    set interface p2 type=dummy ofport_request=2 -- \
5855    set interface p3 type=dummy ofport_request=3])
5856 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5857 ])
5858 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5859
5860 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5861 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)'])
5862 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)'])
5863 sleep 1
5864 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5865 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
5866 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
5867 ])
5868 OVS_VSWITCHD_STOP
5869 AT_CLEANUP
5870
5871 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
5872 OVS_VSWITCHD_START(
5873   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
5874    add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
5875    set interface p2 type=dummy ofport_request=2 -- \
5876    set interface p3 type=dummy ofport_request=3])
5877 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5878 ])
5879 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5880
5881 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5882 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)'])
5883 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)'])
5884 sleep 1
5885 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5886 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
5887 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
5888 ])
5889 OVS_VSWITCHD_STOP
5890 AT_CLEANUP
5891
5892 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
5893 # Create bond0 on br0 with interfaces p0 and p1
5894 #    and bond1 on br1 with interfaces p2 and p3
5895 # with p0 patched to p2 and p1 patched to p3.
5896 OVS_VSWITCHD_START(
5897   [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
5898                             other-config:lacp-time=fast \
5899                             other-config:bond-rebalance-interval=0 -- \
5900    set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
5901    set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
5902    add-br br1 -- \
5903    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
5904    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
5905                   fail-mode=secure -- \
5906    add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
5907                             other-config:lacp-time=fast \
5908                             other-config:bond-rebalance-interval=0 -- \
5909    set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
5910    set interface p3 type=patch options:peer=p1 ofport_request=4 --])
5911
5912 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5913 ])
5914 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5915 ADD_OF_PORTS([br0], [7])
5916 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5917 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
5918 ovs-appctl time/stop
5919 ovs-appctl time/warp 5000
5920 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)'])
5921 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)'])
5922 sleep 1
5923 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5924 recirc_id=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
5925 recirc_id=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
5926 ])
5927 OVS_VSWITCHD_STOP
5928 AT_CLEANUP
5929
5930 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
5931 OVS_VSWITCHD_START
5932 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5933 ADD_OF_PORTS([br0], [1], [2])
5934 AT_DATA([flows.txt], [dnl
5935 table=0 in_port=1,ip actions=resubmit(90)
5936 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
5937 ])
5938 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5939 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)'])
5940 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)'])
5941 sleep 1
5942 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5943 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5944 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b/ff:ff:00:00:00:02,nw_frag=no, actions: <del>
5945 ])
5946 OVS_VSWITCHD_STOP
5947 AT_CLEANUP
5948
5949 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
5950 OVS_VSWITCHD_START
5951 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5952 ADD_OF_PORTS([br0], [1], [2])
5953 AT_DATA([flows.txt], [dnl
5954 table=0 in_port=1,ip actions=resubmit(,1)
5955 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5956 ])
5957 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5958 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)'])
5959 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=
5960 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
5961 sleep 1
5962 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5963 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5964 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
5965 ])
5966 OVS_VSWITCHD_STOP
5967 AT_CLEANUP
5968
5969 AT_SETUP([ofproto-dpif megaflow - goto_table action])
5970 OVS_VSWITCHD_START
5971 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5972 ADD_OF_PORTS([br0], [1], [2])
5973 AT_DATA([flows.txt], [dnl
5974 table=0 in_port=1,ip actions=goto_table(1)
5975 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5976 ])
5977 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
5978 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)'])
5979 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)'])
5980 sleep 1
5981 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5982 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5983 recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
5984 ])
5985 OVS_VSWITCHD_STOP
5986 AT_CLEANUP
5987
5988 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
5989 OVS_VSWITCHD_START
5990 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5991 ADD_OF_PORTS([br0], [1], [2], [3])
5992 ovs-vsctl \
5993         set Bridge br0 mirrors=@m --\
5994         --id=@p3 get Port p3 --\
5995         --id=@m create Mirror name=mymirror select_all=true output_port=@p3
5996
5997 AT_DATA([flows.txt], [dnl
5998 in_port=1 actions=output:2
5999 ])
6000 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6001 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)'])
6002 sleep 1
6003 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)'])
6004 sleep 1
6005 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6006 recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
6007 ])
6008 OVS_VSWITCHD_STOP
6009 AT_CLEANUP
6010
6011 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
6012 OVS_VSWITCHD_START
6013 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6014 ADD_OF_PORTS([br0], [1], [2], [3])
6015 ovs-vsctl \
6016         set Bridge br0 mirrors=@m --\
6017         --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
6018         --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
6019
6020 AT_DATA([flows.txt], [dnl
6021 in_port=1 actions=output:2
6022 ])
6023 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6024 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))'])
6025 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)'])
6026 sleep 1
6027 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6028 recirc_id=0,ip,in_port=1,dl_vlan=11,nw_frag=no, actions: <del>
6029 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,nw_frag=no, actions: <del>
6030 ])
6031 OVS_VSWITCHD_STOP
6032 AT_CLEANUP
6033
6034 AT_SETUP([ofproto-dpif megaflow - move action])
6035 OVS_VSWITCHD_START
6036 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6037 ADD_OF_PORTS([br0], [1], [2])
6038 AT_DATA([flows.txt], [dnl
6039 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
6040 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
6041 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
6042 ])
6043 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6044 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)'])
6045 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)'])
6046 sleep 1
6047 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6048 recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
6049 recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
6050 ])
6051 OVS_VSWITCHD_STOP
6052 AT_CLEANUP
6053
6054 AT_SETUP([ofproto-dpif megaflow - push action])
6055 OVS_VSWITCHD_START
6056 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6057 ADD_OF_PORTS([br0], [1], [2])
6058 AT_DATA([flows.txt], [dnl
6059 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
6060 ])
6061 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6062 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)'])
6063 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)'])
6064 sleep 1
6065 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6066 recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
6067 recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
6068 ])
6069 OVS_VSWITCHD_STOP
6070 AT_CLEANUP
6071
6072 AT_SETUP([ofproto-dpif megaflow - learning])
6073 OVS_VSWITCHD_START
6074 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6075 ADD_OF_PORTS([br0], [1], [2])
6076 AT_DATA([flows.txt], [dnl
6077 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
6078 ])
6079 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6080 ovs-appctl time/stop
6081 # We send each packet twice because the first packet in each flow causes the
6082 # flow table to change and thus revalidations, which (depending on timing)
6083 # can keep a megaflow from being installed.  The revalidations are done by
6084 # the second iteration, allowing the flows to be installed.
6085 for i in 1 2; do
6086     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)'])
6087     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)'])
6088     ovs-appctl time/warp 100
6089 done
6090 sleep 1
6091 dnl The original flow is missing due to a revalidation.
6092 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6093 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
6094 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
6095 ])
6096 OVS_VSWITCHD_STOP
6097 AT_CLEANUP
6098
6099 AT_SETUP([ofproto-dpif megaflow - tunnels])
6100 OVS_VSWITCHD_START(
6101   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
6102 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6103 AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
6104      options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
6105 AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
6106           ofport_request=3])
6107 AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
6108      options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
6109      ofport_request=4 options:key=flow])
6110 AT_DATA([flows.txt], [dnl
6111 in_port=1,actions=output(2)
6112 in_port=3,actions=output(4)
6113 ])
6114 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6115 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
6116 dnl will cause the packet to be dropped.
6117 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)'])
6118 sleep 1
6119 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)'])
6120 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)'])
6121 sleep 1
6122 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)'])
6123 sleep 1
6124 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6125 recirc_id=0,ip,in_port=1,nw_ecn=1,nw_frag=no, actions: <del>
6126 recirc_id=0,ip,in_port=3,nw_tos=0,nw_ecn=1,nw_ttl=64,nw_frag=no, actions: <del>
6127 recirc_id=0,ip,in_port=3,nw_tos=252,nw_ecn=1,nw_ttl=128,nw_frag=no, actions: <del>
6128 ])
6129 OVS_VSWITCHD_STOP
6130 AT_CLEANUP
6131
6132 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
6133 OVS_VSWITCHD_START
6134 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6135 ADD_OF_PORTS([br0], [1], [2])
6136 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], [])
6137 AT_DATA([flows.txt], [dnl
6138 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
6139 ])
6140 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6141 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)'])
6142 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)'])
6143 sleep 1
6144 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6145 recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_ttl=64,nw_frag=no, actions: <del>
6146 recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
6147 ])
6148 OVS_VSWITCHD_STOP
6149 AT_CLEANUP
6150
6151 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
6152 OVS_VSWITCHD_START
6153 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6154 ADD_OF_PORTS([br0], [1], [2])
6155 AT_DATA([flows.txt], [dnl
6156 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
6157 ])
6158 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6159 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)'])
6160 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)'])
6161 sleep 1
6162 dnl The first packet is essentially a no-op, as the new destination MAC is the
6163 dnl same as the original.  The second entry actually updates the destination
6164 dnl MAC.
6165 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
6166 recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions:2
6167 recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions:set(eth(dst=50:54:00:00:00:0a)),2
6168 ])
6169 OVS_VSWITCHD_STOP
6170 AT_CLEANUP
6171
6172 AT_SETUP([ofproto-dpif megaflow - disabled])
6173 OVS_VSWITCHD_START
6174 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6175 ADD_OF_PORTS([br0], [1], [2])
6176 AT_DATA([flows.txt], [dnl
6177 table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
6178 table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
6179 ])
6180 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
6181 ], [])
6182 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
6183 ], [])
6184 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
6185 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6186 for i in 1 2 3 4; do
6187     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)'])
6188     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)'])
6189     if [[ $i -eq 1 ]]; then
6190         sleep 1
6191     fi
6192 done
6193 sleep 1
6194 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
6195 pkt_mark=0,recirc_id=0,dp_hash=0,skb_priority=0,icmp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0, actions:2
6196 pkt_mark=0,recirc_id=0,dp_hash=0,skb_priority=0,icmp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0, actions:drop
6197 ])
6198 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_DUMP | grep 'packets:3'], [0], [dnl
6199 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),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), packets:3, bytes:180, used:0.0s, actions:2
6200 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),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), packets:3, bytes:180, used:0.0s, actions:drop
6201 ])
6202 OVS_VSWITCHD_STOP
6203 AT_CLEANUP
6204
6205 AT_SETUP([ofproto-dpif - datapath port number change])
6206 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6207 ADD_OF_PORTS([br0], 1)
6208
6209 # Trace a flow that should output to p1.
6210 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6211   [0], [stdout])
6212 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
6213 ])
6214
6215 # Change p1's port number to 5.
6216 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
6217
6218 # Trace a flow that should output to p1 in its new location.
6219 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6220   [0], [stdout])
6221 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
6222 ])
6223 OVS_VSWITCHD_STOP
6224 AT_CLEANUP
6225
6226 # Tests the bundling with various bfd and cfm configurations.
6227 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
6228 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
6229                     add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
6230                     add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
6231                     set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
6232                     set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
6233                     set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
6234                     set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
6235                     set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
6236                     set Interface p0 cfm_mpid=1 -- \
6237                     set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
6238
6239 ovs-appctl time/stop
6240 # advance the clock to stablize everything.
6241 ovs-appctl time/warp 5000 100
6242 # cfm/show should show 'recv' fault.
6243 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6244         fault: recv
6245 ])
6246 # bfd/show should show 'up'.
6247 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6248         Local Session State: up
6249         Remote Session State: up
6250         Local Session State: up
6251         Remote Session State: up
6252 ])
6253 # bond/show should show 'may-enable: true' for all slaves.
6254 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6255         may_enable: true
6256         may_enable: true
6257         may_enable: true
6258         may_enable: true
6259 ])
6260
6261 # now disable the bfd on p1.
6262 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
6263 # advance the clock to stablize everything.
6264 ovs-appctl time/warp 5000 100
6265 # cfm/show should show 'recv' fault.
6266 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6267         fault: recv
6268 ])
6269 # bfd/show should show 'down'.
6270 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6271         Local Session State: down
6272         Remote Session State: down
6273 ])
6274 # bond/show should show 'may-enable: false' for p0.
6275 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6276         may_enable: false
6277         may_enable: true
6278 ])
6279
6280 # now enable the bfd on p1 and disable bfd on p0.
6281 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
6282 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
6283 # advance the clock to stablize everything.
6284 ovs-appctl time/warp 5000 100
6285 # cfm/show should show 'recv' fault.
6286 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6287         fault: recv
6288 ])
6289 # bfd/show should show 'down'.
6290 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6291         Local Session State: down
6292         Remote Session State: down
6293 ])
6294 # bond/show should show 'may-enable: false' for p0 and p1.
6295 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6296         may_enable: false
6297         may_enable: true
6298         may_enable: false
6299         may_enable: true
6300 ])
6301
6302 OVS_VSWITCHD_STOP
6303 AT_CLEANUP
6304
6305 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
6306 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
6307
6308 # enable bfd on p0.
6309 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
6310 # check log.
6311 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
6312 # disable bfd on p0.
6313 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
6314 # check log.
6315 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
6316 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
6317
6318 # enable cfm on p0.
6319 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
6320 # check log.
6321 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
6322 # disable cfm on p0.
6323 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
6324 # check log.
6325 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
6326 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
6327
6328 # enable both bfd and cfm on p0.
6329 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
6330 # check log.
6331 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
6332 # disable bfd on p0.
6333 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
6334 # check log, there should not be the log of thread terminated.
6335 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
6336 ])
6337 # reenable bfd on p0.
6338 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
6339 # check log, should still be on log of thread created.
6340 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
6341 monitor thread created
6342 ])
6343 # disable bfd and cfm together.
6344 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
6345 # check log.
6346 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
6347
6348 OVS_VSWITCHD_STOP
6349 AT_CLEANUP
6350
6351 # this test helps avoid the deadlock between the main thread and monitor thread.
6352 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
6353 OVS_VSWITCHD_START
6354
6355 for i in `seq 1 199`
6356 do
6357     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])
6358 done
6359
6360 OVS_VSWITCHD_STOP
6361 AT_CLEANUP
6362 \f
6363 AT_BANNER([ofproto-dpif - flow translation resource limits])
6364
6365 AT_SETUP([ofproto-dpif - infinite resubmit])
6366 OVS_VSWITCHD_START
6367 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
6368 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
6369   [0], [stdout])
6370 AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
6371 ])
6372 AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
6373   [0], [1
6374 ])
6375 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
6376 AT_CLEANUP
6377
6378 AT_SETUP([ofproto-dpif - exponential resubmit chain])
6379 OVS_VSWITCHD_START
6380 ADD_OF_PORTS([br0], 1)
6381 (for i in `seq 1 64`; do
6382      j=`expr $i + 1`
6383      echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6384  done
6385  echo "in_port=65, actions=local") > flows
6386  AT_CHECK([ovs-ofctl add-flows br0 flows])
6387 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
6388 AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
6389 ])
6390 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
6391 AT_CLEANUP
6392
6393 AT_SETUP([ofproto-dpif - too many output actions])
6394 OVS_VSWITCHD_START
6395 ADD_OF_PORTS([br0], 1)
6396 (for i in `seq 1 12`; do
6397      j=`expr $i + 1`
6398      echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6399  done
6400  echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
6401 AT_CHECK([ovs-ofctl add-flows br0 flows])
6402 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
6403 AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
6404   [0], [1
6405 ])
6406 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
6407 ])
6408 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
6409 AT_CLEANUP
6410
6411 AT_SETUP([ofproto-dpif - stack too deep])
6412 OVS_VSWITCHD_START
6413 ADD_OF_PORTS([br0], 1)
6414 (for i in `seq 1 12`; do
6415      j=`expr $i + 1`
6416      echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6417  done
6418  push="push:NXM_NX_REG0[[]]"
6419  echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
6420  AT_CHECK([ovs-ofctl add-flows br0 flows])
6421 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
6422 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
6423 ])
6424 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
6425 AT_CLEANUP
6426
6427
6428 AT_SETUP([ofproto-dpif packet-out controller])
6429 OVS_VSWITCHD_START
6430 ADD_OF_PORTS([br0], 1, 2)
6431
6432 AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
6433
6434 AT_CAPTURE_FILE([ofctl_monitor.log])
6435 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6436
6437 for i in 1 2 3; do
6438         AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
6439 done
6440
6441 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6442 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6443 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
6444 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6445 dnl
6446 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
6447 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6448 dnl
6449 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
6450 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6451 ])
6452
6453 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6454  dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6455 NXST_FLOW reply:
6456 ])
6457
6458 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6459   table 0:
6460     active=1, lookup=0, matched=0"
6461  x=1
6462  while test $x -lt 254; do
6463    echo "
6464   table $x:
6465     active=0, lookup=0, matched=0"
6466    x=`expr $x + 1`
6467  done) > expout
6468 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6469
6470 OVS_VSWITCHD_STOP
6471 AT_CLEANUP
6472
6473 AT_SETUP([ofproto-dpif packet-out controller (patch port)])
6474 OVS_VSWITCHD_START(
6475   [-- \
6476    add-port br0 p1 -- \
6477    set interface p1 type=patch options:peer=p2 -- \
6478    add-br br1 -- \
6479    set bridge br1 datapath-type=dummy -- \
6480    set bridge br1 fail-mode=secure -- \
6481    set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
6482    add-port br1 p2 -- \
6483    set interface p2 type=patch options:peer=p1 --])
6484
6485 AT_CAPTURE_FILE([ofctl_monitor.log])
6486 AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6487
6488 for i in 1 2 3; do
6489         AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
6490 done
6491
6492 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6493 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6494 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
6495 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6496 dnl
6497 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
6498 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6499 dnl
6500 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
6501 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6502 ])
6503
6504 (printf "OFPST_TABLE reply (OF1.3) (xid=0x2):"
6505  x=0
6506  while test $x -lt 254; do
6507    echo "
6508   table $x:
6509     active=0, lookup=0, matched=0"
6510    x=`expr $x + 1`
6511  done) > expout
6512 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6513
6514 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6515   table 0:
6516     active=0, lookup=3, matched=0"
6517  x=1
6518  while test $x -lt 254; do
6519    echo "
6520   table $x:
6521     active=0, lookup=0, matched=0"
6522    x=`expr $x + 1`
6523  done) > expout
6524 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
6525
6526 OVS_VSWITCHD_STOP
6527 AT_CLEANUP
6528
6529
6530 AT_SETUP([ofproto-dpif packet-out goto_table])
6531 OVS_VSWITCHD_START
6532 ADD_OF_PORTS([br0], 1, 2)
6533
6534 AT_DATA([flows.txt], [dnl
6535 table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
6536 table=1 dl_dst=50:54:00:00:00:0a actions=controller
6537 ])
6538 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
6539
6540 AT_CAPTURE_FILE([ofctl_monitor.log])
6541 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6542
6543 for i in 1 2 3; do
6544     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)'
6545 done
6546
6547 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6548 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6549 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6550 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6551 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6552 dnl
6553 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6554 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6555 dnl
6556 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6557 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6558 ])
6559
6560 AT_CHECK([ovs-appctl revalidator/purge], [0])
6561 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
6562  n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
6563  table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6564 OFPST_FLOW reply (OF1.3):
6565 ])
6566
6567 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6568   table 0:
6569     active=1, lookup=3, matched=3
6570
6571   table 1:
6572     active=1, lookup=3, matched=3"
6573  x=2
6574  while test $x -lt 254; do
6575    echo "
6576   table $x:
6577     active=0, lookup=0, matched=0"
6578    x=`expr $x + 1`
6579  done) > expout
6580 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6581
6582 OVS_VSWITCHD_STOP
6583 AT_CLEANUP
6584
6585
6586 AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
6587 OVS_VSWITCHD_START
6588 ADD_OF_PORTS([br0], 1, 2)
6589
6590 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
6591 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
6592
6593 AT_CAPTURE_FILE([ofctl_monitor.log])
6594 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6595
6596 for i in 1 2 3; do
6597     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)'
6598 done
6599
6600 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6601 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6602 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6603 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6604 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6605 dnl
6606 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6607 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6608 dnl
6609 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6610 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6611 ])
6612
6613 AT_CHECK([ovs-appctl revalidator/purge], [0])
6614 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
6615  table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6616 OFPST_FLOW reply (OF1.1):
6617 ])
6618
6619 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6620   table 0:
6621     active=0, lookup=3, matched=0
6622
6623   table 1:
6624     active=1, lookup=3, matched=3"
6625  x=2
6626  while test $x -lt 254; do
6627    echo "
6628   table $x:
6629     active=0, lookup=0, matched=0"
6630    x=`expr $x + 1`
6631  done) > expout
6632 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6633
6634 OVS_VSWITCHD_STOP
6635 AT_CLEANUP
6636
6637 AT_SETUP([ofproto-dpif - ICMPv6])
6638 OVS_VSWITCHD_START
6639 ADD_OF_PORTS([br0], 1)
6640
6641 AT_CAPTURE_FILE([ofctl_monitor.log])
6642
6643 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6644
6645 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
6646
6647 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6648
6649 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6650 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
6651 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
6652 ])
6653
6654 OVS_VSWITCHD_STOP
6655 AT_CLEANUP
6656
6657 AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update])
6658 OVS_VSWITCHD_START
6659 ADD_OF_PORTS([br0], 1)
6660 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])
6661
6662 AT_CAPTURE_FILE([ofctl_monitor.log])
6663
6664 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6665
6666 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
6667
6668 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6669
6670 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6671 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered)
6672 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
6673 ])
6674
6675 OVS_VSWITCHD_STOP
6676 AT_CLEANUP
6677
6678 # Tests the exact match of CFI bit in installed datapath flows matching VLAN.
6679 AT_SETUP([ofproto-dpif - vlan matching])
6680 OVS_VSWITCHD_START(
6681   [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1])
6682 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6683
6684 AT_CHECK([ovs-ofctl del-flows br0])
6685 AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"])
6686
6687 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))'])
6688
6689 AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[1]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6690 recirc_id=0,ip,in_port=1,dl_vlan=10,nw_frag=no, actions: <del>
6691 ])
6692 OVS_VSWITCHD_STOP
6693 AT_CLEANUP