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