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