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