0af01ca0574d3c498279899f9fc337283a04d9b9
[cascardo/ovs.git] / tests / ofproto-dpif.at
1 AT_BANNER([ofproto-dpif])
2
3 AT_SETUP([ofproto-dpif - revalidator/wait])
4 OVS_VSWITCHD_START
5 AT_CHECK([ovs-appctl revalidator/wait])
6 OVS_VSWITCHD_STOP
7 AT_CLEANUP
8
9 AT_SETUP([ofproto-dpif - active-backup bonding])
10 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
11 #    and br1 with interfaces p3, p4 and p8.
12 # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
13 OVS_VSWITCHD_START(
14   [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
15    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
16    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
17    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
18    add-br br1 -- \
19    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
20    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
21                   fail-mode=secure -- \
22    add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
23    add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
24    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
25 WAIT_FOR_DUMMY_PORTS([p3], [p4])
26 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
27
28 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
29 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
30 ovs-appctl netdev-dummy/set-admin-state up
31 ovs-appctl time/warp 100
32 ovs-appctl netdev-dummy/set-admin-state p2 down
33 ovs-appctl time/stop
34 ovs-appctl time/warp 100
35 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
36 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
37 ovs-appctl time/warp 100
38 ovs-appctl netdev-dummy/set-admin-state p2 up
39 ovs-appctl netdev-dummy/set-admin-state p1 down
40 ovs-appctl time/warp 100
41 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
42 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
43 ovs-appctl time/warp 200 100
44 sleep 1
45 AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[348]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
46 recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
47 recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
48 recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0d,nw_frag=no, actions: <del>
49 recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0e,nw_frag=no, actions: <del>
50 recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
51 recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
52 ])
53 OVS_VSWITCHD_STOP
54 AT_CLEANUP
55
56 AT_SETUP([ofproto-dpif - balance-slb bonding])
57 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
58 #    and br1 with interfaces p4, p5, p6 and p8.
59 #    p1 <-> p4, p2 <-> p5, p3 <-> p6
60 # Send some traffic, make sure the traffic are spread based on source mac.
61 OVS_VSWITCHD_START(
62   [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
63    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
64    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
65    set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
66    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
67    add-br br1 -- \
68    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
69    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
70                   fail-mode=secure -- \
71    add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
72    add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
73    add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
74    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
75 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
76 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
77 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
78 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
79 ])
80 ovs-appctl time/stop
81 ovs-appctl time/warp 100
82 (
83 for i in `seq 0 100 |xargs printf '%02x\n'`;
84     do
85     pkt="in_port(7),eth(src=50:54:00:00:00:$i,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
86     AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
87     done
88 )
89 ovs-appctl time/warp 100
90 AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
91 # Make sure there is resonable distribution to all three ports.
92 # We don't want to make this check precise, in case hash function changes.
93 AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
94 AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
95 AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
96 OVS_VSWITCHD_STOP
97 AT_CLEANUP
98
99 AT_SETUP([ofproto-dpif - balance-tcp bonding])
100 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
101 #    and br1 with interfaces bond1(p4, p5, p6) and p8.
102 #    bond0 <-> bond1
103 # Send some traffic, make sure the traffic are spread based on L4 headers.
104 OVS_VSWITCHD_START(
105   [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
106         other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
107    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
108    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
109    set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
110    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
111    add-br br1 -- \
112    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
113    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
114                   fail-mode=secure -- \
115    add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
116         other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
117    set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
118    set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
119    set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
120    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
121 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
122 ])
123 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
124 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
125 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
126 ], [])
127 OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
128 ovs-appctl time/stop
129 ovs-appctl time/warp 100
130 ovs-appctl lacp/show > lacp.txt
131 ovs-appctl bond/show > bond.txt
132 (
133 for i in `seq 0 255` ;
134     do
135     pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(ack)"
136     AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
137     done
138 )
139 ovs-appctl time/warp 300 100
140 AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
141 AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
142 # Make sure there is resonable distribution to all three ports.
143 # We don't want to make this check precise, in case hash function changes.
144 AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
145 AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
146 AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
147
148 OVS_VSWITCHD_STOP()
149 AT_CLEANUP
150
151 # Makes sure recirculation does not change the way packet is handled.
152 AT_SETUP([ofproto-dpif - balance-tcp bonding, different recirc flow ])
153 OVS_VSWITCHD_START(
154   [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
155        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
156    set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
157    set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
158    add-br br1 -- \
159    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
160    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
161        fail-mode=standalone -- \
162    add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
163        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
164    set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
165    set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
166    add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
167    add-br br-int -- \
168    set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
169    set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
170        fail-mode=secure -- \
171    add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
172    add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
173 ])
174 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
175 ])
176
177 # Waits for all ifaces enabled.
178 OVS_WAIT_UNTIL([test `ovs-appctl bond/show | grep -- "may_enable: true" |  wc -l` -ge 4])
179
180 # The dl_vlan flow should not be ever matched,
181 # since recirculation should not change the flow handling.
182 AT_DATA([flows.txt], [dnl
183 table=0 priority=1 in_port=5 actions=mod_vlan_vid:1,output(101)
184 table=0 priority=2 in_port=5 dl_vlan=1 actions=drop
185 ])
186 AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
187
188 # Sends a packet to trigger recirculation.
189 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],
213                     [16], [17], [18], [19], [20], [21])
214 AT_DATA([flows.txt], [dnl
215 table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
216 table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
217 table=0 in_port=3 priority=2000 icmp actions=output(20)
218 table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
219 table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
220 table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
221 ])
222 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
223 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])
224 AT_CHECK([tail -1 stdout], [0],
225   [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
226 ])
227 OVS_VSWITCHD_STOP
228 AT_CLEANUP
229
230 AT_SETUP([ofproto-dpif - goto table])
231 OVS_VSWITCHD_START
232 ADD_OF_PORTS([br0], [1], [10], [11])
233 echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
234 for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
235 echo "table=64 actions=output(11)" >> flows.txt
236 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
237 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])
238 AT_CHECK([tail -1 stdout], [0],
239   [Datapath actions: 10,11
240 ])
241 OVS_VSWITCHD_STOP
242 AT_CLEANUP
243
244 AT_SETUP([ofproto-dpif - write actions])
245 OVS_VSWITCHD_START
246 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
247 AT_DATA([flows.txt], [dnl
248 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
249 table=1 ip actions=write_actions(output(13)),goto_table(2)
250 table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
251 ])
252 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
253 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])
254 AT_CHECK([tail -2 stdout], [0],
255   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
256 Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
257 ])
258 OVS_VSWITCHD_STOP
259 AT_CLEANUP
260
261 AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND)])
262 OVS_VSWITCHD_START
263 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
264 AT_DATA([flows.txt], [dnl
265 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)
266 table=1 icmp6 actions=write_actions(output(13)),goto_table(2)
267 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)
268 ])
269 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
270 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])
271 AT_CHECK([tail -4 stdout], [0],
272   [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
273 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
274 This flow is handled by the userspace slow path because it:
275         - Uses action(s) not supported by datapath.
276 ])
277 OVS_VSWITCHD_STOP
278 AT_CLEANUP
279
280 AT_SETUP([ofproto-dpif - clear actions])
281 OVS_VSWITCHD_START
282 ADD_OF_PORTS([br0], [1], [10], [11], [12])
283 AT_DATA([flows.txt], [dnl
284 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
285 table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
286 ])
287 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
288 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])
289 AT_CHECK([tail -2 stdout], [0],
290   [Megaflow: recirc_id=0,tcp,in_port=1,nw_frag=no,tp_src=8
291 Datapath actions: 10,set(tcp(src=91)),11
292 ])
293 OVS_VSWITCHD_STOP
294 AT_CLEANUP
295
296 AT_SETUP([ofproto-dpif - group chaining])
297 OVS_VSWITCHD_START
298 ADD_OF_PORTS([br0], [1], [10], [11])
299 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'])
300 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=123,type=all,bucket=output:10'])
301 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
302 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])
303 AT_CHECK([tail -1 stdout], [0],
304   [Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
305 ])
306 OVS_VSWITCHD_STOP
307 AT_CLEANUP
308
309 AT_SETUP([ofproto-dpif - all group in action list])
310 OVS_VSWITCHD_START
311 ADD_OF_PORTS([br0], [1], [10], [11])
312 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'])
313 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
314 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])
315 # Must match on the source address to be able to restore it's value for
316 # the second bucket
317 AT_CHECK([tail -2 stdout], [0],
318   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
319 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
320 ])
321 OVS_VSWITCHD_STOP
322 AT_CLEANUP
323
324 AT_SETUP([ofproto-dpif - indirect group in action list])
325 OVS_VSWITCHD_START
326 ADD_OF_PORTS([br0], [1], [10])
327 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
328 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
329 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])
330 AT_CHECK([tail -1 stdout], [0],
331   [Datapath actions: 10
332 ])
333 OVS_VSWITCHD_STOP
334 AT_CLEANUP
335
336 AT_SETUP([ofproto-dpif - group actions have no effect afterwards])
337 OVS_VSWITCHD_START
338 ADD_OF_PORTS([br0], [1], [10])
339 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'])
340 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234,output:10'])
341 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])
342 AT_CHECK([tail -1 stdout], [0],
343   [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
344 ])
345 OVS_VSWITCHD_STOP
346 AT_CLEANUP
347
348 AT_SETUP([ofproto-dpif - all group in action set])
349 OVS_VSWITCHD_START
350 ADD_OF_PORTS([br0], [1], [10], [11])
351 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'])
352 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
353 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])
354 # Must match on the source address to be able to restore it's value for
355 # the third bucket
356 AT_CHECK([tail -2 stdout], [0],
357   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
358 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
359 ])
360 OVS_VSWITCHD_STOP
361 AT_CLEANUP
362
363 AT_SETUP([ofproto-dpif - indirect group in action set])
364 OVS_VSWITCHD_START
365 ADD_OF_PORTS([br0], [1], [10])
366 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
367 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
368 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])
369 AT_CHECK([tail -1 stdout], [0],
370   [Datapath actions: 10
371 ])
372 OVS_VSWITCHD_STOP
373 AT_CLEANUP
374
375 AT_SETUP([ofproto-dpif - select group])
376 OVS_VSWITCHD_START
377 ADD_OF_PORTS([br0], [1], [10], [11])
378 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
379 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
380
381 # Try a bunch of different flows and make sure that they get distributed
382 # at least somewhat.
383 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
384     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])
385     tail -1 stdout >> results
386 done
387 sort results | uniq -c
388 AT_CHECK([sort results | uniq], [0],
389   [Datapath actions: 10
390 Datapath actions: 11
391 ])
392 OVS_VSWITCHD_STOP
393 AT_CLEANUP
394
395 AT_SETUP([ofproto-dpif - select group with watch port])
396 OVS_VSWITCHD_START
397 ADD_OF_PORTS([br0], [1], [10], [11])
398 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
399 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
400 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])
401 AT_CHECK([tail -1 stdout], [0],
402   [Datapath actions: 11
403 ])
404 OVS_VSWITCHD_STOP
405 AT_CLEANUP
406
407 AT_SETUP([ofproto-dpif - select group with weight])
408 OVS_VSWITCHD_START
409 ADD_OF_PORTS([br0], [1], [10], [11], [12])
410 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'])
411 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
412 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])
413 AT_CHECK([tail -1 stdout], [0],
414   [Datapath actions: 11
415 ])
416 OVS_VSWITCHD_STOP
417 AT_CLEANUP
418
419 AT_SETUP([ofproto-dpif - select group with hash selection method])
420 OVS_VSWITCHD_START
421 ADD_OF_PORTS([br0], [1], [10], [11])
422 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'])
423 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
424
425 # Try a bunch of different flows and make sure that they get distributed
426 # at least somewhat.
427 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
428     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])
429     tail -1 stdout >> results
430 done
431 sort results | uniq -c
432 AT_CHECK([sort results | uniq], [0],
433   [Datapath actions: 10
434 Datapath actions: 11
435 ])
436
437 > results
438 # Try a bunch of different flows and make sure that they are not distributed
439 # as they only vary a field that is not hashed
440 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
441     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])
442     tail -1 stdout >> results
443 done
444 sort results | uniq -c
445 AT_CHECK([sort results | uniq], [0],
446   [Datapath actions: 10
447 ])
448
449 OVS_VSWITCHD_STOP
450 AT_CLEANUP
451
452 AT_SETUP([ofproto-dpif - fast failover group])
453 OVS_VSWITCHD_START
454 ADD_OF_PORTS([br0], [1], [10], [11])
455 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'])
456 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
457 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])
458 AT_CHECK([tail -1 stdout], [0],
459   [Datapath actions: drop
460 ])
461 OVS_VSWITCHD_STOP
462 AT_CLEANUP
463
464 AT_SETUP([ofproto-dpif - group stats single bucket])
465 OVS_VSWITCHD_START
466 ADD_OF_PORTS([br0], [1], [10], [11])
467 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
468 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
469 (
470 for i in `seq 0 2`;
471     do
472     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)"
473     AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
474     done
475 )
476 AT_CHECK([ovs-appctl revalidator/purge], [0])
477 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
478 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
479  group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=0,byte_count=0
480 OFPST_GROUP reply (OF1.2):
481 ])
482 OVS_VSWITCHD_STOP
483 AT_CLEANUP
484
485 AT_SETUP([ofproto-dpif - group stats all buckets])
486 OVS_VSWITCHD_START
487 ADD_OF_PORTS([br0], [1], [10], [11])
488 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
489 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
490 (
491 for i in `seq 0 2`;
492     do
493     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)"
494     AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
495     done
496 )
497 AT_CHECK([ovs-appctl revalidator/purge], [0])
498 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
499 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
500  group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=3,byte_count=180
501 OFPST_GROUP reply (OF1.2):
502 ])
503 OVS_VSWITCHD_STOP
504 AT_CLEANUP
505
506 AT_SETUP([ofproto-dpif - registers])
507 OVS_VSWITCHD_START
508 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
509 AT_DATA([flows.txt], [dnl
510 in_port=90                 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
511 in_port=91                 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
512 in_port=92                 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
513 in_port=93                 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
514
515 in_port=2                  actions=load:0x000db000->NXM_NX_REG0[[]]
516 in_port=3                  actions=load:0xdea->NXM_NX_REG0[[20..31]]
517 in_port=4                  actions=load:0xeef->NXM_NX_REG0[[0..11]]
518 in_port=5                  actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
519 in_port=6                  actions=load:0x22222222->NXM_NX_REG2[[]]
520 in_port=7                  actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
521 in_port=8                  actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
522 in_port=9,reg0=0xdeadbeef  actions=output:20
523 in_port=10,reg1=0xdeadbeef actions=output:21
524 in_port=11,reg2=0xeef22dea actions=output:22
525
526 dnl Sanilty check all registers
527 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
528 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
529 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
530 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
531
532 ])
533 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
534 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])
535 AT_CHECK([tail -1 stdout], [0],
536   [Datapath actions: 20,21,22,33
537 ])
538 OVS_VSWITCHD_STOP
539 AT_CLEANUP
540
541 dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
542 dnl in the manner documented in ovs-ofctl(8).
543 AT_SETUP([ofproto-dpif - extended registers])
544 OVS_VSWITCHD_START
545 ADD_OF_PORTS([br0], [1], [2], [3])
546 AT_DATA([flows.txt], [dnl
547 table=0     actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
548 table=1,reg2=0xfedcba98,reg3=0x76543210   actions=2
549
550 # These low-priority rules shouldn't match.  They're here only to make really
551 # sure that the test fails if either of the above rules fails to match.
552 table=0,priority=0                        actions=3
553 table=1,priority=0                        actions=3
554 ])
555 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
556 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])
557 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
558 ])
559 OVS_VSWITCHD_STOP
560 AT_CLEANUP
561
562 AT_SETUP([ofproto-dpif - load and move order])
563 OVS_VSWITCHD_START
564 ADD_OF_PORTS([br0], [1], [10], [11])
565 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'])
566 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)'])
567 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])
568 AT_CHECK([tail -2 stdout], [0],
569   [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
570 Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
571 ])
572 OVS_VSWITCHD_STOP
573 AT_CLEANUP
574
575 dnl Tests that 1.5 copy-field can copy into the standardized xregs.
576 AT_SETUP([ofproto-dpif - copy-field into extended registers])
577 OVS_VSWITCHD_START
578 ADD_OF_PORTS([br0], [1], [2], [3])
579 AT_DATA([flows.txt], [dnl
580 table=0     actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
581 table=1,xreg0=0x0000505400000005   actions=2
582
583 # These low-priority rules shouldn't match.  They're here only to make really
584 # sure that the test fails if either of the above rules fails to match.
585 table=0,priority=0                        actions=3
586 table=1,priority=0                        actions=3
587 ])
588 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
589 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])
590 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
591 ])
592 OVS_VSWITCHD_STOP
593 AT_CLEANUP
594
595 dnl Tests that 1.5 set-field with mask in the metadata register.
596 AT_SETUP([ofproto-dpif - masked set-field into metadata])
597 OVS_VSWITCHD_START
598 ADD_OF_PORTS([br0], [1], [2], [3])
599 AT_DATA([flows.txt], [dnl
600 table=0     actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1)
601 table=1     actions=set_field:0x6b/0xff->metadata,goto_table(2)
602 table=2,metadata=0xfafafafa5a5a5a6b  actions=2
603
604 # These low-priority rules shouldn't match.  They're here only to make really
605 # sure that the test fails if either of the above rules fails to match.
606 table=0,priority=0                        actions=3
607 table=1,priority=0                        actions=3
608 table=2,priority=0                        actions=3
609 ])
610 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
611 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])
612 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
613 ])
614 OVS_VSWITCHD_STOP
615 AT_CLEANUP
616
617
618 AT_SETUP([ofproto-dpif - actset_output])
619 OVS_VSWITCHD_START
620 ADD_OF_PORTS(
621   [br0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13])
622 AT_DATA([flows.txt], [dnl
623 table=0,actset_output=unset     actions=write_actions(output(2)),goto_table(1)
624 table=1     actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
625
626 # Verify that actset_output got set.
627 table=2,priority=20,actset_output=2  actions=4,goto_table(3)
628 table=2,priority=10                  actions=5,goto_table(3)
629
630 # Verify that xreg0 got copied properly from actset_output.
631 table=3,priority=20,xreg0=2  actions=6,goto_table(4)
632 table=3,priority=10          actions=7,goto_table(4)
633
634 # Verify that adding a group action unsets actset_output,
635 # even if output follows group.
636 table=4 actions=write_actions(group(5),output(10)),goto_table(5)
637 table=5,priority=20,actset_output=unset  actions=8,goto_table(6)
638 table=5,priority=10                      actions=9,goto_table(6)
639
640 # Verify that adding another output action doesn't change actset_output
641 # (since there's still a group).
642 table=6 actions=write_actions(output(3)),goto_table(7)
643 table=7,priority=20,actset_output=unset  actions=10,goto_table(8)
644 table=7,priority=10                      actions=11,goto_table(8)
645
646 # Verify that clearing the action set, then writing an output action,
647 # causes actset_output to be set again.
648 table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
649 table=9,priority=20,actset_output=2 actions=12
650 table=9,priority=10                 actions=13
651 ])
652 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
653 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
654 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
655 ])
656 OVS_VSWITCHD_STOP
657 AT_CLEANUP
658 AT_SETUP([ofproto-dpif - push-pop])
659 OVS_VSWITCHD_START
660 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
661 AT_DATA([flows.txt], [dnl
662 in_port=90           actions=load:20->NXM_NX_REG0[[0..7]],load:21->NXM_NX_REG1[[0..7]],load:22->NXM_NX_REG2[[0..7]], load:33->NXM_NX_REG3[[0..7]], push:NXM_NX_REG0[[]], push:NXM_NX_REG1[[0..7]],push:NXM_NX_REG2[[0..15]], push:NXM_NX_REG3[[]], resubmit:2, resubmit:3, resubmit:4, resubmit:5
663 in_port=2            actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
664 in_port=3            actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
665 in_port=4            actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
666 in_port=5            actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
667
668 ])
669 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
670 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
671 AT_CHECK([tail -1 stdout], [0],
672   [Datapath actions: 33,22,21,20
673 ])
674 OVS_VSWITCHD_STOP
675 AT_CLEANUP
676
677 AT_SETUP([ofproto-dpif - output])
678 OVS_VSWITCHD_START
679 ADD_OF_PORTS([br0], [1], [9], [10], [11], [55], [66], [77], [88])
680 AT_DATA([flows.txt], [dnl
681 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
682 in_port=2 actions=output:9
683 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
684 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
685 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
686 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
687 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
688 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
689 ])
690 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
691 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
692 AT_CHECK([tail -1 stdout], [0],
693   [Datapath actions: 9,55,10,55,66,11,77,88,9,1
694 ])
695 OVS_VSWITCHD_STOP
696 AT_CLEANUP
697
698 AT_SETUP([ofproto-dpif - dec_ttl])
699 OVS_VSWITCHD_START
700 ADD_OF_PORTS([br0], [1], [2], [3], [4])
701 AT_DATA([flows.txt], [dnl
702 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
703 table=1 in_port=1 action=dec_ttl,output:3
704 ])
705 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
706 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
707 AT_CHECK([tail -4 stdout], [0],
708   [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=2,nw_frag=no
709 Datapath actions: set(ipv4(ttl=1)),2,4
710 This flow is handled by the userspace slow path because it:
711         - Sends "packet-in" messages to the OpenFlow controller.
712 ])
713 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'], [0], [stdout])
714 AT_CHECK([tail -2 stdout], [0],
715   [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=3,nw_frag=no
716 Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
717 ])
718 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'], [0], [stdout])
719 AT_CHECK([tail -2 stdout], [0],
720   [Megaflow: recirc_id=0,ipv6,in_port=1,nw_ttl=128,nw_frag=no
721 Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
722 ])
723
724 AT_CAPTURE_FILE([ofctl_monitor.log])
725 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
726 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
727 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
728 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
729 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
730 ip,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1
731 ])
732 OVS_VSWITCHD_STOP
733 AT_CLEANUP
734
735 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
736 dnl buffer to be resized just before pushing the id of the dec_ttl action.
737 dnl Thus the implementation must account for this by using the
738 dnl reallocated buffer rather than the original buffer.
739 dnl
740 dnl A number of similar rules are added to try and exercise
741 dnl xrealloc sufficiently that it returns a different base pointer
742 AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
743 OVS_VSWITCHD_START
744 ADD_OF_PORTS([br0], [1])
745 (for i in `seq 0 255`; do
746   printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
747  done) > flows.txt
748 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
749 OVS_VSWITCHD_STOP
750 AT_CLEANUP
751
752 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
753 dnl buffer to be resized just before pushing the id of the dec_ttl action.
754 dnl Thus the implementation must account for this by using the
755 dnl reallocated buffer rather than the original buffer.
756 dnl
757 dnl A number of similar rules are added to try and exercise
758 dnl xrealloc sufficiently that it returns a different base pointer
759 AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
760 OVS_VSWITCHD_START
761 ADD_OF_PORTS([br0], [1])
762 (for i in `seq 0 255`; do
763   printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
764  done) > flows.txt
765 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
766 OVS_VSWITCHD_STOP
767 AT_CLEANUP
768
769 dnl A note action at offset 24 in ofpacts will cause the ofpacts
770 dnl buffer to be resized just before pushing the id of the dec_ttl action.
771 dnl Thus the implementation must account for this by using the
772 dnl reallocated buffer rather than the original buffer.
773 dnl
774 dnl A number of similar rules are added to try and exercise
775 dnl xrealloc sufficiently that it returns a different base pointer
776 AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
777 OVS_VSWITCHD_START
778 ADD_OF_PORTS([br0], [1])
779 (for i in `seq 0 255`; do
780   printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
781  done) > flows.txt
782 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
783 OVS_VSWITCHD_STOP
784 AT_CLEANUP
785
786 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
787 OVS_VSWITCHD_START
788 ADD_OF_PORTS([br0], [1], [2])
789
790 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
791
792 # "in_port" defaults to OFPP_NONE if it's not specified.
793 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,icmp_type=8,icmp_code=0"
794 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
795 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
796 1
797 2
798 100
799 ])
800
801 OVS_VSWITCHD_STOP
802 AT_CLEANUP
803
804 AT_SETUP([ofproto-dpif - DSCP])
805 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
806 ADD_OF_PORTS([br0], [9])
807 AT_DATA([flows.txt], [dnl
808 actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL
809 ])
810 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
811 AT_CHECK([ovs-vsctl -- \
812         set Port p1 qos=@newqos --\
813         --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
814         --id=@q1 create Queue dscp=1 --\
815         --id=@q2 create Queue dscp=2], [0], [ignore])
816 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
817 AT_CHECK([tail -2 stdout], [0],
818   [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no
819 Datapath actions: dnl
820 100,dnl
821 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
822 set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
823 1,dnl
824 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
825 set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
826 set(ipv4(tos=0/0xfc)),1,100
827 ])
828 OVS_VSWITCHD_STOP
829 AT_CLEANUP
830
831 AT_SETUP([ofproto-dpif - output/flood flags])
832 OVS_VSWITCHD_START
833 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
834
835 AT_DATA([flows.txt], [dnl
836 in_port=local actions=local,flood
837 in_port=1 actions=flood
838 in_port=2 actions=all
839 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
840 in_port=4 actions=enqueue:LOCAL:1,enqueue:1:1,enqueue:2:1,enqueue:3:2,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1
841 ])
842 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
843 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
844 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
845
846 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
847 AT_CHECK([tail -1 stdout \
848 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
849 1
850 2
851 3
852 4
853 7
854 ])
855
856 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
857 AT_CHECK([tail -1 stdout \
858 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
859 100
860 2
861 3
862 4
863 7
864 ])
865
866 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
867 AT_CHECK([tail -1 stdout \
868 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
869 1
870 100
871 3
872 4
873 6
874 7
875 ])
876
877 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
878 AT_CHECK([tail -1 stdout], [0],
879   [Datapath actions: 100,1,2,4,6,7
880 ])
881
882 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
883 AT_CHECK([tail -1 stdout], [0],
884   [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
885 ])
886 OVS_VSWITCHD_STOP
887 AT_CLEANUP
888
889 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
890 OVS_VSWITCHD_START([dnl
891    add-port br0 p1 -- set Interface p1 type=dummy
892 ])
893 on_exit 'kill `cat ovs-ofctl.pid`'
894
895 AT_CAPTURE_FILE([ofctl_monitor.log])
896
897 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
898
899 for i in 1 2 3 ; do
900     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(syn)'
901 done
902 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
903 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
904 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
905 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
906 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
907 dnl
908 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
909 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
910 dnl
911 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
912 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
913 ])
914
915 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
916 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
917 NXST_FLOW reply:
918 ])
919
920 OVS_VSWITCHD_STOP
921 AT_CLEANUP
922
923 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
924 OVS_VSWITCHD_START([dnl
925    add-port br0 p1 -- set Interface p1 type=dummy
926 ])
927 on_exit 'kill `cat ovs-ofctl.pid`'
928
929 AT_CAPTURE_FILE([ofctl_monitor.log])
930 AT_CHECK([ovs-ofctl del-flows br0])
931
932 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
933
934 dnl Test that missed packets are droped
935 for i in 1 2 3 ; do
936     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack,syn)'
937 done
938 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
939
940 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
941 ])
942
943 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
944 AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
945 OFPST_FLOW reply (OF1.3):
946 ])
947
948 OVS_VSWITCHD_STOP
949 AT_CLEANUP
950
951 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
952 OVS_VSWITCHD_START([dnl
953    add-port br0 p1 -- set Interface p1 type=dummy
954 ])
955 on_exit 'kill `cat ovs-ofctl.pid`'
956
957 AT_CAPTURE_FILE([ofctl_monitor.log])
958 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
959
960 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
961
962 for i in 1 2 3 ; do
963     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(urg|rst)'
964 done
965 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
966 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
967 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
968 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
969 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
970 dnl
971 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
972 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
973 dnl
974 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
975 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
976 ])
977
978 AT_CHECK([ovs-appctl revalidator/purge], [0])
979 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
980  n_packets=3, n_bytes=180, actions=goto_table:1
981 OFPST_FLOW reply (OF1.2):
982 ])
983
984 OVS_VSWITCHD_STOP
985 AT_CLEANUP
986
987 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
988 OVS_VSWITCHD_START([dnl
989    add-port br0 p1 -- set Interface p1 type=dummy
990 ])
991 on_exit 'kill `cat ovs-ofctl.pid`'
992
993 AT_CAPTURE_FILE([ofctl_monitor.log])
994 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
995
996 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
997
998 for i in 1 2 3 ; do
999     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1000 done
1001
1002 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1003 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1004 ])
1005
1006 AT_CHECK([ovs-appctl revalidator/purge], [0])
1007 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1008  n_packets=3, n_bytes=180, actions=resubmit(1,1)
1009 OFPST_FLOW reply (OF1.2):
1010 ])
1011
1012 OVS_VSWITCHD_STOP
1013 AT_CLEANUP
1014
1015 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
1016 OVS_VSWITCHD_START([dnl
1017    add-port br0 p1 -- set Interface p1 type=dummy
1018 ])
1019 on_exit 'kill `cat ovs-ofctl.pid`'
1020
1021 AT_CAPTURE_FILE([ofctl_monitor.log])
1022 AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
1023 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1024
1025 dnl Miss table 0, Hit table 1
1026 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1027
1028 for i in 1 2 3 ; do
1029     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1030 done
1031 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1032 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1033
1034 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1035 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1036 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1037 dnl
1038 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1039 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1040 dnl
1041 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1042 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1043 ])
1044
1045 dnl Hit table 0, Miss all other tables, sent to controller
1046 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1047
1048 for i in 1 2 3 ; do
1049     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1050 done
1051 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1052 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1053
1054 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1055 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1056 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1057 dnl
1058 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1059 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1060 dnl
1061 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1062 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1063 ])
1064
1065 AT_CHECK([ovs-appctl revalidator/purge], [0])
1066 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1067  table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1068 OFPST_FLOW reply (OF1.2):
1069 ])
1070
1071 OVS_VSWITCHD_STOP
1072 AT_CLEANUP
1073
1074 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
1075 OVS_VSWITCHD_START([dnl
1076    add-port br0 p1 -- set Interface p1 type=dummy
1077 ])
1078 on_exit 'kill `cat ovs-ofctl.pid`'
1079
1080 AT_CAPTURE_FILE([ofctl_monitor.log])
1081 AT_DATA([flows.txt], [dnl
1082 table=0 actions=goto_table(1)
1083 table=2 dl_src=10:11:11:11:11:11 actions=controller
1084 ])
1085 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1086 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1087
1088 dnl Hit table 0, Miss table 1, Hit table 2
1089 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1090
1091 for i in 1 2 3 ; do
1092     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1093 done
1094 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1095 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1096
1097 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1098 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1099 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1100 dnl
1101 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1102 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1103 dnl
1104 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1105 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1106 ])
1107
1108 dnl Hit table 1, Miss all other tables, sent to controller
1109 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1110
1111 for i in 1 2 3 ; do
1112     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1113 done
1114 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1115 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1116
1117 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1118 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1119 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1120 dnl
1121 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1122 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1123 dnl
1124 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1125 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1126 ])
1127
1128 AT_CHECK([ovs-appctl revalidator/purge], [0])
1129 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1130  n_packets=6, n_bytes=360, actions=goto_table:1
1131  table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1132 OFPST_FLOW reply (OF1.2):
1133 ])
1134
1135 OVS_VSWITCHD_STOP
1136 AT_CLEANUP
1137
1138 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1139 OVS_VSWITCHD_START([dnl
1140    add-port br0 p1 -- set Interface p1 type=dummy
1141 ])
1142 on_exit 'kill `cat ovs-ofctl.pid`'
1143
1144 AT_CAPTURE_FILE([ofctl_monitor.log])
1145 AT_DATA([flows.txt], [dnl
1146 table=0 actions=resubmit(1,1)
1147 table=2 dl_src=10:11:11:11:11:11 actions=controller
1148 ])
1149 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1150 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1151
1152 dnl Hit table 0, Miss table 1, Dropped
1153 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1154
1155 for i in 1 2 3 ; do
1156     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1157 done
1158 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1159
1160 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1161 ])
1162
1163 dnl Hit table 1, Dropped
1164 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1165
1166 for i in 1 2 3 ; do
1167     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1168 done
1169 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1170
1171 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1172 ])
1173
1174 AT_CHECK([ovs-appctl revalidator/purge], [0])
1175 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1176  n_packets=6, n_bytes=360, actions=resubmit(1,1)
1177  table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1178 OFPST_FLOW reply (OF1.2):
1179 ])
1180
1181 OVS_VSWITCHD_STOP
1182 AT_CLEANUP
1183
1184 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1185 OVS_VSWITCHD_START([dnl
1186    add-port br0 p1 -- set Interface p1 type=dummy
1187 ])
1188 on_exit 'kill `cat ovs-ofctl.pid`'
1189
1190 AT_CAPTURE_FILE([ofctl_monitor.log])
1191 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1192
1193 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1194
1195 dnl Test that missed packets are droped
1196 for i in 1 2 3 ; do
1197     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1198 done
1199 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1200
1201 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1202 ])
1203
1204 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1205 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1206 NXST_FLOW reply:
1207 ])
1208
1209 OVS_VSWITCHD_STOP
1210 AT_CLEANUP
1211
1212 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1213 OVS_VSWITCHD_START([dnl
1214    add-port br0 p1 -- set Interface p1 type=dummy
1215 ])
1216 on_exit 'kill `cat ovs-ofctl.pid`'
1217
1218 AT_CAPTURE_FILE([ofctl_monitor.log])
1219 AT_CHECK([ovs-ofctl del-flows br0])
1220 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1221 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1222
1223 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1224
1225 dnl Test that missed packets are droped
1226 for i in 1 2 3 ; do
1227     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1228 done
1229 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1230
1231 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1232 ])
1233
1234 AT_CHECK([ovs-appctl revalidator/purge], [0])
1235 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1236  n_packets=3, n_bytes=180, actions=goto_table:1
1237 OFPST_FLOW reply (OF1.2):
1238 ])
1239
1240 OVS_VSWITCHD_STOP
1241 AT_CLEANUP
1242
1243 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1244 OVS_VSWITCHD_START([dnl
1245    add-port br0 p1 -- set Interface p1 type=dummy
1246 ])
1247 on_exit 'kill `cat ovs-ofctl.pid`'
1248
1249 AT_CAPTURE_FILE([ofctl_monitor.log])
1250 AT_CHECK([ovs-ofctl del-flows br0])
1251 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1252 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1253
1254 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1255
1256 dnl Test that missed packets are droped
1257 for i in 1 2 3 ; do
1258     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1259 done
1260 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1261
1262 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1263 ])
1264
1265 AT_CHECK([ovs-appctl revalidator/purge], [0])
1266 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1267  n_packets=3, n_bytes=180, actions=resubmit(1,1)
1268 OFPST_FLOW reply (OF1.2):
1269 ])
1270
1271 OVS_VSWITCHD_STOP
1272 AT_CLEANUP
1273
1274 AT_SETUP([ofproto-dpif - controller])
1275 OVS_VSWITCHD_START([dnl
1276    add-port br0 p1 -- set Interface p1 type=dummy
1277 ])
1278 on_exit 'kill `cat ovs-ofctl.pid`'
1279
1280 AT_CAPTURE_FILE([ofctl_monitor.log])
1281 AT_DATA([flows.txt], [dnl
1282 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1283 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1284 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1285
1286 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1287 cookie=0x4 table=2 in_port=81 actions=load:2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,controller,resubmit(82,3)
1288 cookie=0x5 table=3 in_port=82 actions=load:3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,controller,resubmit(83,4)
1289 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1290 cookie=0x7 table=5 in_port=84 actions=load:5->NXM_NX_REG4[[]],load:6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,controller,resubmit(85,6)
1291 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1292 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1293 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1294 cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[[]],controller,load:0xc0a88001->OXM_OF_ARP_SPA[[]],controller,load:0x404444444441->OXM_OF_ARP_THA[[]],load:0x01010101->OXM_OF_ARP_SPA[[]],load:0x02020202->OXM_OF_ARP_TPA[[]],controller
1295 ])
1296 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1297
1298 dnl Flow miss.
1299 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1300
1301 for i in 1 2 3 ; do
1302     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1303 done
1304 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1305 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1306
1307 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1308 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1309 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1310 dnl
1311 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1312 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1313 dnl
1314 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1315 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1316 ])
1317
1318 dnl Singleton controller action.
1319 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1320
1321 for i in 1 2 3 ; do
1322     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
1323 done
1324 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1325 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1326
1327 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1328 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1329 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1330 dnl
1331 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1332 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1333 dnl
1334 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1335 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1336 ])
1337
1338 dnl Modified controller action.
1339 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1340
1341 for i in 1 2 3 ; do
1342     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=30:33:33:33:33:33,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x001)'
1343 done
1344 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1345 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1346
1347 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1348 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1349 tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1350 dnl
1351 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1352 tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1353 dnl
1354 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1355 tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1356 ])
1357
1358 dnl Modified VLAN controller action.
1359 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1360
1361 for i in 1 2 3; do
1362     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:41,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1363 done
1364 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1365 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1366
1367 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1368 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1369 ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1370 dnl
1371 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1372 ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1373 dnl
1374 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1375 ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1376 ])
1377
1378 dnl Checksum TCP.
1379 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1380
1381 for i in 1 ; do
1382     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)'
1383 done
1384 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1385 ovs-appctl -t ovs-ofctl exit
1386
1387 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1388 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1389 tcp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1390 dnl
1391 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1392 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1393 dnl
1394 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=64 (unbuffered)
1395 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1396 dnl
1397 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=64 (unbuffered)
1398 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1399 dnl
1400 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=64 (unbuffered)
1401 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:1a03
1402 dnl
1403 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1404 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:3205
1405 dnl
1406 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1407 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=fin tcp_csum:31b8
1408 dnl
1409 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1410 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
1411 dnl
1412 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1413 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
1414 ])
1415
1416 dnl Checksum UDP.
1417 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1418
1419 for i in 1 ; do
1420     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
1421 done
1422 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1423 ovs-appctl -t ovs-ofctl exit
1424
1425 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1426 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1427 udp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1428 dnl
1429 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1430 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1431 dnl
1432 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=64 (unbuffered)
1433 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1434 dnl
1435 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=64 (unbuffered)
1436 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1437 dnl
1438 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=64 (unbuffered)
1439 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37
1440 dnl
1441 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1442 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439
1443 dnl
1444 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1445 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec
1446 dnl
1447 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1448 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1449 dnl
1450 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1451 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1452 ])
1453
1454 dnl Modified ARP controller action.
1455 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1456
1457 for i in 1 2 3; do
1458     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
1459 done
1460
1461 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1462 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1463 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1464 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1465 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1466 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1467 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1468 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1469 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1470 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1471 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1472 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1473 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1474 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1475 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1476 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1477 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1478 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1479 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1480 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1481 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1482 ])
1483
1484 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1485
1486 dnl Checksum SCTP.
1487 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1488
1489 for i in 1 ; do
1490     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04'
1491 done
1492
1493 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1494 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1495 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1496 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1497 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1498 sctp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1499 dnl
1500 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 reg0=0x1,in_port=1 (via action) data_len=102 (unbuffered)
1501 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1502 dnl
1503 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=102 (unbuffered)
1504 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1505 dnl
1506 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=102 (unbuffered)
1507 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1508 dnl
1509 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=102 (unbuffered)
1510 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1511 dnl
1512 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1513 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1514 dnl
1515 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1516 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:dd778f5f
1517 dnl
1518 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1519 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
1520 dnl
1521 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1522 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
1523 ])
1524
1525 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1526  cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1527  cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1528  cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1529  cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1530  cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1531  cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1532  cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6)
1533  cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1534  cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1535  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1536  cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535
1537  n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1538 NXST_FLOW reply:
1539 ])
1540
1541 OVS_VSWITCHD_STOP
1542 AT_CLEANUP
1543
1544 AT_SETUP([ofproto-dpif - MPLS handling])
1545 OVS_VSWITCHD_START([dnl
1546    add-port br0 p1 -- set Interface p1 type=dummy
1547 ])
1548 on_exit 'kill `cat ovs-ofctl.pid`'
1549
1550 AT_CAPTURE_FILE([ofctl_monitor.log])
1551 AT_DATA([flows.txt], [dnl
1552 cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1553 cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller
1554 cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1555 cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1556 cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller
1557 cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller
1558 cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller
1559 cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller
1560 cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
1561 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1562 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1563 cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller
1564
1565 cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1566 cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1567 cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1568 cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller
1569 cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,OXM_OF_IPV4_SRC[[0..7]]),controller
1570 cookie=0xd dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,OXM_OF_IPV4_SRC[[0..15]],slaves:1,2),controller
1571 cookie=0xd dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,OXM_OF_IPV4_SRC[[]]=OXM_OF_IPV4_DST[[]]),controller
1572
1573 cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1574 cookie=0xd table=1 arp actions=controller
1575
1576 cookie=0xdeadbeef table=2 dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
1577 cookie=0xd dl_src=60:66:66:66:00:09 actions=resubmit(,2),controller
1578 cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1579 cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1580
1581 cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1582 cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1583 cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1584
1585 cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1586 cookie=0xe dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1587 cookie=0xe dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1588
1589 cookie=0xe dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1590 cookie=0xe dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1591 cookie=0xe dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1592
1593 cookie=0xf dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1594 cookie=0xf dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1595 cookie=0xf dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1596
1597 cookie=0x5 dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1598 cookie=0x5 dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1599 cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
1600 ])
1601 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1602
1603 dnl Modified MPLS controller action.
1604 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1605
1606 for i in 1 2 3; do
1607     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=17,tos=0,ttl=64,frag=no),udp(src=7777,dst=80)'
1608 done
1609 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1610 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1611
1612 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1613 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1614 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1615 dnl
1616 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1617 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1618 dnl
1619 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1620 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1621 ])
1622
1623 dnl Modified MPLS controller action.
1624 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1625
1626 for i in 1 2 3; do
1627     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1628 done
1629 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1630 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1631
1632 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1633 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1634 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1635 dnl
1636 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1637 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1638 dnl
1639 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1640 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1641 ])
1642
1643 dnl Modified MPLS controller action.
1644 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1645
1646 dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1)
1647
1648 for i in 1 2 3; do
1649     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:43,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'
1650 done
1651 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1652 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1653
1654 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1655 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1656 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
1657 dnl
1658 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1659 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
1660 dnl
1661 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1662 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
1663 ])
1664
1665 dnl Modified MPLS controller action.
1666 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1667
1668 for i in 1 2 3; do
1669     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))'
1670 done
1671 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1672 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1673
1674 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1675 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1676 mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1677 dnl
1678 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1679 mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1680 dnl
1681 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1682 mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1683 ])
1684
1685 dnl Modified MPLS controller action.
1686 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1687
1688 for i in 1 2 3; do
1689     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:45,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1690 done
1691 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1692 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1693
1694 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1695 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1696 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
1697 dnl
1698 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1699 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
1700 dnl
1701 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1702 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
1703 ])
1704
1705 dnl Modified MPLS controller action.
1706 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1707
1708 for i in 1 2 3; do
1709     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:46,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1710 done
1711 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1712 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1713
1714 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1715 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1716 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1717 dnl
1718 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1719 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1720 dnl
1721 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1722 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1723 ])
1724
1725 dnl Modified MPLS controller action.
1726 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1727
1728 for i in 1 2 3; do
1729     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:47,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1730 done
1731 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1732 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1733
1734 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1735 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1736 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1737 dnl
1738 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1739 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1740 dnl
1741 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1742 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1743 ])
1744
1745 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1746
1747 dnl Modified MPLS controller action.
1748 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1749
1750 for i in 1 2 3; do
1751     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:49,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=64,bos=1)'
1752 done
1753 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1754 ovs-appctl -t ovs-ofctl exit
1755
1756 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1757 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1758 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1759 dnl
1760 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1761 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1762 dnl
1763 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1764 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1765 ])
1766
1767 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1768
1769 dnl Modified MPLS controller action.
1770 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1771
1772 for i in 1 2 3; do
1773     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:48,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1774 done
1775 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1776 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1777
1778 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1779 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1780 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
1781 dnl
1782 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1783 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
1784 dnl
1785 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1786 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
1787 ])
1788
1789 dnl Modified MPLS actions.
1790 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1791
1792 for i in 1 2 3; do
1793     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:55:55:55:55:55,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)'
1794 done
1795 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1796 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1797
1798 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1799 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1800 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
1801 dnl
1802 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1803 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
1804 dnl
1805 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1806 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
1807 ])
1808
1809 dnl Modified MPLS ipv6 controller action.
1810 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1811
1812 for i in 1 2 3; do
1813     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=70:77:77:77:77:77,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'
1814 done
1815 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1816 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1817
1818 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1819 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1820 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
1821 dnl
1822 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1823 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
1824 dnl
1825 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1826 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
1827 ])
1828
1829
1830 dnl Modified MPLS pop action.
1831 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1832 dnl 60:66:66:66:66:66 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
1833 dnl             (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1834
1835 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1836
1837 for i in 1 2 3; do
1838     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 66 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1839 done
1840 #for i in 2 3; do
1841 #    ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=60:66:66:66:66:66,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=100,bos=1)'
1842 #done
1843 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1844 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1845
1846 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1847 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1848 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1849 dnl
1850 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1851 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1852 dnl
1853 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1854 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1855 ])
1856
1857 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1858
1859 dnl Modified MPLS pop action.
1860 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1861 dnl 60:66:66:66:00:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1862 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1863 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1864 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1865
1866 for i in 1 2 3; do
1867     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1868 done
1869 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1870 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1871
1872 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1873 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1874 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1875 dnl
1876 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1877 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1878 dnl
1879 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1880 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1881 ])
1882
1883 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1884
1885 dnl Modified MPLS pop action.
1886 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1887 dnl 60:66:66:66:00:02 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1888 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1889 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1890 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1891
1892 for i in 1 2 3; do
1893     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 02 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1894 done
1895 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1896 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1897
1898 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1899 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1900 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1901 dnl
1902 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1903 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1904 dnl
1905 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1906 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1907 ])
1908
1909 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1910
1911 dnl Modified MPLS pop action.
1912 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1913 dnl 60:66:66:66:00:03 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1914 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1915 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1916 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1917
1918 for i in 1 2 3; do
1919     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 03 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1920 done
1921 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1922 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1923
1924 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1925 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1926 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1927 dnl
1928 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1929 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1930 dnl
1931 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1932 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1933 ])
1934
1935 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1936
1937 dnl Modified MPLS pop action.
1938 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1939 dnl 60:66:66:66:00:04 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1940 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1941 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1942 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1943
1944 for i in 1 2 3; do
1945     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 04 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1946 done
1947 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1948 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1949
1950 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1951 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1952 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1953 dnl
1954 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1955 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1956 dnl
1957 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1958 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1959 ])
1960
1961 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1962
1963 dnl Modified MPLS pop action.
1964 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1965 dnl 60:66:66:66:00:05 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1966 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1967 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1968 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1969
1970 for i in 1 2 3; do
1971     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 05 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1972 done
1973 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1974 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1975
1976 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1977 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1978 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1979 dnl
1980 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1981 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1982 dnl
1983 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1984 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1985 ])
1986
1987 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1988
1989 dnl Modified MPLS pop action.
1990 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1991 dnl 60:66:66:66:00:06 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1992 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1993 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1994 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1995
1996 for i in 1 2 3; do
1997     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 06 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1998 done
1999 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2000 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2001
2002 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2003 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2004 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2005 dnl
2006 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2007 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2008 dnl
2009 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2010 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2011 ])
2012
2013 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2014
2015 dnl Modified MPLS pop action.
2016 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2017 dnl 60:66:66:66:00:07 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2018 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2019 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2020 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2021
2022 for i in 1 2 3; do
2023     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 07 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2024 done
2025 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2026 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2027
2028 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2029 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2030 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2031 dnl
2032 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2033 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2034 dnl
2035 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2036 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2037 ])
2038
2039 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2040
2041 dnl Modified MPLS pop action.
2042 dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
2043 dnl 60:66:66:66:00:08 > ff:ff:ff:ff:ff:ff, ethertype MPLS unicast (0x8847), length 46: MPLS (label 20, exp 0, [S], ttl 32)
2044 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2045
2046 for i in 1 2 3; do
2047     ovs-appctl netdev-dummy/receive p1 'ff ff ff ff ff ff 60 66 66 66 00 08 88 47 00 01 41 20 00 01 08 00 06 04 00 02 60 66 66 66 00 08 c0 a8 00 01 ff ff ff ff ff ff ff ff ff ff'
2048 done
2049 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2050 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2051
2052 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2053 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2054 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2055 dnl
2056 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2057 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2058 dnl
2059 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2060 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2061 ])
2062
2063 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2064
2065 dnl Modified MPLS pop action.
2066 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2067 dnl 60:66:66:66:00:09 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2068 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2069 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2070 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2071
2072 for i in 1 2 3; do
2073     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 09 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2074 done
2075 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2076 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2077
2078 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2079 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2080 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2081 dnl
2082 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2083 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2084 dnl
2085 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2086 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2087 ])
2088
2089 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2090
2091 dnl Modified MPLS pop action.
2092 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2093 dnl 60:66:66:66:00:0a > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2094 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2095 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2096 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2097
2098 for i in 1 2 3; do
2099     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0a 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2100 done
2101 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2102 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2103
2104 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2105 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2106 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2107 dnl
2108 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2109 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2110 dnl
2111 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2112 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2113 ])
2114
2115 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2116
2117 dnl Modified MPLS pop action.
2118 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2119 dnl 60:66:66:66:00:0b > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2120 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2121 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2122 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2123
2124 for i in 1 2 3; do
2125     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0b 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2126 done
2127 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2128 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2129
2130 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2131 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2132 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2133 dnl
2134 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2135 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2136 dnl
2137 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2138 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2139 ])
2140
2141 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2142
2143 dnl Modified MPLS pop action.
2144 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2145 dnl 60:66:66:66:01:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2146 dnl             (label 20, exp 0, [S], ttl 31)
2147 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2148 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2149 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2150
2151 for i in 1 2 3; do
2152     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 00 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2153 done
2154 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2155 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2156
2157 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2158 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2159 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2160 dnl
2161 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2162 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2163 dnl
2164 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2165 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2166 ])
2167
2168 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2169
2170 dnl Modified MPLS pop action.
2171 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2172 dnl 60:66:66:66:01:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2173 dnl             (label 20, exp 0, [S], ttl 31)
2174 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2175 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2176 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2177
2178 for i in 1 2 3; do
2179     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 01 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2180 done
2181 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2182 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2183
2184 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2185 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2186 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2187 dnl
2188 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2189 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2190 dnl
2191 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2192 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2193 ])
2194
2195 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2196
2197 dnl Modified MPLS pop action.
2198 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2199 dnl 60:66:66:66:01:02 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2200 dnl             (label 20, exp 0, [S], ttl 31)
2201 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2202 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2203 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2204
2205 for i in 1 2 3; do
2206     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 02 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2207 done
2208 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2209 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2210
2211 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2212 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2213 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2214 dnl
2215 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2216 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2217 dnl
2218 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2219 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2220 ])
2221
2222 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2223
2224 dnl Modified MPLS pop action.
2225 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2226 dnl 60:66:66:66:02:00 > 50:54:00:00:02:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2227 dnl             (label 20, exp 0, [S], ttl 31)
2228 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2229 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2230 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2231
2232 for i in 1 2 3; do
2233     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 00 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2234 done
2235 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2236 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2237
2238 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2239 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2240 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2241 dnl
2242 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2243 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2244 dnl
2245 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2246 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2247 ])
2248
2249 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2250
2251 dnl Modified MPLS pop action.
2252 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2253 dnl 60:66:66:66:02:01 > 50:54:00:00:02:01, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2254 dnl             (label 20, exp 0, [S], ttl 31)
2255 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2256 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2257 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2258
2259 for i in 1 2 3; do
2260     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 01 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2261 done
2262
2263 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2264 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2265
2266 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2267 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2268 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2269 dnl
2270 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2271 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2272 dnl
2273 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2274 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2275 ])
2276
2277 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2278
2279 dnl Modified MPLS pop action.
2280 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2281 dnl 60:66:66:66:02:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2282 dnl             (label 20, exp 0, [S], ttl 31)
2283 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2284 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2285 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2286
2287 for i in 1 2 3; do
2288     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 10 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2289 done
2290 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2291 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2292
2293 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2294 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2295 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2296 dnl
2297 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2298 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2299 dnl
2300 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2301 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2302 ])
2303
2304 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2305
2306 dnl Modified MPLS pop action.
2307 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2308 dnl 60:66:66:66:03:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2309 dnl             (label 20, exp 0, ttl 31)
2310 dnl             (label 20, exp 0, [S], ttl 30)
2311 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2312 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2313 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2314
2315 for i in 1 2 3; do
2316     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 00 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2317 done
2318 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2319 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2320
2321 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2322 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2323 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2324 dnl
2325 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2326 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2327 dnl
2328 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2329 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2330 ])
2331
2332 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2333
2334 dnl Modified MPLS pop action.
2335 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2336 dnl 60:66:66:66:03:01 > 50:54:00:00:00:00, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2337 dnl             (label 20, exp 0, ttl 31)
2338 dnl             (label 20, exp 0, [S], ttl 30)
2339 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2340 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2341 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2342
2343 for i in 1 2 3; do
2344     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 01 88 48 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2345 done
2346 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2347 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2348
2349 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2350 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2351 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2352 dnl
2353 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2354 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2355 dnl
2356 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2357 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2358 ])
2359
2360 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2361
2362 dnl Modified MPLS pop action.
2363 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2364 dnl 60:66:66:66:03:10 > 50:54:00:00:00:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2365 dnl             (label 20, exp 0, ttl 31)
2366 dnl             (label 20, exp 0, [S], ttl 30)
2367 dnl             (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2368 dnl        192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2369 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2370
2371 for i in 1 2 3; do
2372     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 10 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2373 done
2374 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2375 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2376
2377 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2378 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2379 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2380 dnl
2381 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2382 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2383 dnl
2384 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2385 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2386 ])
2387
2388 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2389
2390 dnl Modified MPLS pop action.
2391 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2392 dnl 60:66:66:66:04:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2393 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2394 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2395 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2396
2397 for i in 1 2 3; do
2398     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 00 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2399 done
2400 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2401 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2402
2403 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2404 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2405 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2406 dnl
2407 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2408 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2409 dnl
2410 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2411 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2412 ])
2413
2414 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2415
2416 dnl Modified MPLS pop action.
2417 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2418 dnl 60:66:66:66:04:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2419 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2420 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2421 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2422
2423 for i in 1 2 3; do
2424     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 01 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2425 done
2426 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2427 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2428
2429 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2430 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2431 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2432 dnl
2433 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2434 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2435 dnl
2436 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2437 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2438 ])
2439
2440 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2441
2442 dnl Modified MPLS pop action.
2443 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2444 dnl 60:66:66:66:04:10 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2445 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2446 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2447 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2448
2449 for i in 1 2 3; do
2450     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 10 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2451 done
2452 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2453 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2454
2455 AT_CHECK([STRIP_METADATA  ofctl_monitor.log], [0], [dnl
2456 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2457 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2458 dnl
2459 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2460 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2461 dnl
2462 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2463 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2464 ])
2465
2466 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2467
2468 dnl Modified MPLS pop action.
2469 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2470 dnl 60:66:66:66:05:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2471 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2472 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2473 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2474
2475 for i in 1 2 3; do
2476     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 00 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2477 done
2478
2479 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2480 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2481
2482 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2483 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2484 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2485 dnl
2486 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2487 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2488 dnl
2489 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2490 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2491 ])
2492
2493 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2494
2495 dnl Modified MPLS pop action.
2496 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2497 dnl 60:66:66:66:05:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2498 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2499 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2500 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2501
2502 for i in 1 2 3; do
2503     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2504 done
2505 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2506 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2507
2508 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2509 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2510 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2511 dnl
2512 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2513 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2514 dnl
2515 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2516 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2517 ])
2518
2519 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2520
2521 dnl Modified MPLS pop action.
2522 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2523 dnl 60:66:66:66:05:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2524 dnl             (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2525 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2526 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2527
2528 for i in 1 2 3; do
2529     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 10 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2530 done
2531
2532 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2533 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2534
2535 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2536 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2537 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2538 dnl
2539 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2540 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2541 dnl
2542 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2543 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2544 ])
2545
2546 AT_CHECK([ovs-appctl revalidator/purge], [0])
2547 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2548  cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,CONTROLLER:65535
2549  cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2550  cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2551  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2552  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2553  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2554  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,CONTROLLER:65535
2555  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),CONTROLLER:65535
2556  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535
2557  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535
2558  cookie=0xa, n_packets=3, n_bytes=180, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,CONTROLLER:65535
2559  cookie=0xa, n_packets=3, n_bytes=180, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2560  cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2561  cookie=0xc, n_packets=3, n_bytes=180, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[[]],load:0x7->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2562  cookie=0xd, n_packets=3, n_bytes=180, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2563  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2564  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->NXM_OF_IP_DST[[]],CONTROLLER:65535
2565  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:NXM_OF_IP_DST[[]]->NXM_OF_IP_SRC[[]],CONTROLLER:65535
2566  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:NXM_OF_IP_DST[[]],pop:NXM_OF_IP_SRC[[]],CONTROLLER:65535
2567  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,NXM_OF_IP_SRC[[0..7]]),CONTROLLER:65535
2568  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,NXM_OF_IP_SRC[[0..15]],slaves:1,2),CONTROLLER:65535
2569  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]]),CONTROLLER:65535
2570  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=resubmit(,2),CONTROLLER:65535
2571  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,CONTROLLER:65535
2572  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,CONTROLLER:65535
2573  cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
2574  cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2575  cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2576  cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2577  cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,CONTROLLER:65535
2578  cookie=0xd, table=1, n_packets=3, n_bytes=168, arp actions=CONTROLLER:65535
2579  cookie=0xdeadbeef, table=2, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
2580  cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2581  cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2582  cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,CONTROLLER:65535
2583  cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2584  cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2585  cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,CONTROLLER:65535
2586  cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2587  cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2588 NXST_FLOW reply:
2589 ])
2590
2591 OVS_VSWITCHD_STOP
2592 AT_CLEANUP
2593
2594 AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2595 OVS_VSWITCHD_START([dnl
2596    add-port br0 p1 -- set Interface p1 type=dummy
2597 ])
2598 on_exit 'kill `cat ovs-ofctl.pid`'
2599
2600 AT_CAPTURE_FILE([ofctl_monitor.log])
2601 AT_DATA([flows.txt], [dnl
2602 table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2603 table=1 ip,ip_dscp=8 actions=controller
2604 ])
2605 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2606
2607
2608 dnl Modified MPLS pop action.
2609 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2610 dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2611 dnl             (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2612 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2613 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2614
2615 for i in 1 2 3; do
2616     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2617 done
2618 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2619 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2620
2621 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2622 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2623 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2624 dnl
2625 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2626 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2627 dnl
2628 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2629 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2630 ])
2631
2632 AT_CHECK([ovs-appctl revalidator/purge], [0])
2633 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2634  n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
2635  table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
2636 OFPST_FLOW reply (OF1.2):
2637 ])
2638
2639 OVS_VSWITCHD_STOP
2640 AT_CLEANUP
2641
2642 AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
2643 OVS_VSWITCHD_START([dnl
2644    add-port br0 p1 -- set Interface p1 type=dummy
2645 ])
2646 on_exit 'kill `cat ovs-ofctl.pid`'
2647
2648 dnl N.B: The first (and only) action that accesses L3 data after the
2649 dnl pop_mpls action is present in write_actions. This exercises recirculation
2650 dnl triggered in write_actions due to a previous action not in write actions.
2651 AT_CAPTURE_FILE([ofctl_monitor.log])
2652 AT_DATA([flows.txt], [dnl
2653 mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
2654 ])
2655 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2656
2657 dnl Modified MPLS pop action.
2658 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2659 dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2660 dnl             (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2661 dnl         192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2662 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2663
2664 for i in 1 2 3; do
2665     ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2666 done
2667 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2668 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2669
2670 AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2671 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2672 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2673 dnl
2674 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2675 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2676 dnl
2677 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2678 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2679 ])
2680
2681 AT_CHECK([ovs-appctl revalidator/purge], [0])
2682 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2683  n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
2684 OFPST_FLOW reply (OF1.2):
2685 ])
2686
2687 OVS_VSWITCHD_STOP
2688 AT_CLEANUP
2689
2690 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
2691 OVS_VSWITCHD_START([dnl
2692    add-port br0 p1 -- set Interface p1 type=dummy
2693 ])
2694 on_exit 'kill `cat ovs-ofctl.pid`'
2695
2696 AT_CAPTURE_FILE([ofctl_monitor.log])
2697 # A table-miss flow has priority 0 and no match
2698 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2699
2700 dnl Singleton controller action.
2701 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2702
2703 for i in 1 2 3 ; do
2704     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2705 done
2706 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2707 ovs-appctl -t ovs-ofctl exit
2708
2709 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2710 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2711 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2712 dnl
2713 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2714 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2715 dnl
2716 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2717 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2718 ])
2719
2720 AT_CHECK([ovs-appctl revalidator/purge], [0])
2721 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2722  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2723 NXST_FLOW reply:
2724 ])
2725
2726 OVS_VSWITCHD_STOP
2727 AT_CLEANUP
2728
2729
2730 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
2731 OVS_VSWITCHD_START([dnl
2732    add-port br0 p1 -- set Interface p1 type=dummy
2733 ])
2734 on_exit 'kill `cat ovs-ofctl.pid`'
2735
2736 AT_CAPTURE_FILE([ofctl_monitor.log])
2737 # A table-miss flow has priority 0 and no match
2738 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2739
2740 dnl Singleton controller action.
2741 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2742
2743 for i in 1 2 3 ; do
2744     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2745 done
2746 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2747 ovs-appctl -t ovs-ofctl exit
2748
2749 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2750
2751 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2752 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2753 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2754 dnl
2755 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2756 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2757 dnl
2758 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2759 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2760 ])
2761
2762 AT_CHECK([ovs-appctl revalidator/purge], [0])
2763 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2764  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2765 OFPST_FLOW reply (OF1.3):
2766 ])
2767
2768 OVS_VSWITCHD_STOP
2769 AT_CLEANUP
2770
2771 AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)])
2772 OVS_VSWITCHD_START([dnl
2773    add-port br0 p1 -- set Interface p1 type=dummy
2774 ])
2775 on_exit 'kill `cat ovs-ofctl.pid`'
2776
2777 ovs-appctl time/stop
2778
2779 AT_CAPTURE_FILE([ofctl_monitor.log])
2780 # A table-miss flow has priority 0 and no match
2781 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2782
2783 dnl Singleton controller action.
2784 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2785
2786 # Become slave (OF 1.3), which should disable everything except port status.
2787 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2788
2789 # Ensure that ovs-vswitchd gets a chance to reply before sending another command.
2790 ovs-appctl time/warp 500 100
2791
2792 # Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
2793 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
2794
2795 ovs-appctl time/warp 500 100
2796 for i in 1 2 3 ; do
2797     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2798 done
2799 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2800 ovs-appctl -t ovs-ofctl exit
2801
2802 AT_CHECK([ovs-appctl revalidator/purge], [0])
2803 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2804 send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1
2805 OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1
2806 dnl
2807 send: OFPT_SET_ASYNC (OF1.3) (xid=0x2):
2808  master:
2809        PACKET_IN: (off)
2810      PORT_STATUS: (off)
2811     FLOW_REMOVED: (off)
2812
2813  slave:
2814        PACKET_IN: no_match
2815      PORT_STATUS: (off)
2816     FLOW_REMOVED: (off)
2817 dnl
2818 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2819 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2820 dnl
2821 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2822 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2823 dnl
2824 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2825 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2826 ])
2827
2828 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2829
2830 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2831  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2832 OFPST_FLOW reply (OF1.3):
2833 ])
2834
2835 OVS_VSWITCHD_STOP
2836 AT_CLEANUP
2837
2838
2839 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)])
2840 OVS_VSWITCHD_START([dnl
2841    add-port br0 p1 -- set Interface p1 type=dummy
2842 ])
2843 on_exit 'kill `cat ovs-ofctl.pid`'
2844
2845 AT_CAPTURE_FILE([ofctl_monitor.log])
2846 # A table-miss flow has priority 0 and no match
2847 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2848
2849 dnl Singleton controller action.
2850 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2851
2852 for i in 1 2 3 ; do
2853     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2854 done
2855 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2856 ovs-appctl -t ovs-ofctl exit
2857
2858 AT_CHECK([ovs-appctl revalidator/purge], [0])
2859 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2860 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2861 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2862 dnl
2863 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2864 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2865 dnl
2866 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2867 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2868 ])
2869
2870 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2871
2872 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2873  n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2874 OFPST_FLOW reply (OF1.4):
2875 ])
2876
2877 OVS_VSWITCHD_STOP
2878 AT_CLEANUP
2879
2880
2881 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
2882 OVS_VSWITCHD_START([dnl
2883    add-port br0 p1 -- set Interface p1 type=dummy
2884 ])
2885 on_exit 'kill `cat ovs-ofctl.pid`'
2886
2887 AT_CAPTURE_FILE([ofctl_monitor.log])
2888 AT_DATA([flows.txt], [dnl
2889 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
2890 table=1 actions=output(CONTROLLER),goto_table(2)
2891 table=2 actions=group:1234
2892 ])
2893 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2894 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flows br0 flows.txt])
2895
2896 dnl Singleton controller action.
2897 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2898
2899 for i in 1 2 3 ; do
2900     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2901 done
2902 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2903 ovs-appctl -t ovs-ofctl exit
2904
2905 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2906
2907 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2908 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2909 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2910 dnl
2911 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2912 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2913 dnl
2914 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2915 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2916 dnl
2917 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2918 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2919 dnl
2920 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2921 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2922 dnl
2923 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2924 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2925 dnl
2926 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2927 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2928 dnl
2929 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2930 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2931 dnl
2932 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2933 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2934 ])
2935
2936 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2937
2938 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2939  n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
2940  table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2
2941  table=2, n_packets=3, n_bytes=180, actions=group:1234
2942 OFPST_FLOW reply (OF1.3):
2943 ])
2944
2945 OVS_VSWITCHD_STOP
2946 AT_CLEANUP
2947
2948
2949 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.4)])
2950 OVS_VSWITCHD_START([dnl
2951    add-port br0 p1 -- set Interface p1 type=dummy
2952 ])
2953 on_exit 'kill `cat ovs-ofctl.pid`'
2954
2955 AT_CAPTURE_FILE([ofctl_monitor.log])
2956 AT_DATA([flows.txt], [dnl
2957 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
2958 table=1 actions=output(CONTROLLER),goto_table(2)
2959 table=2 actions=group:1234
2960 ])
2961 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2962 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flows br0 flows.txt])
2963
2964 dnl Singleton controller action.
2965 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2966
2967 for i in 1 2 3 ; do
2968     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2969 done
2970 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2971 ovs-appctl -t ovs-ofctl exit
2972
2973 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2974
2975 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2976 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2977 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2978 dnl
2979 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2980 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2981 dnl
2982 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
2983 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2984 dnl
2985 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2986 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2987 dnl
2988 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2989 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2990 dnl
2991 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
2992 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2993 dnl
2994 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2995 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2996 dnl
2997 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2998 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2999 dnl
3000 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
3001 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3002 ])
3003
3004 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3005
3006 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3007  n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3008  table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2
3009  table=2, n_packets=3, n_bytes=180, actions=group:1234
3010 OFPST_FLOW reply (OF1.4):
3011 ])
3012
3013 OVS_VSWITCHD_STOP
3014 AT_CLEANUP
3015
3016
3017 AT_SETUP([ofproto-dpif - ARP modification slow-path])
3018 OVS_VSWITCHD_START
3019 ADD_OF_PORTS([br0], [1], [2])
3020
3021 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
3022 ovs-ofctl add-flow br0 'in_port=1,arp actions=load:2->OXM_OF_ARP_OP[[]],2,load:0xc0a88001->OXM_OF_ARP_SPA[[]],2,load:0x404444444441->OXM_OF_ARP_THA[[]],2'
3023
3024 # Input some packets that should follow the arp modification slow-path.
3025 for i in 1 2 3; do
3026     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
3027 done
3028 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3029
3030 # Check the packets that were output.
3031 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
3032 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3033 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3034 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3035 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3036 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3037 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3038 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3039 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3040 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3041 ])
3042
3043 OVS_VSWITCHD_STOP
3044 AT_CLEANUP
3045
3046 AT_SETUP([ofproto-dpif - VLAN handling])
3047 OVS_VSWITCHD_START(
3048   [set Bridge br0 fail-mode=standalone -- \
3049    add-port br0 p1                                  trunks=10,12 -- \
3050    add-port br0 p2                           tag=10              -- \
3051    add-port br0 p3                           tag=12              \
3052                    other-config:priority-tags=true               -- \
3053    add-port br0 p4                           tag=12              -- \
3054    add-port br0 p5 vlan_mode=native-tagged   tag=10              -- \
3055    add-port br0 p6 vlan_mode=native-tagged   tag=10 trunks=10,12 -- \
3056    add-port br0 p7 vlan_mode=native-untagged tag=12              -- \
3057    add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
3058                    other-config:priority-tags=true               -- \
3059    set Interface p1 type=dummy -- \
3060    set Interface p2 type=dummy -- \
3061    set Interface p3 type=dummy -- \
3062    set Interface p4 type=dummy -- \
3063    set Interface p5 type=dummy -- \
3064    set Interface p6 type=dummy -- \
3065    set Interface p7 type=dummy -- \
3066    set Interface p8 type=dummy --])
3067
3068 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
3069 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
3070 dnl actions.
3071 for tuple in \
3072         "100 none 0 drop" \
3073         "100 0    0 drop" \
3074         "100 0    1 drop" \
3075         "100 10   0 1,5,6,7,8,pop_vlan,2" \
3076         "100 10   1 1,5,6,7,8,pop_vlan,2" \
3077         "100 11   0 5,7" \
3078         "100 11   1 5,7" \
3079         "100 12   0 1,5,6,pop_vlan,3,4,7,8" \
3080         "100 12   1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3081         "1  none 0 drop" \
3082         "1  0    0 drop" \
3083         "1  0    1 drop" \
3084         "1  10   0 5,6,7,8,100,pop_vlan,2" \
3085         "1  10   1 5,6,7,8,100,pop_vlan,2" \
3086         "1  11   0 drop" \
3087         "1  11   1 drop" \
3088         "1  12   0 5,6,100,pop_vlan,3,4,7,8" \
3089         "1  12   1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3090         "2  none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3091         "2  0    0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3092         "2  0    1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
3093         "2  10   0 drop" \
3094         "2  10   1 drop" \
3095         "2  11   0 drop" \
3096         "2  11   1 drop" \
3097         "2  12   0 drop" \
3098         "2  12   1 drop" \
3099         "3  none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3100         "3  0    0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3101         "3  0    1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3102         "3  10   0 drop" \
3103         "3  10   1 drop" \
3104         "3  11   0 drop" \
3105         "3  11   1 drop" \
3106         "3  12   0 drop" \
3107         "3  12   1 drop" \
3108         "4  none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3109         "4  0    0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3110         "4  0    1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3111         "4  10   0 drop" \
3112         "4  10   1 drop" \
3113         "4  11   0 drop" \
3114         "4  11   1 drop" \
3115         "4  12   0 drop" \
3116         "4  12   1 drop" \
3117         "5  none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3118         "5  0    0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3119         "5  0    1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
3120         "5  10   0 1,6,7,8,100,pop_vlan,2" \
3121         "5  10   1 1,6,7,8,100,pop_vlan,2" \
3122         "5  11   0 7,100" \
3123         "5  11   1 7,100" \
3124         "5  12   0 1,6,100,pop_vlan,3,4,7,8" \
3125         "5  12   1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3126         "6  none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3127         "6  0    0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3128         "6  0    1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
3129         "6  10   0 1,5,7,8,100,pop_vlan,2" \
3130         "6  10   1 1,5,7,8,100,pop_vlan,2" \
3131         "6  11   0 drop" \
3132         "6  11   1 drop" \
3133         "6  12   0 1,5,100,pop_vlan,3,4,7,8" \
3134         "6  12   1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3135         "7  none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3136         "7  0    0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3137         "7  0    1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
3138         "7  10   0 1,5,6,8,100,pop_vlan,2" \
3139         "7  10   1 1,5,6,8,100,pop_vlan,2" \
3140         "7  11   0 5,100" \
3141         "7  11   1 5,100" \
3142         "7  12   0 1,5,6,100,pop_vlan,3,4,8" \
3143         "7  12   1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
3144         "8  none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3145         "8  0    0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3146         "8  0    1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3147         "8  10   0 1,5,6,7,100,pop_vlan,2" \
3148         "8  10   1 1,5,6,7,100,pop_vlan,2" \
3149         "8  11   0 drop" \
3150         "8  11   1 drop" \
3151         "8  12   0 1,5,6,100,pop_vlan,3,4,7" \
3152         "8  12   1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
3153 do
3154   set $tuple
3155   in_port=$1
3156   vlan=$2
3157   pcp=$3
3158   expected=$4
3159
3160   if test $vlan = none; then
3161     flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
3162   else
3163     flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=$vlan,pcp=$pcp),encap(eth_type(0xabcd))"
3164   fi
3165
3166   echo "----------------------------------------------------------------------"
3167   echo "in_port=$in_port vlan=$vlan pcp=$pcp"
3168
3169   AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3170   actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3171
3172   AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3173   mv stdout expout
3174   AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3175 done
3176
3177 OVS_VSWITCHD_STOP
3178 AT_CLEANUP
3179
3180 AT_SETUP([ofproto-dpif - MPLS handling])
3181 OVS_VSWITCHD_START([dnl
3182    add-port br0 p1 -- set Interface p1 type=dummy
3183 ])
3184 on_exit 'kill `cat ovs-ofctl.pid`'
3185
3186 AT_CAPTURE_FILE([ofctl_monitor.log])
3187 AT_DATA([flows.txt], [dnl
3188 dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
3189 dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
3190 dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
3191 ])
3192 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3193
3194 dnl In this test, we push an MPLS tag to an ethernet packet.
3195 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3196
3197 for i in 1 2 3; do
3198     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:00,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3199 done
3200 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3201 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3202
3203 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3204 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3205 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3206 00000000  50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3207 00000010  01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3208 00000020  00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3209 00000030  00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3210 dnl
3211 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3212 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3213 00000000  50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3214 00000010  01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3215 00000020  00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3216 00000030  00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3217 dnl
3218 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3219 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3220 00000000  50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3221 00000010  01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3222 00000020  00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3223 00000030  00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3224 ])
3225
3226 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3227 dnl copied exactly, except for the BOS bit.
3228 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3229
3230 for i in 1 2 3; do
3231     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:01,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3232 done
3233 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3234 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3235
3236 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3237 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3238 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3239 00000000  50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3240 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3241 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3242 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3243 dnl
3244 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3245 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3246 00000000  50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3247 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3248 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3249 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3250 dnl
3251 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3252 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3253 00000000  50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3254 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3255 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3256 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3257 ])
3258
3259 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3260 dnl copied exactly, except for the BOS bit. The ethertype should be updated
3261 dnl to the MPLS ethertype of the MPLS push action which differs to that
3262 dnl of the input packet.
3263 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3264
3265 for i in 1 2 3; do
3266     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:02,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3267 done
3268 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3269 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
3270
3271 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3272 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3273 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3274 00000000  50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3275 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3276 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3277 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3278 dnl
3279 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3280 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3281 00000000  50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3282 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3283 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3284 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3285 dnl
3286 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3287 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3288 00000000  50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3289 00000010  a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3290 00000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3291 00000030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3292 ])
3293
3294 OVS_VSWITCHD_STOP
3295 AT_CLEANUP
3296
3297 AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
3298 OVS_VSWITCHD_START([dnl
3299    add-port br0 p1 -- set Interface p1 type=dummy
3300 ])
3301 on_exit 'kill `cat ovs-ofctl.pid`'
3302
3303 AT_CAPTURE_FILE([ofctl_monitor.log])
3304 AT_DATA([flows.txt], [dnl
3305 cookie=0xa dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
3306 cookie=0xa dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
3307 cookie=0xa dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
3308 cookie=0xa dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
3309 cookie=0xa dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3310 cookie=0xa dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3311 cookie=0xa dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3312 cookie=0xa dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3313 cookie=0xa dl_src=40:44:44:44:54:58,vlan_tci=0x1000/0x1000 actions=load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3314 cookie=0xa dl_src=40:44:44:44:54:59,vlan_tci=0x1000/0x1000 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],set_vlan_pcp:1,load:99->OXM_OF_VLAN_VID[[]],controller
3315 ])
3316 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3317
3318 dnl Modified MPLS controller action.
3319 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3320 dnl both of these in the final flow
3321 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3322
3323 for i in 1 2 3; do
3324     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:50,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3325 done
3326 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3327 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3328
3329 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3330 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3331 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3332 00000000  50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3333 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3334 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3335 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3336 00000040  00 00 00 00
3337 dnl
3338 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3339 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3340 00000000  50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3341 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3342 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3343 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3344 00000040  00 00 00 00
3345 dnl
3346 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3347 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3348 00000000  50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3349 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3350 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3351 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3352 00000040  00 00 00 00
3353 ])
3354
3355 dnl Modified MPLS controller action.
3356 dnl In this test, the input packet in vlan-tagged, which should be stripped
3357 dnl before we push the MPLS and VLAN tags.
3358 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3359
3360 for i in 1 2 3; do
3361     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:51,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3362 done
3363 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3364 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3365
3366 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3367 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3368 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3369 00000000  50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3370 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3371 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3372 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3373 dnl
3374 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3375 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3376 00000000  50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3377 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3378 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3379 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3380 dnl
3381 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3382 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3383 00000000  50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3384 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3385 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3386 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3387 ])
3388
3389 dnl Modified MPLS controller action.
3390 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3391 dnl both of these in the final flow
3392 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3393
3394 for i in 1 2 3; do
3395     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:52,dst=52:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3396 done
3397 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3398 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3399
3400 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3401 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3402 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3403 00000000  52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3404 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3405 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3406 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3407 00000040  00 00 00 00
3408 dnl
3409 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3410 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3411 00000000  52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3412 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3413 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3414 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3415 00000040  00 00 00 00
3416 dnl
3417 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3418 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3419 00000000  52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3420 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3421 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3422 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3423 00000040  00 00 00 00
3424 ])
3425
3426 dnl Modified MPLS controller action.
3427 dnl In this test, the input packet in vlan-tagged, which should be stripped
3428 dnl before we push the MPLS and VLAN tags.
3429 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3430
3431 for i in 1 2 3; do
3432     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:53,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3433 done
3434 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3435 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3436
3437 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3438 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3439 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3440 00000000  50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3441 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3442 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3443 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3444 dnl
3445 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3446 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3447 00000000  50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3448 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3449 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3450 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3451 dnl
3452 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3453 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3454 00000000  50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3455 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3456 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3457 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3458 ])
3459
3460 dnl Modified MPLS controller action.
3461 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3462 dnl actions are reordered, so we see both of these in the final flow.
3463 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3464
3465 for i in 1 2 3; do
3466     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:54,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3467 done
3468 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3469 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3470
3471 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3472 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3473 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3474 00000000  50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3475 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3476 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3477 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3478 00000040  00 00 00 00
3479 dnl
3480 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3481 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3482 00000000  50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3483 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3484 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3485 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3486 00000040  00 00 00 00
3487 dnl
3488 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3489 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3490 00000000  50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3491 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3492 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3493 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3494 00000040  00 00 00 00
3495 ])
3496
3497 dnl Modified MPLS controller action.
3498 dnl In this test, the input packet in vlan-tagged, which should be stripped
3499 dnl before we push the MPLS and VLAN tags.
3500 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3501
3502 for i in 1 2 3; do
3503     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:55,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3504 done
3505 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3506 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3507
3508 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3509 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3510 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3511 00000000  50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3512 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3513 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3514 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3515 dnl
3516 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3517 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3518 00000000  50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3519 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3520 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3521 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3522 dnl
3523 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3524 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3525 00000000  50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3526 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3527 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3528 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3529 ])
3530
3531 dnl Modified MPLS controller action.
3532 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3533 dnl actions are reordered, so we see both of these in the final flow.
3534 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3535
3536 for i in 1 2 3; do
3537     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:56,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3538 done
3539 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3540 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3541
3542 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3543 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3544 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3545 00000000  50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3546 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3547 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3548 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3549 00000040  00 00 00 00
3550 dnl
3551 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3552 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3553 00000000  50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3554 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3555 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3556 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3557 00000040  00 00 00 00
3558 dnl
3559 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3560 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3561 00000000  50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3562 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3563 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3564 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3565 00000040  00 00 00 00
3566 ])
3567
3568 dnl Modified MPLS controller action.
3569 dnl In this test, the input packet in vlan-tagged, which should be stripped
3570 dnl before we push the MPLS and VLAN tags.
3571 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
3572
3573 for i in 1 2 3; do
3574     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:57,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3575 done
3576 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3577 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3578
3579 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3580 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3581 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3582 00000000  50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3583 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3584 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3585 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3586 dnl
3587 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3588 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3589 00000000  50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3590 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3591 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3592 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3593 dnl
3594 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3595 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3596 00000000  50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3597 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3598 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3599 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3600 ])
3601
3602 dnl Modified MPLS controller action.
3603 dnl In this test, the input packet in vlan-tagged, which should be stripped
3604 dnl before we push the MPLS and VLAN tags.
3605 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3606
3607 for i in 1 2 3; do
3608     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:58,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3609 done
3610 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3611 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3612
3613 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3614 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3615 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3616 00000000  50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3617 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3618 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3619 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3620 dnl
3621 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3622 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3623 00000000  50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3624 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3625 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3626 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3627 dnl
3628 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3629 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3630 00000000  50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3631 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3632 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3633 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3634 ])
3635
3636 dnl Modified MPLS controller action.
3637 dnl In this test, the input packet in vlan-tagged, which should be modified
3638 dnl before we push MPLS and VLAN tags.
3639 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3640
3641 for i in 1 2 3; do
3642     ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:59,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3643 done
3644 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3645 ovs-appctl -t ovs-ofctl exit
3646
3647 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3648 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3649 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3650 00000000  50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3651 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3652 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3653 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3654 dnl
3655 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3656 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3657 00000000  50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3658 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3659 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3660 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3661 dnl
3662 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3663 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3664 00000000  50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3665 00000010  88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3666 00000020  f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3667 00000030  00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3668 ])
3669
3670 AT_CHECK([ovs-appctl revalidator/purge], [0])
3671 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3672  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3673  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3674  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3675  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3676  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3677  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3678  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3679  cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3680  cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:58 actions=load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3681  cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:59 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],set_field:1->vlan_pcp,load:0x63->OXM_OF_VLAN_VID[[]],CONTROLLER:65535
3682 OFPST_FLOW reply (OF1.2):
3683 ])
3684
3685 OVS_VSWITCHD_STOP
3686 AT_CLEANUP
3687
3688 AT_SETUP([ofproto-dpif - fragment handling - trace])
3689 OVS_VSWITCHD_START
3690 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3691 AT_DATA([flows.txt], [dnl
3692 priority=75 tcp ip_frag=no    tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
3693 priority=75 tcp ip_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
3694 priority=50 tcp ip_frag=no              actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
3695 priority=50 tcp ip_frag=first           actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
3696 priority=50 tcp ip_frag=later           actions=output:6
3697 ])
3698 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3699
3700 base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128"
3701 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3702 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3703 later_flow="$base_flow,frag=later)"
3704
3705     # mode    no  first  later
3706 for tuple in \
3707     'normal    1     5      6' \
3708     'drop      1  drop   drop' \
3709     'nx-match  1     2      6'
3710 do
3711   set $tuple
3712   mode=$1
3713   no=$2
3714   first=$3
3715   later=$4
3716
3717   AT_CHECK([ovs-ofctl set-frags br0 $mode])
3718   for type in no first later; do
3719     eval flow=\$${type}_flow exp_output=\$$type
3720     printf "\n%s\n" "----$mode $type-----"
3721     AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3722     : > expout
3723     if test $mode = drop && test $type != no; then
3724         echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
3725         echo "Datapath actions: $exp_output" >> expout
3726     elif test $type = later; then
3727         echo "Datapath actions: $exp_output" >> expout
3728     else
3729         echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout
3730     fi
3731     AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
3732   done
3733 done
3734 OVS_VSWITCHD_STOP
3735 AT_CLEANUP
3736
3737 AT_SETUP([ofproto-dpif - fragment handling - upcall])
3738 OVS_VSWITCHD_START
3739 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3740 AT_DATA([flows.txt], [dnl
3741 priority=75 tcp ip_frag=no    tp_dst=80 actions=set_field:81->tcp_dst,output:1
3742 priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2
3743 priority=50 tcp ip_frag=no              actions=set_field:81->tcp_dst,output:4
3744 priority=50 tcp ip_frag=first           actions=set_field:81->tcp_dst,output:5
3745 priority=50 tcp ip_frag=later           actions=output:6
3746 ])
3747 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3748
3749 base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128"
3750 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3751 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3752 later_flow="$base_flow,frag=later)"
3753
3754 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3755
3756 mode=normal
3757
3758 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3759 for type in no first later; do
3760   eval flow=\$${type}_flow
3761   printf "\n%s\n" "----$mode $type-----"
3762
3763   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3764 done
3765
3766 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3767 flow-dump from non-dpdk interfaces:
3768 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3769 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),5
3770 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3771 ])
3772
3773 mode=drop
3774
3775 AT_CHECK([ovs-appctl revalidator/purge], [0])
3776 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3777 for type in no first later; do
3778   eval flow=\$${type}_flow
3779   printf "\n%s\n" "----$mode $type-----"
3780
3781   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3782 done
3783
3784 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3785 flow-dump from non-dpdk interfaces:
3786 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3787 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop
3788 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop
3789 ])
3790
3791 mode=nx-match
3792
3793 AT_CHECK([ovs-appctl revalidator/purge], [0])
3794 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3795 for type in no first later; do
3796   eval flow=\$${type}_flow
3797   printf "\n%s\n" "----$mode $type-----"
3798
3799   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3800 done
3801
3802 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3803 flow-dump from non-dpdk interfaces:
3804 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3805 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),2
3806 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3807 ])
3808
3809 OVS_VSWITCHD_STOP
3810 AT_CLEANUP
3811
3812 AT_SETUP([ofproto-dpif - fragment handling - actions])
3813 OVS_VSWITCHD_START
3814 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3815
3816 AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_TCP_DST[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr])
3817 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3818 source field tcp_dst lacks correct prerequisites
3819 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3820 ])
3821
3822 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_PKT_REG0[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr])
3823 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3824 destination field tcp_src lacks correct prerequisites
3825 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3826 ])
3827
3828 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr])
3829 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3830 set_field udp_src lacks correct prerequisities
3831 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3832 ])
3833
3834 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr])
3835 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3836 set_field udp_dst lacks correct prerequisities
3837 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3838 ])
3839
3840 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr])
3841 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3842 set_field sctp_src lacks correct prerequisities
3843 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3844 ])
3845
3846 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr])
3847 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3848 set_field sctp_dst lacks correct prerequisities
3849 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3850 ])
3851
3852 AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]],NXM_OF_TCP_SRC[[]]=NXM_OF_TCP_DST[[]],output:NXM_NX_REG0[[0..15]]),output:1"], [1], [], [stderr])
3853 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3854 source field tcp_dst lacks correct prerequisites
3855 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3856 ])
3857
3858 AT_DATA([flows.txt], [dnl
3859 priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1
3860 ])
3861 AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt])
3862
3863 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3864
3865 mode=normal
3866
3867 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3868 for frag in 4000 6000 6008 4010; do
3869   printf "\n%s\n" "----$mode $frag-----"
3870
3871   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 003c 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016 751e267b 00000000 a002 16d0 1736 0000 02 04 05 b4 04 02 08 0a 2d 25 08 5f 00 00 00 00 01 03 03 07"])
3872 done
3873
3874 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3875 flow-dump from non-dpdk interfaces:
3876 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=33419), packets:0, bytes:0, used:never, actions:set(tcp(src=33322)),1
3877 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=33419), packets:0, bytes:0, used:never, actions:set(tcp(src=33322)),1
3878 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1
3879 ])
3880
3881 AT_CHECK([ovs-appctl revalidator/purge], [0])
3882 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3883 for frag in 4000 6000 6008 4010; do
3884   printf "\n%s\n" "----$mode $frag truncated transport header -----"
3885
3886   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"])
3887 done
3888
3889 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3890 flow-dump from non-dpdk interfaces:
3891 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3892 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3893 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3894 ])
3895
3896 AT_CHECK([ovs-appctl revalidator/purge], [0])
3897 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3898 for frag in 4000 6000 6001 4002; do
3899   printf "\n%s\n" "----$mode $frag missing transport header-----"
3900
3901   AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"])
3902 done
3903
3904 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3905 flow-dump from non-dpdk interfaces:
3906 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3907 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1
3908 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3909 ])
3910
3911 OVS_VSWITCHD_STOP
3912 AT_CLEANUP
3913
3914 AT_SETUP([ofproto-dpif - exit])
3915 OVS_VSWITCHD_START
3916 ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14])
3917 AT_DATA([flows.txt], [dnl
3918 in_port=1 actions=output:10,exit,output:11
3919 in_port=2 actions=output:12,resubmit:1,output:12
3920 in_port=3 actions=output:13,resubmit:2,output:14
3921 ])
3922 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3923 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
3924 AT_CHECK([tail -1 stdout], [0],
3925   [Datapath actions: 10
3926 ])
3927 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
3928 AT_CHECK([tail -1 stdout], [0],
3929   [Datapath actions: 12,10
3930 ])
3931 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
3932 AT_CHECK([tail -1 stdout], [0],
3933   [Datapath actions: 13,12,10
3934 ])
3935 OVS_VSWITCHD_STOP
3936 AT_CLEANUP
3937
3938
3939 AT_SETUP([ofproto-dpif - mirroring, select_all])
3940 OVS_VSWITCHD_START
3941 ADD_OF_PORTS([br0], 1, 2, 3)
3942 ovs-vsctl \
3943         set Bridge br0 mirrors=@m --\
3944         --id=@p3 get Port p3 --\
3945         --id=@m create Mirror name=mymirror select_all=true output_port=@p3
3946
3947 AT_DATA([flows.txt], [dnl
3948 in_port=1 actions=output:2
3949 in_port=2 actions=output:1
3950 ])
3951 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3952
3953 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
3954 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3955 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3956   [Datapath actions: 3,2
3957 ])
3958
3959 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
3960 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3961 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3962   [Datapath actions: 3,1
3963 ])
3964
3965 OVS_VSWITCHD_STOP
3966 AT_CLEANUP
3967
3968
3969 AT_SETUP([ofproto-dpif - mirroring, select_src])
3970 OVS_VSWITCHD_START
3971 ADD_OF_PORTS([br0], 1, 2, 3)
3972 ovs-vsctl \
3973         set Bridge br0 mirrors=@m --\
3974         --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
3975         --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
3976
3977 AT_DATA([flows.txt], [dnl
3978 in_port=1 actions=output:2
3979 in_port=2 actions=output:1
3980 ])
3981 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3982
3983 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
3984 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3985 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3986   [Datapath actions: 3,2
3987 ])
3988
3989 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
3990 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3991 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3992   [Datapath actions: 1
3993 ])
3994 OVS_VSWITCHD_STOP
3995 AT_CLEANUP
3996
3997 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
3998 OVS_VSWITCHD_START
3999 ADD_OF_PORTS([br0], 1, 2)
4000 ovs-vsctl \
4001         set Bridge br0 mirrors=@m --\
4002         --id=@p2 get Port p2 --\
4003         --id=@m create Mirror name=mymirror select_all=true output_port=@p2
4004
4005 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4006
4007 # "in_port" defaults to OFPP_NONE if it's not specified.
4008 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_ttl=128,icmp_type=8,icmp_code=0"
4009 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4010 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4011   [Datapath actions: 1,2
4012 ])
4013
4014 OVS_VSWITCHD_STOP
4015 AT_CLEANUP
4016
4017
4018 AT_SETUP([ofproto-dpif - mirroring, select_dst])
4019 OVS_VSWITCHD_START
4020 ADD_OF_PORTS([br0], 1, 2, 3)
4021 ovs-vsctl \
4022         set Bridge br0 mirrors=@m --\
4023         --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4024         --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
4025
4026 AT_DATA([flows.txt], [dnl
4027 in_port=1 actions=output:2
4028 in_port=2 actions=output:1
4029 ])
4030 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4031
4032 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4033 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4034 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4035   [Datapath actions: 2,3
4036 ])
4037
4038 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4039 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4040 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4041   [Datapath actions: 1
4042 ])
4043
4044 OVS_VSWITCHD_STOP
4045 AT_CLEANUP
4046
4047
4048 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
4049 OVS_VSWITCHD_START
4050 ADD_OF_PORTS([br0], 1, 2, 3)
4051 ovs-vsctl \
4052         set Bridge br0 mirrors=@m --\
4053         --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4054         --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
4055
4056 AT_DATA([flows.txt], [dnl
4057 in_port=1, actions=output:2
4058 ])
4059 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4060
4061 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4062 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4063 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4064   [Datapath actions: 2
4065 ])
4066
4067 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4068 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4069 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4070   [Datapath actions: 2
4071 ])
4072
4073 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=11,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4074 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4075 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4076   [Datapath actions: 3,2
4077 ])
4078
4079 OVS_VSWITCHD_STOP
4080 AT_CLEANUP
4081
4082
4083 AT_SETUP([ofproto-dpif - mirroring, output_port])
4084 OVS_VSWITCHD_START
4085 ADD_OF_PORTS([br0], 1, 2, 3)
4086 ovs-vsctl \
4087         set Bridge br0 mirrors=@m --\
4088         --id=@p3 get Port p3 --\
4089         --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4090
4091 AT_DATA([flows.txt], [dnl
4092 in_port=1 actions=mod_vlan_vid:17,output:2
4093 in_port=2 actions=output:1
4094 ])
4095 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4096
4097 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4098 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4099 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4100   [Datapath actions: 3,push_vlan(vid=17,pcp=0),2
4101 ])
4102
4103 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4104 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4105 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4106   [Datapath actions: 3,1
4107 ])
4108
4109 OVS_VSWITCHD_STOP
4110 AT_CLEANUP
4111
4112 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
4113 OVS_VSWITCHD_START
4114 ADD_OF_PORTS([br0], 1, 2)
4115 ovs-vsctl \
4116         set Bridge br0 mirrors=@m --\
4117         --id=@m create Mirror name=mymirror select_all=true output_vlan=12
4118
4119 AT_DATA([flows.txt], [dnl
4120 in_port=1 actions=output:2
4121 in_port=2 actions=mod_vlan_vid:17,output:1
4122 ])
4123 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4124
4125 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4126 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4127 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4128
4129 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
4130 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4131 mv stdout expout
4132 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4133
4134 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4135 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4136 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4137
4138 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
4139 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4140 mv stdout expout
4141 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4142
4143 OVS_VSWITCHD_STOP
4144 AT_CLEANUP
4145
4146 # This test verifies that mirror state is preserved across recirculation.
4147 #
4148 # Otherwise, post-recirculation the ingress and the output to port 4
4149 # would cause the packet to be mirrored to port 3 a second time.
4150 AT_SETUP([ofproto-dpif - mirroring with recirculation])
4151 OVS_VSWITCHD_START
4152 ADD_OF_PORTS([br0], 1, 2, 3, 4)
4153 ovs-vsctl \
4154         set Bridge br0 mirrors=@m --\
4155         --id=@p3 get Port p3 --\
4156         --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4157
4158 AT_DATA([flows.txt], [dnl
4159 in_port=1 actions=2,debug_recirc,4
4160 ])
4161 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4162
4163 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)"
4164 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4165 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3,2,recirc(0x1)
4166 ])
4167 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4168 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 4
4169 ])
4170
4171 OVS_VSWITCHD_STOP
4172 AT_CLEANUP
4173
4174 # Two testcases below are for the ofproto/trace command
4175 # The first one tests all correct syntax:
4176 # ofproto/trace [dp_name] odp_flow [-generate|packet]
4177 # ofproto/trace br_name br_flow [-generate|packet]
4178 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
4179 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4180 ADD_OF_PORTS([br0], 1, 2, 3)
4181
4182 AT_DATA([flows.txt], [dnl
4183 in_port=1 actions=output:2
4184 in_port=2 actions=output:1
4185 ])
4186 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4187
4188 odp_flow="in_port(p1)"
4189 br_flow="in_port=1"
4190 # Test command: ofproto/trace odp_flow with in_port as a name.
4191 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4192 AT_CHECK([tail -1 stdout], [0], [dnl
4193 Datapath actions: 2
4194 ])
4195
4196 odp_flow="in_port(1)"
4197 # Test command: ofproto/trace odp_flow
4198 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4199 AT_CHECK([tail -1 stdout], [0], [dnl
4200 Datapath actions: 2
4201 ])
4202
4203 # Test command: ofproto/trace dp_name odp_flow
4204 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
4205 AT_CHECK([tail -1 stdout], [0], [dnl
4206 Datapath actions: 2
4207 ])
4208 # Test commmand: ofproto/trace br_name br_flow
4209 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4210 AT_CHECK([tail -1 stdout], [0], [dnl
4211 Datapath actions: 2
4212 ])
4213
4214 # Delete the inserted flows
4215 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
4216 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
4217
4218 # This section below tests the [-generate] option
4219 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
4220 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"
4221
4222 # Test command: ofproto/trace odp_flow
4223 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4224 # Check for no MAC learning entry
4225 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4226  port  VLAN  MAC                Age
4227 ])
4228
4229 # Test command: ofproto/trace br_name br_flow
4230 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4231 # Check for no MAC learning entry
4232 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4233  port  VLAN  MAC                Age
4234 ])
4235
4236 # Test command: ofproto/trace odp_flow -generate
4237 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
4238 # Check for the MAC learning entry
4239 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4240  port  VLAN  MAC                Age
4241     3     0  50:54:00:00:00:05    ?
4242 ])
4243
4244 # Test command: ofproto/trace dp_name odp_flow -generate
4245 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4246   "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
4247   -generate], [0], [stdout])
4248 # Check for both MAC learning entries
4249 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4250  port  VLAN  MAC                Age
4251     3     0  50:54:00:00:00:05    ?
4252     1     0  50:54:00:00:00:06    ?
4253 ])
4254
4255 # Test command: ofproto/trace br_name br_flow -generate
4256 AT_CHECK([ovs-appctl ofproto/trace br0 \
4257   "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
4258   -generate], [0], [stdout])
4259 # Check for both MAC learning entries.
4260 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4261  port  VLAN  MAC                Age
4262     3     0  50:54:00:00:00:05    ?
4263     1     0  50:54:00:00:00:06    ?
4264     2     0  50:54:00:00:00:07    ?
4265 ])
4266
4267 # This section beflow tests the [packet] option
4268 # The ovs-tcpundump of packets between port1 and port2
4269 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4270 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
4271
4272 # Construct the MAC learning table
4273 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4274   "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
4275   -generate], [0], [stdout])
4276
4277 # Construct the MAC learning table
4278 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4279   "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
4280   -generate], [0], [stdout])
4281
4282 # Test command: ofproto/trace odp_flow packet
4283 AT_CHECK([ovs-appctl ofproto/trace \
4284   "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4285 AT_CHECK([tail -1 stdout], [0], [dnl
4286 Datapath actions: 2
4287 ])
4288 AT_CHECK([head -n 2 stdout], [0], [dnl
4289 Bridge: br0
4290 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
4291 ])
4292
4293 # Test command: ofproto/trace dp_name odp_flow packet
4294 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4295   "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4296 AT_CHECK([tail -1 stdout], [0], [dnl
4297 Datapath actions: 2
4298 ])
4299 AT_CHECK([head -n 2 stdout], [0], [dnl
4300 Bridge: br0
4301 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
4302 ])
4303
4304 # Test command: ofproto/trace br_name br_flow packet
4305 AT_CHECK([ovs-appctl ofproto/trace br0 \
4306   "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
4307 AT_CHECK([tail -1 stdout], [0], [dnl
4308 Datapath actions: 1
4309 ])
4310 AT_CHECK([head -n 2 stdout], [0], [dnl
4311 Bridge: br0
4312 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
4313 ])
4314
4315 OVS_VSWITCHD_STOP
4316 AT_CLEANUP
4317
4318 # The second test tests the corner cases
4319 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
4320 OVS_VSWITCHD_START
4321 ADD_OF_PORTS([br0], 1, 2)
4322
4323 # Define flows
4324 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
4325 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
4326 # Define options
4327 generate="-generate"
4328 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4329
4330 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
4331 m4_foreach(
4332 [option],
4333 [[],
4334 ["$generate"],
4335 ["$pkt"]],
4336 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
4337   [2], [], [stderr])
4338 AT_CHECK([tail -2 stderr], [0], [dnl
4339 Cannot find the datapath
4340 ovs-appctl: ovs-vswitchd: server returned an error
4341 ])])
4342
4343 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
4344 m4_foreach(
4345 [option],
4346 [[],
4347 ["$generate"],
4348 ["$pkt"]],
4349 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
4350   [2], [], [stderr])
4351 AT_CHECK([tail -2 stderr], [0], [dnl
4352 Cannot find the datapath
4353 ovs-appctl: ovs-vswitchd: server returned an error
4354 ])])
4355
4356 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
4357 m4_foreach(
4358 [option],
4359 [[],
4360 ["$generate"],
4361 ["$pkt"]],
4362 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
4363   [2], [], [stderr])
4364 AT_CHECK([tail -2 stderr], [0], [dnl
4365 Cannot find the datapath
4366 ovs-appctl: ovs-vswitchd: server returned an error
4367 ])])
4368
4369 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
4370 m4_foreach(
4371 [option],
4372 [[],
4373 ["$generate"],
4374 ["$pkt"]],
4375 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
4376   [2], [], [stderr])
4377 AT_CHECK([tail -2 stderr], [0], [dnl
4378 Cannot find the datapath
4379 ovs-appctl: ovs-vswitchd: server returned an error
4380 ])])
4381
4382 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
4383 m4_foreach(
4384 [option],
4385 [[],
4386 ["$generate"],
4387 ["$pkt"]],
4388 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
4389   [2], [], [stderr])
4390 AT_CHECK([tail -2 stderr], [0], [dnl
4391 Unknown bridge name
4392 ovs-appctl: ovs-vswitchd: server returned an error
4393 ])])
4394
4395 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
4396 m4_foreach(
4397 [option],
4398 [[],
4399 ["$generate"],
4400 ["$pkt"]],
4401 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
4402   [2], [], [stderr])
4403 AT_CHECK([tail -2 stderr], [0], [dnl
4404 Must specify bridge name
4405 ovs-appctl: ovs-vswitchd: server returned an error
4406 ])])
4407
4408 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
4409 AT_CHECK([ovs-appctl ofproto/trace \
4410   ovs-dummy "$odp_flow" garbage_option],
4411   [2], [stdout],[stderr])
4412 AT_CHECK([tail -2 stderr], [0], [dnl
4413 Trailing garbage in packet data
4414 ovs-appctl: ovs-vswitchd: server returned an error
4415 ])
4416
4417 # Test incorrect command: ofproto/trace with 4 arguments
4418 AT_CHECK([ovs-appctl ofproto/trace \
4419   arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
4420 AT_CHECK([tail -2 stderr], [0], [dnl
4421 "ofproto/trace" command takes at most 3 arguments
4422 ovs-appctl: ovs-vswitchd: server returned an error
4423 ])
4424
4425 # Test incorrect command: ofproto/trace with 0 argument
4426 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
4427 AT_CHECK([tail -2 stderr], [0], [dnl
4428 "ofproto/trace" command requires at least 1 arguments
4429 ovs-appctl: ovs-vswitchd: server returned an error
4430 ])
4431
4432 OVS_VSWITCHD_STOP
4433 AT_CLEANUP
4434
4435 # The third test checks that the output of "ovs-dpctl -m" is valid to trace.
4436 AT_SETUP([ofproto-dpif - ofproto/trace from dpctl output])
4437 OVS_VSWITCHD_START([dnl
4438     set Open_vSwitch . other_config:max-idle=10000 \
4439     -- add-port br0 p1 -- set Interface p1 type=dummy])
4440
4441 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)'])
4442 ovs-appctl revalidator/wait
4443 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows1.txt])
4444
4445 odp_flow=`cat dp_flows1.txt`
4446 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
4447 Bridge: br0
4448 Flow: <cleared>
4449 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
4450
4451 Rule: table=254 cookie=0 priority=0,reg0=0x2
4452 OpenFlow actions=drop
4453
4454 Final flow: <cleared>
4455 Megaflow: <cleared>
4456 Datapath actions: drop
4457 ])
4458
4459 dnl Now, try again without megaflows:
4460 ovs-appctl upcall/disable-megaflows
4461
4462 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)'])
4463 ovs-appctl revalidator/wait
4464 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows2.txt])
4465
4466 odp_flow=`cat dp_flows2.txt`
4467 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
4468 Bridge: br0
4469 Flow: <cleared>
4470 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
4471
4472 Rule: table=254 cookie=0 priority=0,reg0=0x2
4473 OpenFlow actions=drop
4474
4475 Final flow: <cleared>
4476 Megaflow: <cleared>
4477 Datapath actions: drop
4478 ])
4479
4480 OVS_VSWITCHD_STOP
4481 AT_CLEANUP
4482
4483 AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
4484 OVS_VSWITCHD_START
4485 ADD_OF_PORTS([br0], 1, 2, 3)
4486
4487 AT_DATA([flows.txt], [dnl
4488 in_port=1 actions=output:2
4489 in_port=2 actions=output:1
4490 ])
4491 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4492
4493 AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
4494 AT_CHECK([tail -1 stdout], [0], [dnl
4495 Datapath actions: push_vlan(vid=123,pcp=0),2
4496 ])
4497
4498 OVS_VSWITCHD_STOP
4499 AT_CLEANUP
4500
4501
4502 m4_define([OFPROTO_TRACE],
4503   [flow="$2"
4504    AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
4505    actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4506    expected="$4"
4507    AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
4508      [0], [stdout])
4509    mv stdout expout
4510    AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
4511      [0], [expout])])
4512
4513 AT_SETUP([ofproto-dpif - MAC learning])
4514 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4515 ADD_OF_PORTS([br0], 1, 2, 3)
4516
4517 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)'
4518
4519 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
4520 OFPROTO_TRACE(
4521   [ovs-dummy],
4522   [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
4523   [-generate],
4524   [1,2,100])
4525
4526 # Check for the MAC learning entry.
4527 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4528  port  VLAN  MAC                Age
4529     3     0  50:54:00:00:00:05    ?
4530 ])
4531
4532 # Trace a packet arrival destined for the learned MAC.
4533 # (This will also learn a MAC.)
4534 OFPROTO_TRACE(
4535   [ovs-dummy],
4536   [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
4537   [-generate],
4538   [3])
4539
4540 # Check for both MAC learning entries.
4541 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4542  port  VLAN  MAC                Age
4543     3     0  50:54:00:00:00:05    ?
4544     1     0  50:54:00:00:00:06    ?
4545 ])
4546
4547 # Trace a packet arrival that updates the first learned MAC entry.
4548 OFPROTO_TRACE(
4549   [ovs-dummy],
4550   [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
4551   [-generate],
4552   [1,3,100])
4553
4554 # Check that the MAC learning entry was updated.
4555 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4556  port  VLAN  MAC                Age
4557     1     0  50:54:00:00:00:06    ?
4558     2     0  50:54:00:00:00:05    ?
4559 ])
4560
4561 # Add another bridge.
4562 AT_CHECK(
4563   [ovs-vsctl \
4564      -- add-br br1 \
4565      -- set bridge br1 datapath-type=dummy])
4566 ADD_OF_PORTS([br1], 4, 5)
4567
4568 # Trace some packet arrivals in br1 to create MAC learning entries there too.
4569 OFPROTO_TRACE(
4570   [ovs-dummy],
4571   [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
4572   [-generate],
4573   [5,101])
4574 OFPROTO_TRACE(
4575   [ovs-dummy],
4576   [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
4577   [-generate],
4578   [4,101])
4579
4580 # Check that the MAC learning entries were added.
4581 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4582  port  VLAN  MAC                Age
4583     4     0  50:54:00:00:00:06    ?
4584     5     0  50:54:00:00:00:07    ?
4585 ])
4586
4587 # Delete port p1 and see that its MAC learning entry disappeared, and
4588 # that the MAC learning entry for the same MAC was also deleted from br1.
4589 AT_CHECK([ovs-vsctl del-port p1])
4590 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4591  port  VLAN  MAC                Age
4592     2     0  50:54:00:00:00:05    ?
4593 ])
4594 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4595  port  VLAN  MAC                Age
4596     5     0  50:54:00:00:00:07    ?
4597 ])
4598
4599 OVS_VSWITCHD_STOP
4600 AT_CLEANUP
4601
4602 AT_SETUP([ofproto-dpif - MAC table overflow])
4603 OVS_VSWITCHD_START(
4604   [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
4605 ADD_OF_PORTS([br0], 1, 2, 3)
4606
4607 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)'
4608
4609 AT_CHECK([ovs-appctl time/stop])
4610
4611 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
4612 for i in 0 1 2 3 4 5 6 7 8 9; do
4613     OFPROTO_TRACE(
4614       [ovs-dummy],
4615       [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
4616       [-generate],
4617       [1,2,100])
4618     ovs-appctl time/warp 1000
4619 done
4620
4621 # Check for the MAC learning entries.
4622 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4623   [0], [dnl
4624     3     0  50:54:00:00:00:00
4625     3     0  50:54:00:00:00:01
4626     3     0  50:54:00:00:00:02
4627     3     0  50:54:00:00:00:03
4628     3     0  50:54:00:00:00:04
4629     3     0  50:54:00:00:00:05
4630     3     0  50:54:00:00:00:06
4631     3     0  50:54:00:00:00:07
4632     3     0  50:54:00:00:00:08
4633     3     0  50:54:00:00:00:09
4634  port  VLAN  MAC                Age
4635 ])
4636
4637 # Trace another ARP packet on another MAC.
4638 OFPROTO_TRACE(
4639   [ovs-dummy],
4640   [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
4641   [-generate],
4642   [1,2,100])
4643
4644 # Check that the new one chased the oldest one out of the table.
4645 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
4646   [0], [dnl
4647     3     0  50:54:00:00:00:01    ?
4648     3     0  50:54:00:00:00:02    ?
4649     3     0  50:54:00:00:00:03    ?
4650     3     0  50:54:00:00:00:04    ?
4651     3     0  50:54:00:00:00:05    ?
4652     3     0  50:54:00:00:00:06    ?
4653     3     0  50:54:00:00:00:07    ?
4654     3     0  50:54:00:00:00:08    ?
4655     3     0  50:54:00:00:00:09    ?
4656     3     0  50:54:00:00:00:10    ?
4657  port  VLAN  MAC                Age
4658 ])
4659 OVS_VSWITCHD_STOP
4660 AT_CLEANUP
4661
4662 AT_SETUP([ofproto-dpif - MAC table overflow fairness])
4663 OVS_VSWITCHD_START(
4664   [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
4665 ADD_OF_PORTS([br0], 1, 2, 3, 4, 5, 6)
4666
4667 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)'
4668
4669 AT_CHECK([ovs-appctl time/stop])
4670
4671 # Trace packets with 2 different source MACs arriving on each of the 5
4672 # ports, filling up the 10-entry learning table.
4673 for i in 0 1 2 3 4 5 6 7 8 9; do
4674     p=`expr $i / 2 + 1`
4675     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
4676     ovs-appctl time/warp 1000
4677 done
4678
4679 # Check for the MAC learning entries.
4680 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4681   [0], [dnl
4682     1     0  50:54:00:00:00:00
4683     1     0  50:54:00:00:00:01
4684     2     0  50:54:00:00:00:02
4685     2     0  50:54:00:00:00:03
4686     3     0  50:54:00:00:00:04
4687     3     0  50:54:00:00:00:05
4688     4     0  50:54:00:00:00:06
4689     4     0  50:54:00:00:00:07
4690     5     0  50:54:00:00:00:08
4691     5     0  50:54:00:00:00:09
4692  port  VLAN  MAC                Age
4693 ])
4694
4695 # Now trace 16 new MACs on another port.
4696 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
4697     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
4698     ovs-appctl time/warp 1000
4699 done
4700
4701 # Check the results.
4702 #
4703 # Our eviction algorithm on overflow is that an arbitrary (but deterministic)
4704 # one of the ports with the most learned MACs loses the least recently used
4705 # one.  Thus, the new port will end up with 3 MACs, 3 of the old ports with 1
4706 # MAC each, and the other 2 of the old ports with 2 MACs each.
4707 #
4708 # (If someone changes lib/heap.c to do something different with equal-priority
4709 # nodes, then the output below could change, but it would still follow the
4710 # rules explained above.)
4711 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4712   [0], [dnl
4713     1     0  50:54:00:00:00:01
4714     2     0  50:54:00:00:00:03
4715     3     0  50:54:00:00:00:04
4716     3     0  50:54:00:00:00:05
4717     4     0  50:54:00:00:00:07
4718     5     0  50:54:00:00:00:08
4719     5     0  50:54:00:00:00:09
4720     6     0  50:54:00:00:0d:ff
4721     6     0  50:54:00:00:0e:ff
4722     6     0  50:54:00:00:0f:ff
4723  port  VLAN  MAC                Age
4724 ])
4725 OVS_VSWITCHD_STOP
4726 AT_CLEANUP
4727
4728 # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR)
4729 #
4730 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
4731 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
4732   [AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
4733   OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4734
4735   on_exit 'kill `cat test-sflow.pid`'
4736   AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
4737   AT_CAPTURE_FILE([sflow.log])
4738   PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
4739   ovs-appctl time/stop
4740
4741   ADD_OF_PORTS([br0], 1, 2)
4742   ovs-vsctl \
4743      set Interface br0 options:ifindex=1002 -- \
4744      set Interface p1 options:ifindex=1004 -- \
4745      set Interface p2 options:ifindex=1003 -- \
4746      set Bridge br0 sflow=@sf -- \
4747      --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
4748        header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
4749
4750   dnl open with ARP packets to seed the bridge-learning.  The output
4751   dnl ifIndex numbers should be reported predictably after that.
4752   dnl Since we set sampling=1 we should see all of these packets
4753   dnl reported. Sorting the output by data-source and seqNo makes
4754   dnl it deterministic. Ensuring that we send at least two packets
4755   dnl into each port means we get to check the seq nos are
4756   dnl incrementing correctly.
4757   dnl because packets from different ports can be handled by separate
4758   dnl threads, put some sleeps
4759
4760   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)'
4761   sleep 1
4762   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)'
4763   sleep 1
4764   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)'
4765   sleep 1
4766   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)'
4767   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)'
4768
4769   dnl sleep long enough to get more than one counter sample
4770   dnl from each datasource so we can check sequence numbers
4771   ovs-appctl time/warp 3000 100
4772   OVS_VSWITCHD_STOP
4773   ovs-appctl -t test-sflow exit
4774
4775   AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
4776         /g']], [0], [dnl
4777 HEADER
4778         dgramSeqNo=1
4779         ds=127.0.0.1>2:1000
4780         fsSeqNo=1
4781         in_vlan=0
4782         in_priority=0
4783         out_vlan=0
4784         out_priority=0
4785         meanSkip=1
4786         samplePool=1
4787         dropEvents=0
4788         in_ifindex=1004
4789         in_format=0
4790         out_ifindex=2
4791         out_format=2
4792         hdr_prot=1
4793         pkt_len=64
4794         stripped=4
4795         hdr_len=60
4796         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
4797 HEADER
4798         dgramSeqNo=1
4799         ds=127.0.0.1>2:1000
4800         fsSeqNo=2
4801         in_vlan=0
4802         in_priority=0
4803         out_vlan=0
4804         out_priority=0
4805         meanSkip=1
4806         samplePool=2
4807         dropEvents=0
4808         in_ifindex=1003
4809         in_format=0
4810         out_ifindex=2
4811         out_format=2
4812         hdr_prot=1
4813         pkt_len=64
4814         stripped=4
4815         hdr_len=60
4816         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
4817 HEADER
4818         dgramSeqNo=1
4819         ds=127.0.0.1>2:1000
4820         fsSeqNo=3
4821         in_vlan=0
4822         in_priority=0
4823         out_vlan=0
4824         out_priority=0
4825         meanSkip=1
4826         samplePool=3
4827         dropEvents=0
4828         in_ifindex=1004
4829         in_format=0
4830         out_ifindex=1003
4831         out_format=0
4832         hdr_prot=1
4833         pkt_len=64
4834         stripped=4
4835         hdr_len=60
4836         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
4837 HEADER
4838         dgramSeqNo=1
4839         ds=127.0.0.1>2:1000
4840         fsSeqNo=4
4841         in_vlan=0
4842         in_priority=0
4843         out_vlan=0
4844         out_priority=0
4845         meanSkip=1
4846         samplePool=4
4847         dropEvents=0
4848         in_ifindex=1003
4849         in_format=0
4850         out_ifindex=1004
4851         out_format=0
4852         hdr_prot=1
4853         pkt_len=64
4854         stripped=4
4855         hdr_len=60
4856         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
4857 HEADER
4858         dgramSeqNo=1
4859         ds=127.0.0.1>2:1000
4860         fsSeqNo=5
4861         in_vlan=0
4862         in_priority=0
4863         out_vlan=0
4864         out_priority=0
4865         meanSkip=1
4866         samplePool=5
4867         dropEvents=0
4868         in_ifindex=1003
4869         in_format=0
4870         out_ifindex=1004
4871         out_format=0
4872         hdr_prot=1
4873         pkt_len=64
4874         stripped=4
4875         hdr_len=60
4876         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
4877 ])
4878
4879   AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -18 | sed 's/ /\
4880         /g']], [0], [dnl
4881 IFCOUNTERS
4882         dgramSeqNo=2
4883         ds=127.0.0.1>0:1002
4884         csSeqNo=1
4885         ifindex=1002
4886         type=6
4887         ifspeed=100000000
4888         direction=0
4889         status=0
4890         in_octets=0
4891         in_unicasts=0
4892         in_multicasts=0
4893         in_broadcasts=4294967295
4894         in_discards=0
4895         in_errors=0
4896         in_unknownprotos=4294967295
4897         out_octets=120
4898         out_unicasts=2
4899         out_multicasts=4294967295
4900         out_broadcasts=4294967295
4901         out_discards=0
4902         out_errors=0
4903         promiscuous=0
4904 IFCOUNTERS
4905         dgramSeqNo=2
4906         ds=127.0.0.1>0:1003
4907         csSeqNo=1
4908         ifindex=1003
4909         type=6
4910         ifspeed=100000000
4911         direction=0
4912         status=0
4913         in_octets=138
4914         in_unicasts=3
4915         in_multicasts=0
4916         in_broadcasts=4294967295
4917         in_discards=0
4918         in_errors=0
4919         in_unknownprotos=4294967295
4920         out_octets=120
4921         out_unicasts=2
4922         out_multicasts=4294967295
4923         out_broadcasts=4294967295
4924         out_discards=0
4925         out_errors=0
4926         promiscuous=0
4927 IFCOUNTERS
4928         dgramSeqNo=2
4929         ds=127.0.0.1>0:1004
4930         csSeqNo=1
4931         ifindex=1004
4932         type=6
4933         ifspeed=100000000
4934         direction=0
4935         status=0
4936         in_octets=84
4937         in_unicasts=2
4938         in_multicasts=0
4939         in_broadcasts=4294967295
4940         in_discards=0
4941         in_errors=0
4942         in_unknownprotos=4294967295
4943         out_octets=180
4944         out_unicasts=3
4945         out_multicasts=4294967295
4946         out_broadcasts=4294967295
4947         out_discards=0
4948         out_errors=0
4949         promiscuous=0
4950 IFCOUNTERS
4951         dgramSeqNo=3
4952         ds=127.0.0.1>0:1002
4953         csSeqNo=2
4954         ifindex=1002
4955         type=6
4956         ifspeed=100000000
4957         direction=0
4958         status=0
4959         in_octets=0
4960         in_unicasts=0
4961         in_multicasts=0
4962         in_broadcasts=4294967295
4963         in_discards=0
4964         in_errors=0
4965         in_unknownprotos=4294967295
4966         out_octets=120
4967         out_unicasts=2
4968         out_multicasts=4294967295
4969         out_broadcasts=4294967295
4970         out_discards=0
4971         out_errors=0
4972         promiscuous=0
4973 IFCOUNTERS
4974         dgramSeqNo=3
4975         ds=127.0.0.1>0:1003
4976         csSeqNo=2
4977         ifindex=1003
4978         type=6
4979         ifspeed=100000000
4980         direction=0
4981         status=0
4982         in_octets=138
4983         in_unicasts=3
4984         in_multicasts=0
4985         in_broadcasts=4294967295
4986         in_discards=0
4987         in_errors=0
4988         in_unknownprotos=4294967295
4989         out_octets=120
4990         out_unicasts=2
4991         out_multicasts=4294967295
4992         out_broadcasts=4294967295
4993         out_discards=0
4994         out_errors=0
4995         promiscuous=0
4996 IFCOUNTERS
4997         dgramSeqNo=3
4998         ds=127.0.0.1>0:1004
4999         csSeqNo=2
5000         ifindex=1004
5001         type=6
5002         ifspeed=100000000
5003         direction=0
5004         status=0
5005         in_octets=84
5006         in_unicasts=2
5007         in_multicasts=0
5008         in_broadcasts=4294967295
5009         in_discards=0
5010         in_errors=0
5011         in_unknownprotos=4294967295
5012         out_octets=180
5013         out_unicasts=3
5014         out_multicasts=4294967295
5015         out_broadcasts=4294967295
5016         out_discards=0
5017         out_errors=0
5018         promiscuous=0
5019 OPENFLOWPORT
5020         datapath_id=18364758544493064720
5021         port_no=1
5022 OPENFLOWPORT
5023         datapath_id=18364758544493064720
5024         port_no=1
5025 OPENFLOWPORT
5026         datapath_id=18364758544493064720
5027         port_no=2
5028 OPENFLOWPORT
5029         datapath_id=18364758544493064720
5030         port_no=2
5031 OPENFLOWPORT
5032         datapath_id=18364758544493064720
5033         port_no=65534
5034 OPENFLOWPORT
5035         datapath_id=18364758544493064720
5036         port_no=65534
5037 PORTNAME
5038         portName=br0
5039 PORTNAME
5040         portName=br0
5041 PORTNAME
5042         portName=p1
5043 PORTNAME
5044         portName=p1
5045 PORTNAME
5046         portName=p2
5047 PORTNAME
5048         portName=p2
5049 ])])
5050
5051 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv4 collector])
5052 CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1])
5053 AT_CLEANUP
5054
5055 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv6 collector])
5056 AT_SKIP_IF([test $HAVE_IPV6 = no])
5057 CHECK_SFLOW_SAMPLING_PACKET([[[::1]]])
5058 AT_CLEANUP
5059
5060 dnl Test sFlow LAG structures
5061 AT_SETUP([ofproto-dpif - sFlow packet sampling - LACP structures])
5062 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
5063 OVS_VSWITCHD_START([dnl
5064                     add-bond br0 bond p1 p2 --                          \
5065                     set Port bond lacp=active bond-mode=active-backup   \
5066                     other_config:lacp-time="fast"                       \
5067                     other_config:lacp-system-id=11:22:33:44:55:66       \
5068                     other_config:lacp-system-priority=54321 --          \
5069                     set Interface p1 type=dummy                         \
5070                     other_config:lacp-port-id=11                        \
5071                     other_config:lacp-port-priority=111                 \
5072                     other_config:lacp-aggregation-key=3333 --           \
5073                     set Interface p2 type=dummy                         \
5074                     other_config:lacp-port-id=22                        \
5075                     other_config:lacp-port-priority=222                 \
5076                     other_config:lacp-aggregation-key=3333 ])
5077
5078 on_exit 'kill `cat test-sflow.pid`'
5079 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5080 AT_CAPTURE_FILE([sflow.log])
5081 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5082
5083 ovs-appctl time/stop
5084
5085 ovs-vsctl \
5086       set Interface p1 options:ifindex=1003 --                  \
5087       set Bridge br0 sflow=@sf --                               \
5088       --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\"   \
5089       header=128 sampling=1 polling=1
5090
5091 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5092 AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
5093 AT_CHECK([ovs-appctl revalidator/purge], [0])
5094 OVS_VSWITCHD_STOP
5095 ovs-appctl -t test-sflow exit
5096 AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
5097         /g']], [0], [dnl
5098 LACPCOUNTERS
5099         sysID=11:22:33:44:55:66
5100         partnerID=00:00:00:00:00:00
5101         aggID=3333
5102         actorAdmin=0x7
5103         actorOper=0xbf
5104         partnerAdmin=0x0
5105         partnerOper=0x2
5106         LACPUDsRx=0
5107         markerPDUsRx=4294967295
5108         markerRespPDUsRx=4294967295
5109         unknownRx=4294967295
5110         illegalRx=0
5111         LACPUDsTx=1
5112         markerPDUsTx=4294967295
5113         markerRespPDUsTx=4294967295
5114 ])
5115
5116 AT_CLEANUP
5117
5118 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel set])
5119 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5120 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5121
5122 dnl set up sFlow logging
5123 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5124 AT_CAPTURE_FILE([sflow.log])
5125 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5126 ovs-appctl time/stop
5127
5128 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
5129 AT_CHECK([ovs-vsctl add-port br0 gre0 -- set Interface gre0 type=gre \
5130                     options:remote_ip=1.1.1.1 options:key=456 ofport_request=3])
5131 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy ofport_request=4])
5132
5133 AT_CHECK([ovs-ofctl add-flow br0 action=3])
5134
5135 dnl enable sflow
5136 ovs-vsctl \
5137    set Bridge br0 sflow=@sf -- \
5138    --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5139      header=128 sampling=1 polling=0
5140
5141 dnl introduce a packet that will be flooded to the tunnel
5142 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)'])
5143
5144 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5145 for i in `seq 1 30`; do
5146     ovs-appctl time/warp 100
5147 done
5148
5149 ovs-appctl -t test-sflow exit
5150
5151 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5152         /g']], [0], [dnl
5153 HEADER
5154         dgramSeqNo=1
5155         ds=127.0.0.1>2:1000
5156         fsSeqNo=1
5157         tunnel4_out_length=0
5158         tunnel4_out_protocol=47
5159         tunnel4_out_src=0.0.0.0
5160         tunnel4_out_dst=1.1.1.1
5161         tunnel4_out_src_port=0
5162         tunnel4_out_dst_port=0
5163         tunnel4_out_tcp_flags=0
5164         tunnel4_out_tos=1
5165         tunnel_out_vni=456
5166         in_vlan=0
5167         in_priority=0
5168         out_vlan=0
5169         out_priority=0
5170         meanSkip=1
5171         samplePool=1
5172         dropEvents=0
5173         in_ifindex=0
5174         in_format=0
5175         out_ifindex=1
5176         out_format=2
5177         hdr_prot=1
5178         pkt_len=64
5179         stripped=4
5180         hdr_len=60
5181         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
5182 ])
5183
5184 OVS_VSWITCHD_STOP
5185 AT_CLEANUP
5186
5187 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel push])
5188 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5189
5190 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 options:ifindex=1010])
5191
5192 dnl set up sFlow logging
5193 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5194 AT_CAPTURE_FILE([sflow.log])
5195 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5196 ovs-appctl time/stop
5197
5198 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5199 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
5200 AT_CHECK([ovs-vsctl -- add-port int-br t1 -- set Interface t1 type=gre \
5201                        options:remote_ip=1.1.2.92 options:key=456 ofport_request=4\
5202                     -- add-port int-br vm1 -- set Interface vm1 type=dummy \
5203                        options:ifindex=2011 ofport_request=5
5204                        ], [0])
5205
5206 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5207 dummy@ovs-dummy: hit:0 missed:0
5208         br0:
5209                 br0 65534/100: (dummy)
5210                 p0 1/1: (dummy: ifindex=1010)
5211         int-br:
5212                 int-br 65534/2: (dummy)
5213                 t1 4/4: (gre: key=456, remote_ip=1.1.2.92)
5214                 vm1 5/3: (dummy: ifindex=2011)
5215 ])
5216
5217 dnl set up route to 1.1.2.92 via br0 and action=normal
5218 AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
5219 ])
5220 AT_CHECK([ovs-appctl ovs/route/add 192.168.0.0/16 br0], [0], [OK
5221 ])
5222 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
5223 ])
5224 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5225
5226 dnl Prime ARP Cache for 1.1.2.92
5227 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)'])
5228
5229 dnl configure sflow on int-br only
5230 ovs-vsctl \
5231    set Bridge int-br sflow=@sf -- \
5232    --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5233      header=128 sampling=1 polling=0
5234
5235 dnl add rule for int-br to force packet onto tunnel. There is no ifindex
5236 dnl for this port so the sFlow output will just report that it went to
5237 dnl 1 output (out_format=2, out_ifindex=1)
5238 AT_CHECK([ovs-ofctl add-flow int-br "actions=4"])
5239
5240 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)'])
5241
5242 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5243 for i in `seq 1 30`; do
5244     ovs-appctl time/warp 100
5245 done
5246
5247 ovs-appctl -t test-sflow exit
5248
5249 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5250         /g']], [0], [dnl
5251 HEADER
5252         dgramSeqNo=1
5253         ds=127.0.0.1>2:1000
5254         fsSeqNo=1
5255         tunnel4_out_length=0
5256         tunnel4_out_protocol=47
5257         tunnel4_out_src=1.1.2.88
5258         tunnel4_out_dst=1.1.2.92
5259         tunnel4_out_src_port=0
5260         tunnel4_out_dst_port=0
5261         tunnel4_out_tcp_flags=0
5262         tunnel4_out_tos=0
5263         tunnel_out_vni=456
5264         in_vlan=0
5265         in_priority=0
5266         out_vlan=0
5267         out_priority=0
5268         meanSkip=1
5269         samplePool=1
5270         dropEvents=0
5271         in_ifindex=2011
5272         in_format=0
5273         out_ifindex=1
5274         out_format=2
5275         hdr_prot=1
5276         pkt_len=64
5277         stripped=4
5278         hdr_len=60
5279         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
5280 ])
5281
5282 OVS_VSWITCHD_STOP
5283 AT_CLEANUP
5284
5285 AT_SETUP([ofproto-dpif - sFlow packet sampling - MPLS])
5286 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5287 OVS_VSWITCHD_START
5288 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5289 ADD_OF_PORTS([br0], [1], [2])
5290 AT_DATA([flows.txt], [dnl
5291 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
5292 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
5293 ])
5294 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5295
5296 dnl set up sFlow logging
5297 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5298 AT_CAPTURE_FILE([sflow.log])
5299 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5300 ovs-appctl time/stop
5301
5302 dnl configure sflow
5303 ovs-vsctl \
5304    set Bridge br0 sflow=@sf -- \
5305    --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5306      header=128 sampling=1 polling=0
5307
5308 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)'])
5309 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)'])
5310
5311 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5312 for i in `seq 1 30`; do
5313     ovs-appctl time/warp 100
5314 done
5315
5316 ovs-appctl -t test-sflow exit
5317
5318 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5319         /g']], [0], [dnl
5320 HEADER
5321         dgramSeqNo=1
5322         ds=127.0.0.1>2:1000
5323         fsSeqNo=1
5324         mpls_label_0=789
5325         mpls_tc_0=4
5326         mpls_ttl_0=32
5327         mpls_bos_0=0
5328         mpls_label_1=11
5329         mpls_tc_1=3
5330         mpls_ttl_1=64
5331         mpls_bos_1=1
5332         in_vlan=0
5333         in_priority=0
5334         out_vlan=0
5335         out_priority=0
5336         meanSkip=1
5337         samplePool=1
5338         dropEvents=0
5339         in_ifindex=0
5340         in_format=0
5341         out_ifindex=1
5342         out_format=2
5343         hdr_prot=1
5344         pkt_len=64
5345         stripped=4
5346         hdr_len=60
5347         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
5348 HEADER
5349         dgramSeqNo=1
5350         ds=127.0.0.1>2:1000
5351         fsSeqNo=2
5352         mpls_label_0=789
5353         mpls_tc_0=4
5354         mpls_ttl_0=32
5355         mpls_bos_0=1
5356         in_vlan=0
5357         in_priority=0
5358         out_vlan=0
5359         out_priority=0
5360         meanSkip=1
5361         samplePool=2
5362         dropEvents=0
5363         in_ifindex=0
5364         in_format=0
5365         out_ifindex=1
5366         out_format=2
5367         hdr_prot=1
5368         pkt_len=64
5369         stripped=4
5370         hdr_len=60
5371         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
5372 ])
5373
5374 OVS_VSWITCHD_STOP
5375 AT_CLEANUP
5376
5377
5378 # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR)
5379 #
5380 # Test that basic NetFlow reports flow statistics correctly:
5381 # The initial packet of a flow are correctly accounted.
5382 # Later packets within a flow are correctly accounted.
5383 # Flow actions changing (in this case, due to MAC learning)
5384 # cause a record to be sent.
5385 m4_define([CHECK_NETFLOW_EXPIRATION],
5386   [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5387   ADD_OF_PORTS([br0], 1, 2)
5388
5389   ovs-appctl time/stop
5390   on_exit 'kill `cat test-netflow.pid`'
5391   AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
5392   AT_CAPTURE_FILE([netflow.log])
5393   PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
5394
5395   ovs-vsctl \
5396      set Bridge br0 netflow=@nf -- \
5397      --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5398        engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
5399
5400   for delay in 1000 30000; do
5401       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)'
5402       sleep 1  # ensure the order in which these two packets are processed
5403       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)'
5404
5405       ovs-appctl time/warp $delay
5406   done
5407
5408   ovs-appctl time/warp 6000
5409   ovs-appctl revalidator/wait
5410   OVS_VSWITCHD_STOP
5411   ovs-appctl -t test-netflow exit
5412
5413   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])
5414
5415   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])
5416
5417   combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
5418   separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
5419   AT_CHECK([test $separate = 2 || test $combined = 1], [0])])
5420
5421 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv4 collector])
5422 CHECK_NETFLOW_EXPIRATION([127.0.0.1])
5423 AT_CLEANUP
5424
5425 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv6 collector])
5426 AT_SKIP_IF([test $HAVE_IPV6 = no])
5427 CHECK_NETFLOW_EXPIRATION([[[::1]]])
5428 AT_CLEANUP
5429
5430 # CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR)
5431 #
5432 # Test that basic NetFlow reports active expirations correctly.
5433 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
5434   [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5435   ADD_OF_PORTS([br0], 1, 2)
5436
5437   on_exit 'kill `cat test-netflow.pid`'
5438   AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
5439   AT_CAPTURE_FILE([netflow.log])
5440   PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
5441
5442   ovs-vsctl \
5443      set Bridge br0 netflow=@nf -- \
5444      --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5445        engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
5446
5447   AT_CHECK([ovs-appctl time/stop])
5448   n=1
5449   while test $n -le 60; do
5450       n=`expr $n + 1`
5451
5452       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)'
5453       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)'
5454
5455       ovs-appctl time/warp 1000
5456   done
5457
5458   ovs-appctl time/warp 10000
5459
5460   ovs-appctl revalidator/wait
5461   OVS_VSWITCHD_STOP
5462   ovs-appctl -t test-netflow exit
5463
5464   # Count the number of reported packets:
5465   # - From source to destination before MAC learning kicks in (just one).
5466   # - From source to destination after that.
5467   # - From destination to source.
5468   n_learn=0
5469   n_in=0
5470   n_out=0
5471   n_other=0
5472   n_recs=0
5473   none=0
5474   while read line; do
5475       pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
5476       case $pkts in
5477            [[0-9]]*) ;;
5478        *) continue ;;
5479       esac
5480
5481       case $line in
5482           "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
5483               counter=n_learn
5484           ;;
5485       "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
5486           counter=n_in
5487           ;;
5488       "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
5489           counter=n_out
5490           ;;
5491       *)
5492           counter=n_other
5493           ;;
5494       esac
5495       eval $counter=\`expr \$$counter + \$pkts\`
5496       n_recs=`expr $n_recs + 1`
5497   done < netflow.log
5498
5499   # There should be exactly 1 MAC learning packet,
5500   # exactly 59 other packets in that direction,
5501   # and exactly 60 packets in the other direction.
5502   AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
5503 ])])
5504
5505 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv4 collector])
5506 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1])
5507 AT_CLEANUP
5508
5509 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv6 collector])
5510 AT_SKIP_IF([test $HAVE_IPV6 = no])
5511 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]])
5512 AT_CLEANUP
5513
5514 dnl In the absence of an IPFIX collector to verify protocol correctness, simply
5515 dnl configure IPFIX and ensure that sample action generation works at the
5516 dnl datapath level.
5517 AT_SETUP([ofproto-dpif - Basic IPFIX sanity check])
5518 OVS_VSWITCHD_START
5519 ADD_OF_PORTS([br0], 1, 2)
5520
5521 dnl Sample every packet using bridge-based sampling
5522 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
5523                     --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
5524                               sampling=1], [0], [ignore])
5525
5526 dnl Send some packets that should be sampled
5527 for i in `seq 1 3`; do
5528     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)'])
5529 done
5530 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
5531 flow-dump from non-dpdk interfaces:
5532 packets:2, bytes:120, used:0.001s, actions:sample(sample=100.0%,actions(userspace(pid=0,ipfix(output_port=4294967295))))
5533 ])
5534
5535 dnl Remove the IPFIX configuration
5536 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
5537 AT_CHECK([ovs-appctl revalidator/purge])
5538
5539 dnl Send some more packets, to ensure that these are not sampled.
5540 for i in `seq 1 3`; do
5541     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)'])
5542 done
5543 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
5544 flow-dump from non-dpdk interfaces:
5545 packets:2, bytes:120, used:0.001s, actions:drop
5546 ])
5547
5548 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
5549 AT_CLEANUP
5550
5551 AT_SETUP([ofproto-dpif - flow stats])
5552 OVS_VSWITCHD_START
5553 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
5554 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
5555
5556 ovs-appctl time/stop
5557
5558 for i in `seq 1 10`; do
5559     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)'
5560 done
5561
5562 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
5563 AT_CHECK([ovs-appctl revalidator/purge], [0])
5564 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5565 AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
5566  cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
5567  cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
5568 ])
5569 OVS_VSWITCHD_STOP
5570 AT_CLEANUP
5571
5572 AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
5573 OVS_VSWITCHD_START
5574 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
5575 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
5576
5577 ovs-appctl time/stop
5578
5579 for i in `seq 1 10`; do
5580     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)'
5581 done
5582
5583 ovs-appctl time/warp 100
5584 AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
5585 ovs-appctl time/warp 1000
5586
5587 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5588 AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
5589  cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
5590  cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
5591 ])
5592 OVS_VSWITCHD_STOP
5593 AT_CLEANUP
5594
5595 AT_SETUP([ofproto-dpif - idle_age and hard_age increase over time])
5596 OVS_VSWITCHD_START
5597
5598 # get_ages DURATION HARD IDLE
5599 #
5600 # Fetch the flow duration, hard age, and idle age into the variables
5601 # whose names are given as arguments.  Rounds DURATION down to the
5602 # nearest integer.  If hard_age doesn't appear in the output, sets
5603 # HARD to "none".  If idle_age doesn't appear in the output, sets IDLE
5604 # to 0.
5605 get_ages () {
5606     AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5607
5608     duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
5609     AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
5610     AS_VAR_COPY([$1], [duration])
5611
5612     hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
5613     if test X"$hard" = X; then
5614         hard=none
5615     else
5616         AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
5617     fi
5618     AS_VAR_COPY([$2], [hard])
5619
5620     idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
5621     if test X"$idle" = X; then
5622         idle=0
5623     else
5624         AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
5625     fi
5626     AS_VAR_COPY([$3], [idle])
5627 }
5628
5629 # Add a flow and get its initial hard and idle age.
5630 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
5631 get_ages duration1 hard1 idle1
5632
5633 ovs-appctl time/stop
5634 # Warp time forward by 10 seconds, then modify the flow's actions.
5635 ovs-appctl time/warp 10000
5636 get_ages duration2 hard2 idle2
5637 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
5638
5639 # Warp time forward by 10 seconds.
5640 ovs-appctl time/warp 10000
5641 get_ages duration3 hard3 idle3
5642
5643 # Warp time forward 10 more seconds, then pass some packets through the flow,
5644 # then warp forward a few more times because idle times are only updated
5645 # occasionally.
5646 ovs-appctl time/warp 10000
5647 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)'
5648 ovs-appctl time/warp 3000 1000
5649 sleep 1
5650 get_ages duration4 hard4 idle4
5651
5652 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
5653 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
5654 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
5655
5656 # Duration should increase steadily over time.
5657 AT_CHECK([test $duration1 -lt $duration2])
5658 AT_CHECK([test $duration2 -lt $duration3])
5659 AT_CHECK([test $duration3 -lt $duration4])
5660
5661 # Hard age should be "none" initially because it's the same as flow_duration,
5662 # then it should increase.
5663 AT_CHECK([test $hard1 = none])
5664 AT_CHECK([test $hard2 = none])
5665 AT_CHECK([test $hard3 != none])
5666 AT_CHECK([test $hard4 != none])
5667 AT_CHECK([test $hard3 -lt $hard4])
5668
5669 # Idle age should increase from 1 to 2 to 3, then decrease.
5670 AT_CHECK([test $idle1 -lt $idle2])
5671 AT_CHECK([test $idle2 -lt $idle3])
5672 AT_CHECK([test $idle3 -gt $idle4])
5673
5674 # Check some invariant relationships.
5675 AT_CHECK([test $duration1 = $idle1])
5676 AT_CHECK([test $duration2 = $idle2])
5677 AT_CHECK([test $duration3 = $idle3])
5678 AT_CHECK([test $idle3 -gt $hard3])
5679 AT_CHECK([test $idle4 -lt $hard4])
5680 AT_CHECK([test $hard4 -lt $duration4])
5681
5682 OVS_VSWITCHD_STOP
5683 AT_CLEANUP
5684
5685 AT_SETUP([ofproto-dpif - fin_timeout])
5686 OVS_VSWITCHD_START
5687 ovs-appctl time/stop
5688 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
5689 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5690 [NXST_FLOW reply:
5691  idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5692 ])
5693
5694 # Check that a TCP SYN packet does not change the timeout.  (Because
5695 # flow stats updates are mainly what implements the fin_timeout
5696 # feature, we warp forward a couple of times to ensure that flow stats
5697 # run before re-checking the flow table.)
5698 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
5699 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5700 warped
5701 ])
5702 AT_CHECK([ovs-appctl revalidator/purge], [0])
5703 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5704 [NXST_FLOW reply:
5705  n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5706 ])
5707 # Check that a TCP FIN packet does change the timeout.
5708 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
5709 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5710 warped
5711 ])
5712 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5713 [NXST_FLOW reply:
5714  n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
5715 ])
5716 OVS_VSWITCHD_STOP
5717 AT_CLEANUP
5718
5719 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
5720 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5721 ADD_OF_PORTS([br0], [1], [2])
5722 ADD_OF_PORTS([br1], [3])
5723
5724 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
5725 dummy@br0
5726 dummy@br1
5727 ])
5728 OVS_VSWITCHD_STOP
5729 AT_CLEANUP
5730
5731 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
5732 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5733 ADD_OF_PORTS([br0], [1], [2])
5734 ADD_OF_PORTS([br1], [3])
5735
5736 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5737 dummy@ovs-dummy: hit:0 missed:0
5738         br0:
5739                 br0 65534/100: (dummy)
5740                 p1 1/1: (dummy)
5741                 p2 2/2: (dummy)
5742         br1:
5743                 br1 65534/101: (dummy)
5744                 p3 3/3: (dummy)
5745 ])
5746 OVS_VSWITCHD_STOP
5747 AT_CLEANUP
5748
5749 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
5750 # bump max-idle to avoid the flows being reclaimed behind us
5751 OVS_VSWITCHD_START([add-br br1 -- \
5752                     set bridge br1 datapath-type=dummy fail-mode=secure -- \
5753                     set Open_vSwitch . other_config:max-idle=10000])
5754 ADD_OF_PORTS([br0], [1], [2])
5755 ADD_OF_PORTS([br1], [3])
5756
5757 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)'])
5758 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)'])
5759 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)'])
5760 ovs-appctl revalidator/wait
5761 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5762 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5763 recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5764 ])
5765
5766 AT_CHECK([ovs-appctl dpif/dump-flows br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5767 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5768 ])
5769
5770 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5771 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
5772 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
5773 ])
5774
5775 AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
5776 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
5777 ])
5778
5779 OVS_VSWITCHD_STOP
5780 AT_CLEANUP
5781
5782 AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow])
5783
5784 OVS_VSWITCHD_START([add-br br1 -- \
5785                     set bridge br1 datapath-type=dummy fail-mode=secure -- \
5786                     set Open_vSwitch . other_config:max-idle=10000])
5787 ADD_OF_PORTS([br0], [1], [2])
5788
5789 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)'])
5790 ovs-appctl revalidator/wait
5791 AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
5792
5793 UFID=`sed -n 's/\(ufid:[[-0-9a-fA-F]]*\).*/\1/p' stdout`
5794 AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
5795 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5796 ])
5797
5798 OVS_VSWITCHD_STOP
5799 AT_CLEANUP
5800
5801 AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
5802 OVS_VSWITCHD_START([dnl
5803    add-port br0 p1 -- set Interface p1 type=dummy
5804 ])
5805 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5806 on_exit 'kill `cat ovs-ofctl.pid`'
5807
5808 AT_CAPTURE_FILE([ofctl_monitor.log])
5809 AT_DATA([flows.txt], [dnl
5810 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5811 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5812 ])
5813 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5814
5815 dnl Packet is sent to userspace because a MPLS push or pop action is applied to
5816 dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
5817 dnl
5818 dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
5819 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)
5820 dnl         (label 20, exp 0, [S], ttl 32)
5821 dnl         (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5822 dnl     192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
5823
5824 for dl_src in 00 01; do
5825     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"])
5826 done
5827 sleep 1  # wait for the datapath flow installed
5828 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5829 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))
5830 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))
5831 ])
5832
5833 OVS_VSWITCHD_STOP
5834 AT_CLEANUP
5835
5836
5837 AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
5838 OVS_VSWITCHD_START([dnl
5839    add-port br0 p1 -- set Interface p1 type=dummy
5840 ])
5841 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5842 on_exit 'kill `cat ovs-ofctl.pid`'
5843
5844 AT_CAPTURE_FILE([ofctl_monitor.log])
5845 AT_DATA([flows.txt], [dnl
5846 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5847 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5848 ])
5849 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5850
5851 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
5852 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
5853 dnl can't determine the resulting MPLS label after MPLS push/pop actions.
5854 dnl
5855 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
5856 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)
5857 dnl         (label 20, exp 0, ttl 32)
5858 dnl         (label 20, exp 0, ttl 32)
5859 dnl         (label 20, exp 0, [S], ttl 32)
5860 dnl         (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5861 dnl     192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
5862
5863 for dl_src in 00 01; do
5864     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"])
5865 done
5866 sleep 1  # wait for the datapath flow installed
5867 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5868 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))
5869 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))
5870 ])
5871
5872 OVS_VSWITCHD_STOP
5873 AT_CLEANUP
5874
5875 AT_SETUP([ofproto-dpif - patch ports])
5876 OVS_VSWITCHD_START([add-br br1 \
5877 -- set bridge br1 datapath-type=dummy fail-mode=secure \
5878 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
5879 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5880
5881 ADD_OF_PORTS([br0], [2])
5882 ADD_OF_PORTS([br1], [3])
5883
5884 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5885 ], [])
5886 AT_CHECK([ovs-appctl time/stop])
5887 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5888
5889 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
5890 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
5891
5892 for i in $(seq 1 10); do
5893     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)'
5894     if [[ $i -eq 1 ]]; then
5895         sleep 1
5896     fi
5897 done
5898
5899 for i in $(seq 1 5); do
5900     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)'
5901     if [[ $i -eq 1 ]]; then
5902         sleep 1
5903     fi
5904 done
5905
5906 AT_CHECK([ovs-appctl time/warp 500], [0],
5907 [warped
5908 ])
5909 sleep 1  # wait for log writer
5910
5911 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5912 dummy@ovs-dummy: hit:13 missed:2
5913         br0:
5914                 br0 65534/100: (dummy)
5915                 p2 2/2: (dummy)
5916                 pbr0 1/none: (patch: peer=pbr1)
5917         br1:
5918                 br1 65534/101: (dummy)
5919                 p3 3/3: (dummy)
5920                 pbr1 1/none: (patch: peer=pbr0)
5921 ])
5922
5923 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5924 recirc_id=0,ip,in_port=100,vlan_tci=0x0000,nw_frag=no, actions:101,3,2
5925 recirc_id=0,ip,in_port=101,vlan_tci=0x0000,nw_frag=no, actions:100,2,3
5926 ])
5927
5928 AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
5929 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
5930 ])
5931 AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
5932 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
5933 ])
5934
5935 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
5936 OFPST_PORT reply (xid=0x4): 1 ports
5937   port  1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
5938            tx pkts=10, bytes=600, drop=0, errs=0, coll=0
5939 ])
5940
5941 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
5942 OFPST_PORT reply (xid=0x4): 1 ports
5943   port  1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
5944            tx pkts=5, bytes=300, drop=0, errs=0, coll=0
5945 ])
5946
5947 OVS_VSWITCHD_STOP
5948 AT_CLEANUP
5949
5950 AT_SETUP([ofproto-dpif - patch ports - stack])
5951 OVS_VSWITCHD_START([add-br br1 \
5952 -- set bridge br1 datapath-type=dummy fail-mode=secure \
5953 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
5954 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5955
5956 ADD_OF_PORTS([br0], [2])
5957 ADD_OF_PORTS([br1], [3])
5958
5959 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5960 ], [])
5961 AT_CHECK([ovs-appctl time/stop])
5962 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5963
5964 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"])
5965 # Try to pop from empty stack, and push and leave data to stack.
5966 AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"])
5967
5968 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)'
5969
5970 AT_CHECK([ovs-appctl time/warp 500], [0],
5971 [warped
5972 ])
5973
5974 OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1])
5975
5976 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5977 dummy@ovs-dummy: hit:0 missed:1
5978         br0:
5979                 br0 65534/100: (dummy)
5980                 p2 2/2: (dummy)
5981                 pbr0 1/none: (patch: peer=pbr1)
5982         br1:
5983                 br1 65534/101: (dummy)
5984                 p3 3/3: (dummy)
5985                 pbr1 1/none: (patch: peer=pbr0)
5986 ])
5987
5988 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5989 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
5990 ])
5991
5992 AT_CHECK([cat ovs-vswitchd.log | grep -e '|nx_match|WARN|' | sed "s/^.*|WARN|//"], [0], [dnl
5993 Failed to pop from an empty stack. On flow
5994 ])
5995
5996 OVS_VSWITCHD_STOP(["/Failed to pop from an empty stack/d"])
5997 AT_CLEANUP
5998
5999 AT_SETUP([ofproto-dpif - port duration])
6000 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
6001 ADD_OF_PORTS([br0], 1, 2)
6002
6003 ovs-appctl time/stop
6004 ovs-appctl time/warp 10000
6005
6006 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
6007 AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
6008 [dnl
6009            duration=?s
6010            duration=?s
6011            duration=?s
6012 ])
6013 OVS_VSWITCHD_STOP
6014 AT_CLEANUP
6015
6016 dnl ----------------------------------------------------------------------
6017 AT_BANNER([ofproto-dpif -- megaflows])
6018
6019 AT_SETUP([ofproto-dpif megaflow - port classification])
6020 OVS_VSWITCHD_START
6021 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6022 ADD_OF_PORTS([br0], [1], [2])
6023 AT_DATA([flows.txt], [dnl
6024 table=0 in_port=1 actions=output(2)
6025 ])
6026 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6027 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)'])
6028 sleep 1
6029 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)'])
6030 sleep 1
6031 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6032 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,nw_frag=no, actions: <del>
6033 ])
6034 OVS_VSWITCHD_STOP
6035 AT_CLEANUP
6036
6037 AT_SETUP([ofproto-dpif megaflow - L2 classification])
6038 OVS_VSWITCHD_START
6039 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6040 ADD_OF_PORTS([br0], [1], [2])
6041 AT_DATA([flows.txt], [dnl
6042 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
6043 ])
6044 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6045 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)'])
6046 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)'])
6047 sleep 1
6048 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6049 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
6050 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>
6051 ])
6052 OVS_VSWITCHD_STOP
6053 AT_CLEANUP
6054
6055 AT_SETUP([ofproto-dpif megaflow - L3 classification])
6056 OVS_VSWITCHD_START
6057 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6058 ADD_OF_PORTS([br0], [1], [2])
6059 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], [])
6060 AT_DATA([flows.txt], [dnl
6061 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
6062 ])
6063 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6064 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)'])
6065 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)'])
6066 sleep 1
6067 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6068 recirc_id=0,icmp,in_port=1,vlan_tci=0x0000,nw_src=10.0.0.4,nw_frag=no, actions: <del>
6069 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>
6070 ])
6071 OVS_VSWITCHD_STOP
6072 AT_CLEANUP
6073
6074 AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
6075 OVS_VSWITCHD_START
6076 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6077 ADD_OF_PORTS([br0], [1], [2])
6078 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], [])
6079 AT_DATA([flows.txt], [dnl
6080 table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
6081 ])
6082 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6083 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)'])
6084 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(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)'])
6085 sleep 1
6086 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6087 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>
6088 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>
6089 ])
6090 OVS_VSWITCHD_STOP
6091 AT_CLEANUP
6092
6093 AT_SETUP([ofproto-dpif megaflow - L4 classification])
6094 OVS_VSWITCHD_START
6095 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6096 ADD_OF_PORTS([br0], [1], [2])
6097 AT_DATA([flows.txt], [dnl
6098 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
6099 ])
6100 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6101 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)'])
6102 sleep 1
6103 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)'])
6104 sleep 1
6105 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6106 recirc_id=0,icmp,in_port=1,vlan_tci=0x0000,nw_frag=no,icmp_type=0x8/0xff, actions: <del>
6107 ])
6108 OVS_VSWITCHD_STOP
6109 AT_CLEANUP
6110
6111 AT_SETUP([ofproto-dpif megaflow - normal])
6112 OVS_VSWITCHD_START
6113 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6114 ADD_OF_PORTS([br0], [1], [2])
6115 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
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 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)'])
6118 sleep 1
6119 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6120 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>
6121 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>
6122 ])
6123 OVS_VSWITCHD_STOP
6124 AT_CLEANUP
6125
6126 AT_SETUP([ofproto-dpif megaflow - mpls])
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 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
6132 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
6133 ])
6134 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6135 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)'])
6136 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)'])
6137 sleep 1
6138 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6139 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>
6140 recirc_id=0,mpls,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,mpls_bos=1, actions: <del>
6141 ])
6142 OVS_VSWITCHD_STOP
6143 AT_CLEANUP
6144
6145 # CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR)
6146 m4_define([CHECK_MEGAFLOW_NETFLOW],
6147   [OVS_VSWITCHD_START
6148   AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6149   ADD_OF_PORTS([br0], [1], [2])
6150
6151   dnl NetFlow configuration disables wildcarding relevant fields
6152   on_exit 'kill `cat test-netflow.pid`'
6153   AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6154   AT_CAPTURE_FILE([netflow.log])
6155   PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6156   ovs-vsctl \
6157      set Bridge br0 netflow=@nf -- \
6158      --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6159        engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
6160
6161   AT_CHECK([ovs-ofctl add-flow br0 action=normal])
6162   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)'])
6163   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)'])
6164   sleep 1
6165   AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6166 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>
6167 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>
6168 ])
6169   OVS_VSWITCHD_STOP])
6170
6171 AT_SETUP([ofproto-dpif megaflow - netflow - IPv4 collector])
6172 CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
6173 AT_CLEANUP
6174
6175 AT_SETUP([ofproto-dpif megaflow - netflow - IPv6 collector])
6176 AT_SKIP_IF([test $HAVE_IPV6 = no])
6177 CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
6178 AT_CLEANUP
6179
6180 AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
6181 OVS_VSWITCHD_START(
6182   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
6183    add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
6184    set interface p2 type=dummy ofport_request=2 -- \
6185    set interface p3 type=dummy ofport_request=3])
6186 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
6187 ])
6188 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6189
6190 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
6191 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)'])
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([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6195 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>
6196 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>
6197 ])
6198 OVS_VSWITCHD_STOP
6199 AT_CLEANUP
6200
6201 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
6202 OVS_VSWITCHD_START(
6203   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
6204    add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
6205    set interface p2 type=dummy ofport_request=2 -- \
6206    set interface p3 type=dummy ofport_request=3])
6207 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
6208 ])
6209 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6210
6211 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
6212 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)'])
6213 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)'])
6214 sleep 1
6215 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6216 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>
6217 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>
6218 ])
6219 OVS_VSWITCHD_STOP
6220 AT_CLEANUP
6221
6222 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
6223 # Create bond0 on br0 with interfaces p0 and p1
6224 #    and bond1 on br1 with interfaces p2 and p3
6225 # with p0 patched to p2 and p1 patched to p3.
6226 OVS_VSWITCHD_START(
6227   [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
6228                             other-config:lacp-time=fast \
6229                             other-config:bond-rebalance-interval=0 -- \
6230    set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
6231    set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
6232    add-br br1 -- \
6233    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
6234    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
6235                   fail-mode=secure -- \
6236    add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
6237                             other-config:lacp-time=fast \
6238                             other-config:bond-rebalance-interval=0 -- \
6239    set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
6240    set interface p3 type=patch options:peer=p1 ofport_request=4 --])
6241
6242 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
6243 ])
6244 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6245 ADD_OF_PORTS([br0], [7])
6246 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
6247 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
6248 ovs-appctl time/stop
6249 ovs-appctl time/warp 5000
6250 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)'])
6251 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)'])
6252 sleep 1
6253 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6254 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>
6255 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>
6256 ])
6257 OVS_VSWITCHD_STOP
6258 AT_CLEANUP
6259
6260 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
6261 OVS_VSWITCHD_START
6262 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6263 ADD_OF_PORTS([br0], [1], [2])
6264 AT_DATA([flows.txt], [dnl
6265 table=0 in_port=1,ip actions=resubmit(90)
6266 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
6267 ])
6268 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6269 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)'])
6270 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)'])
6271 sleep 1
6272 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6273 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
6274 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>
6275 ])
6276 OVS_VSWITCHD_STOP
6277 AT_CLEANUP
6278
6279 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
6280 OVS_VSWITCHD_START
6281 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6282 ADD_OF_PORTS([br0], [1], [2])
6283 AT_DATA([flows.txt], [dnl
6284 table=0 in_port=1,ip actions=resubmit(,1)
6285 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
6286 ])
6287 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6288 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)'])
6289 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=
6290 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6291 sleep 1
6292 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6293 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
6294 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
6295 ])
6296 OVS_VSWITCHD_STOP
6297 AT_CLEANUP
6298
6299 AT_SETUP([ofproto-dpif megaflow - goto_table action])
6300 OVS_VSWITCHD_START
6301 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6302 ADD_OF_PORTS([br0], [1], [2])
6303 AT_DATA([flows.txt], [dnl
6304 table=0 in_port=1,ip actions=goto_table(1)
6305 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
6306 ])
6307 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
6308 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)'])
6309 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)'])
6310 sleep 1
6311 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6312 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
6313 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
6314 ])
6315 OVS_VSWITCHD_STOP
6316 AT_CLEANUP
6317
6318 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
6319 OVS_VSWITCHD_START
6320 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6321 ADD_OF_PORTS([br0], [1], [2], [3])
6322 ovs-vsctl \
6323         set Bridge br0 mirrors=@m --\
6324         --id=@p3 get Port p3 --\
6325         --id=@m create Mirror name=mymirror select_all=true output_port=@p3
6326
6327 AT_DATA([flows.txt], [dnl
6328 in_port=1 actions=output:2
6329 ])
6330 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6331 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)'])
6332 sleep 1
6333 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)'])
6334 sleep 1
6335 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6336 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,nw_frag=no, actions: <del>
6337 ])
6338 OVS_VSWITCHD_STOP
6339 AT_CLEANUP
6340
6341 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
6342 OVS_VSWITCHD_START
6343 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6344 ADD_OF_PORTS([br0], [1], [2], [3])
6345 ovs-vsctl \
6346         set Bridge br0 mirrors=@m --\
6347         --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
6348         --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
6349
6350 AT_DATA([flows.txt], [dnl
6351 in_port=1 actions=output:2
6352 ])
6353 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6354 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))'])
6355 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)'])
6356 sleep 1
6357 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6358 recirc_id=0,ip,in_port=1,dl_vlan=11,nw_frag=no, actions: <del>
6359 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,nw_frag=no, actions: <del>
6360 ])
6361 OVS_VSWITCHD_STOP
6362 AT_CLEANUP
6363
6364 AT_SETUP([ofproto-dpif megaflow - move action])
6365 OVS_VSWITCHD_START
6366 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6367 ADD_OF_PORTS([br0], [1], [2])
6368 AT_DATA([flows.txt], [dnl
6369 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
6370 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
6371 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
6372 ])
6373 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6374 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)'])
6375 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)'])
6376 sleep 1
6377 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6378 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,nw_src=10.0.0.2,nw_frag=no, actions: <del>
6379 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,nw_src=10.0.0.4,nw_frag=no, actions: <del>
6380 ])
6381 OVS_VSWITCHD_STOP
6382 AT_CLEANUP
6383
6384 AT_SETUP([ofproto-dpif megaflow - push action])
6385 OVS_VSWITCHD_START
6386 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6387 ADD_OF_PORTS([br0], [1], [2])
6388 AT_DATA([flows.txt], [dnl
6389 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
6390 ])
6391 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6392 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)'])
6393 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)'])
6394 sleep 1
6395 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6396 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,nw_src=10.0.0.2,nw_frag=no, actions: <del>
6397 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,nw_src=10.0.0.4,nw_frag=no, actions: <del>
6398 ])
6399 OVS_VSWITCHD_STOP
6400 AT_CLEANUP
6401
6402 AT_SETUP([ofproto-dpif megaflow - learning])
6403 OVS_VSWITCHD_START
6404 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6405 ADD_OF_PORTS([br0], [1], [2])
6406 AT_DATA([flows.txt], [dnl
6407 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
6408 ])
6409 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6410 ovs-appctl time/stop
6411 # We send each packet twice because the first packet in each flow causes the
6412 # flow table to change and thus revalidations, which (depending on timing)
6413 # can keep a megaflow from being installed.  The revalidations are done by
6414 # the second iteration, allowing the flows to be installed.
6415 for i in 1 2; do
6416     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)'])
6417     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)'])
6418     ovs-appctl time/warp 100
6419 done
6420 sleep 1
6421 dnl The original flow is missing due to a revalidation.
6422 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6423 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
6424 recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
6425 ])
6426 OVS_VSWITCHD_STOP
6427 AT_CLEANUP
6428
6429 AT_SETUP([ofproto-dpif megaflow - tunnels])
6430 OVS_VSWITCHD_START(
6431   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
6432 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6433 AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
6434      options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
6435 AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
6436           ofport_request=3])
6437 AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
6438      options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
6439      ofport_request=4 options:key=flow])
6440 AT_DATA([flows.txt], [dnl
6441 in_port=1,actions=output(2)
6442 in_port=3,actions=output(4)
6443 ])
6444 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6445 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
6446 dnl will cause the packet to be dropped.
6447 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)'])
6448 sleep 1
6449 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)'])
6450 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)'])
6451 sleep 1
6452 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)'])
6453 sleep 1
6454 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6455 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,nw_ecn=1,nw_frag=no, actions: <del>
6456 recirc_id=0,ip,in_port=3,vlan_tci=0x0000,nw_tos=0,nw_ecn=1,nw_ttl=64,nw_frag=no, actions: <del>
6457 recirc_id=0,ip,in_port=3,vlan_tci=0x0000,nw_tos=252,nw_ecn=1,nw_ttl=128,nw_frag=no, actions: <del>
6458 ])
6459 OVS_VSWITCHD_STOP
6460 AT_CLEANUP
6461
6462 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
6463 OVS_VSWITCHD_START
6464 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6465 ADD_OF_PORTS([br0], [1], [2])
6466 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], [])
6467 AT_DATA([flows.txt], [dnl
6468 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
6469 ])
6470 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6471 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)'])
6472 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)'])
6473 sleep 1
6474 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
6475 recirc_id=0,icmp,in_port=1,vlan_tci=0x0000,nw_src=10.0.0.4,nw_ttl=64,nw_frag=no, actions: <del>
6476 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>
6477 ])
6478 OVS_VSWITCHD_STOP
6479 AT_CLEANUP
6480
6481 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
6482 OVS_VSWITCHD_START
6483 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6484 ADD_OF_PORTS([br0], [1], [2])
6485 AT_DATA([flows.txt], [dnl
6486 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
6487 ])
6488 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6489 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)'])
6490 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)'])
6491 sleep 1
6492 dnl The first packet is essentially a no-op, as the new destination MAC is the
6493 dnl same as the original.  The second entry actually updates the destination
6494 dnl MAC.
6495 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
6496 recirc_id=0,ip,in_port=1,vlan_tci=0x0000,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions:2
6497 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
6498 ])
6499 OVS_VSWITCHD_STOP
6500 AT_CLEANUP
6501
6502 AT_SETUP([ofproto-dpif megaflow - disabled])
6503 OVS_VSWITCHD_START
6504 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6505 ADD_OF_PORTS([br0], [1], [2])
6506 AT_DATA([flows.txt], [dnl
6507 table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
6508 table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
6509 ])
6510 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
6511 ], [])
6512 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
6513 ], [])
6514 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
6515 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6516 for i in 1 2 3 4; do
6517     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)'])
6518     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)'])
6519     if [[ $i -eq 1 ]]; then
6520         sleep 1
6521     fi
6522 done
6523 sleep 1
6524 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
6525 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
6526 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
6527 ])
6528 AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_DUMP | grep 'packets:3'], [0], [dnl
6529 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
6530 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
6531 ])
6532 OVS_VSWITCHD_STOP
6533 AT_CLEANUP
6534
6535 AT_SETUP([ofproto-dpif - datapath port number change])
6536 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6537 ADD_OF_PORTS([br0], 1)
6538
6539 # Trace a flow that should output to p1.
6540 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6541   [0], [stdout])
6542 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
6543 ])
6544
6545 # Change p1's port number to 5.
6546 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
6547
6548 # Trace a flow that should output to p1 in its new location.
6549 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6550   [0], [stdout])
6551 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
6552 ])
6553 OVS_VSWITCHD_STOP
6554 AT_CLEANUP
6555
6556 # Tests the bundling with various bfd and cfm configurations.
6557 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
6558 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
6559                     add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
6560                     add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
6561                     set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
6562                     set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
6563                     set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
6564                     set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
6565                     set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
6566                     set Interface p0 cfm_mpid=1 -- \
6567                     set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
6568
6569 ovs-appctl time/stop
6570 # advance the clock to stablize everything.
6571 ovs-appctl time/warp 5000 100
6572 # cfm/show should show 'recv' fault.
6573 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6574         fault: recv
6575 ])
6576 # bfd/show should show 'up'.
6577 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6578         Local Session State: up
6579         Remote Session State: up
6580         Local Session State: up
6581         Remote Session State: up
6582 ])
6583 # bond/show should show 'may-enable: true' for all slaves.
6584 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6585         may_enable: true
6586         may_enable: true
6587         may_enable: true
6588         may_enable: true
6589 ])
6590
6591 # now disable the bfd on p1.
6592 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
6593 # advance the clock to stablize everything.
6594 ovs-appctl time/warp 5000 100
6595 # cfm/show should show 'recv' fault.
6596 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6597         fault: recv
6598 ])
6599 # bfd/show should show 'down'.
6600 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6601         Local Session State: down
6602         Remote Session State: down
6603 ])
6604 # bond/show should show 'may-enable: false' for p0.
6605 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6606         may_enable: false
6607         may_enable: true
6608 ])
6609
6610 # now enable the bfd on p1 and disable bfd on p0.
6611 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
6612 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
6613 # advance the clock to stablize everything.
6614 ovs-appctl time/warp 5000 100
6615 # cfm/show should show 'recv' fault.
6616 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6617         fault: recv
6618 ])
6619 # bfd/show should show 'down'.
6620 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6621         Local Session State: down
6622         Remote Session State: down
6623 ])
6624 # bond/show should show 'may-enable: false' for p0 and p1.
6625 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6626         may_enable: false
6627         may_enable: true
6628         may_enable: false
6629         may_enable: true
6630 ])
6631
6632 OVS_VSWITCHD_STOP
6633 AT_CLEANUP
6634
6635 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
6636 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
6637
6638 # enable bfd on p0.
6639 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
6640 # check log.
6641 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
6642 # disable bfd on p0.
6643 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
6644 # check log.
6645 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
6646 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
6647
6648 # enable cfm on p0.
6649 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
6650 # check log.
6651 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
6652 # disable cfm on p0.
6653 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
6654 # check log.
6655 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
6656 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
6657
6658 # enable both bfd and cfm on p0.
6659 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
6660 # check log.
6661 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
6662 # disable bfd on p0.
6663 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
6664 # check log, there should not be the log of thread terminated.
6665 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
6666 ])
6667 # reenable bfd on p0.
6668 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
6669 # check log, should still be on log of thread created.
6670 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
6671 monitor thread created
6672 ])
6673 # disable bfd and cfm together.
6674 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
6675 # check log.
6676 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
6677
6678 OVS_VSWITCHD_STOP
6679 AT_CLEANUP
6680
6681 # this test helps avoid the deadlock between the main thread and monitor thread.
6682 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
6683 OVS_VSWITCHD_START
6684
6685 for i in `seq 1 199`
6686 do
6687     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])
6688 done
6689
6690 OVS_VSWITCHD_STOP
6691 AT_CLEANUP
6692 \f
6693 AT_BANNER([ofproto-dpif - flow translation resource limits])
6694
6695 AT_SETUP([ofproto-dpif - infinite resubmit])
6696 OVS_VSWITCHD_START
6697 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
6698 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
6699   [0], [stdout])
6700 AT_CHECK([tail -1 stdout], [0],
6701   [Translation failed (Recursion too deep), packet is dropped.
6702 ])
6703 AT_CHECK([grep -c 'resubmit actions recursed over 64 times' stdout],
6704   [0], [1
6705 ])
6706 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
6707 AT_CLEANUP
6708
6709 AT_SETUP([ofproto-dpif - exponential resubmit chain])
6710 OVS_VSWITCHD_START
6711 ADD_OF_PORTS([br0], 1)
6712 (for i in `seq 1 64`; do
6713      j=`expr $i + 1`
6714      echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6715  done
6716  echo "in_port=65, actions=local") > flows
6717  AT_CHECK([ovs-ofctl add-flows br0 flows])
6718 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
6719 AT_CHECK([tail -1 stdout], [0],
6720   [Translation failed (Too many resubmits), packet is dropped.
6721 ])
6722 AT_CHECK([grep -c 'over 4096 resubmit actions' stdout], [0], [1
6723 ])
6724 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
6725 AT_CLEANUP
6726
6727 AT_SETUP([ofproto-dpif - too many output actions])
6728 OVS_VSWITCHD_START
6729 ADD_OF_PORTS([br0], 1)
6730 (for i in `seq 1 12`; do
6731      j=`expr $i + 1`
6732      echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6733  done
6734  echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
6735 AT_CHECK([ovs-ofctl add-flows br0 flows])
6736 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
6737 AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
6738   [0], [1
6739 ])
6740 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' stdout], [0], [1
6741 ])
6742 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
6743 AT_CLEANUP
6744
6745 AT_SETUP([ofproto-dpif - stack too deep])
6746 OVS_VSWITCHD_START
6747 ADD_OF_PORTS([br0], 1)
6748 (for i in `seq 1 12`; do
6749      j=`expr $i + 1`
6750      echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6751  done
6752  push="push:NXM_NX_REG0[[]]"
6753  echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
6754  AT_CHECK([ovs-ofctl add-flows br0 flows])
6755 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
6756 AT_CHECK([tail -1 stdout], [0],
6757   [Translation failed (Stack too deep), packet is dropped.
6758 ])
6759 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' stdout], [0], [1
6760 ])
6761 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
6762 AT_CLEANUP
6763
6764
6765 AT_SETUP([ofproto-dpif packet-out controller])
6766 OVS_VSWITCHD_START
6767 ADD_OF_PORTS([br0], 1, 2)
6768
6769 AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
6770
6771 AT_CAPTURE_FILE([ofctl_monitor.log])
6772 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6773
6774 for i in 1 2 3; do
6775         AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
6776 done
6777
6778 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6779 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6780 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
6781 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6782 dnl
6783 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
6784 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6785 dnl
6786 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
6787 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6788 ])
6789
6790 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6791  dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6792 NXST_FLOW reply:
6793 ])
6794
6795 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6796   table 0:
6797     active=1, lookup=0, matched=0
6798
6799   table 1:
6800     active=0, lookup=0, matched=0
6801 "
6802  for i in `seq 2 253`; do
6803      printf '  table %d: ditto\n' $i
6804  done) > expout
6805 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6806
6807 OVS_VSWITCHD_STOP
6808 AT_CLEANUP
6809
6810 AT_SETUP([ofproto-dpif packet-out controller (patch port)])
6811 OVS_VSWITCHD_START(
6812   [-- \
6813    add-port br0 p1 -- \
6814    set interface p1 type=patch options:peer=p2 -- \
6815    add-br br1 -- \
6816    set bridge br1 datapath-type=dummy -- \
6817    set bridge br1 fail-mode=secure -- \
6818    set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
6819    add-port br1 p2 -- \
6820    set interface p2 type=patch options:peer=p1 --])
6821
6822 AT_CAPTURE_FILE([ofctl_monitor.log])
6823 AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6824
6825 for i in 1 2 3; do
6826         AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
6827 done
6828
6829 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6830 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6831 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
6832 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6833 dnl
6834 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
6835 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6836 dnl
6837 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
6838 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6839 ])
6840
6841 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6842   table 0:
6843     active=0, lookup=0, matched=0
6844 "
6845  for i in `seq 1 253`; do
6846      printf '  table %d: ditto\n' $i
6847  done) > expout
6848 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6849
6850 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6851   table 0:
6852     active=0, lookup=3, matched=0
6853
6854   table 1:
6855     active=0, lookup=0, matched=0
6856 "
6857  for i in `seq 2 253`; do
6858      printf '  table %d: ditto\n' $i
6859  done) > expout
6860 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
6861
6862 OVS_VSWITCHD_STOP
6863 AT_CLEANUP
6864
6865
6866 AT_SETUP([ofproto-dpif packet-out goto_table])
6867 OVS_VSWITCHD_START
6868 ADD_OF_PORTS([br0], 1, 2)
6869
6870 AT_DATA([flows.txt], [dnl
6871 table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
6872 table=1 dl_dst=50:54:00:00:00:0a actions=controller
6873 ])
6874 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
6875
6876 AT_CAPTURE_FILE([ofctl_monitor.log])
6877 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6878
6879 for i in 1 2 3; do
6880     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)'
6881 done
6882
6883 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6884 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6885 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6886 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6887 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6888 dnl
6889 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6890 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6891 dnl
6892 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6893 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6894 ])
6895
6896 AT_CHECK([ovs-appctl revalidator/purge], [0])
6897 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
6898  n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
6899  table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6900 OFPST_FLOW reply (OF1.3):
6901 ])
6902
6903 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6904   table 0:
6905     active=1, lookup=3, matched=3
6906
6907   table 1: ditto
6908   table 2:
6909     active=0, lookup=0, matched=0
6910 "
6911  for i in `seq 3 253`; do
6912      printf '  table %d: ditto\n' $i
6913  done) > expout
6914 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6915
6916 OVS_VSWITCHD_STOP
6917 AT_CLEANUP
6918
6919
6920 AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
6921 OVS_VSWITCHD_START
6922 ADD_OF_PORTS([br0], 1, 2)
6923
6924 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
6925 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
6926
6927 AT_CAPTURE_FILE([ofctl_monitor.log])
6928 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6929
6930 for i in 1 2 3; do
6931     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)'
6932 done
6933
6934 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6935 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6936 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6937 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6938 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6939 dnl
6940 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6941 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6942 dnl
6943 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
6944 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
6945 ])
6946
6947 AT_CHECK([ovs-appctl revalidator/purge], [0])
6948 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
6949  table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6950 OFPST_FLOW reply (OF1.1):
6951 ])
6952
6953 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6954   table 0:
6955     active=0, lookup=3, matched=0
6956
6957   table 1:
6958     active=1, lookup=3, matched=3
6959
6960   table 2:
6961     active=0, lookup=0, matched=0
6962 "
6963  for i in `seq 3 253`; do
6964      printf '  table %d: ditto\n' $i
6965  done) > expout
6966 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6967
6968 OVS_VSWITCHD_STOP
6969 AT_CLEANUP
6970
6971 AT_SETUP([ofproto-dpif - ICMPv6])
6972 OVS_VSWITCHD_START
6973 ADD_OF_PORTS([br0], 1)
6974
6975 AT_CAPTURE_FILE([ofctl_monitor.log])
6976
6977 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6978
6979 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
6980
6981 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6982
6983 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6984 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
6985 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
6986 ])
6987
6988 OVS_VSWITCHD_STOP
6989 AT_CLEANUP
6990
6991 AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update])
6992 OVS_VSWITCHD_START
6993 ADD_OF_PORTS([br0], 1)
6994 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])
6995
6996 AT_CAPTURE_FILE([ofctl_monitor.log])
6997
6998 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6999
7000 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
7001
7002 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
7003
7004 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7005 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered)
7006 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
7007 ])
7008
7009 OVS_VSWITCHD_STOP
7010 AT_CLEANUP
7011
7012 # Tests the exact match of CFI bit in installed datapath flows matching VLAN.
7013 AT_SETUP([ofproto-dpif - vlan matching])
7014 OVS_VSWITCHD_START(
7015   [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1])
7016 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7017
7018 AT_CHECK([ovs-ofctl del-flows br0])
7019 AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"])
7020
7021 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))'])
7022
7023 OVS_WAIT_UNTIL([grep flow_add: ovs-vswitchd.log])
7024 AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[1]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7025 recirc_id=0,ip,in_port=1,dl_vlan=10,nw_frag=no, actions: <del>
7026 ])
7027 OVS_VSWITCHD_STOP
7028 AT_CLEANUP
7029
7030 # Tests in place modification of installed datapath flows.
7031 AT_SETUP([ofproto-dpif - in place modification])
7032 OVS_VSWITCHD_START(
7033   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
7034 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7035
7036 AT_CHECK([ovs-ofctl del-flows br0])
7037 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=mod_vlan_vid:3,output:local])
7038
7039 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
7040
7041 ovs-appctl time/stop
7042
7043 for i in 1 2 3; do
7044     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)'
7045 done
7046
7047 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
7048 recirc_id(0),in_port(1),eth_type(0x1234), packets:2, bytes:120, used:0.0s, actions:push_vlan(vid=3,pcp=0),100
7049 ])
7050
7051 AT_CHECK([ovs-ofctl add-flow br0 priority=60000,in_port=1,actions=mod_vlan_vid:4,output:local])
7052
7053 ovs-appctl time/warp 500
7054 ovs-appctl time/warp 500
7055
7056 for i in 1 2 3; do
7057     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)'
7058 done
7059
7060 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
7061 recirc_id(0),in_port(1),eth_type(0x1234), packets:5, bytes:300, used:0.0s, actions:push_vlan(vid=4,pcp=0),100
7062 ])
7063
7064 AT_CHECK([cat ovs-vswitchd.log | grep 'modify' | STRIP_UFID ], [0], [dnl
7065 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
7066 ])
7067 OVS_VSWITCHD_STOP
7068 AT_CLEANUP
7069
7070 # Tests in place modification of installed datapath flows with vlans.
7071 AT_SETUP([ofproto-dpif - in place modification (vlan)])
7072 OVS_VSWITCHD_START(
7073   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
7074 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7075
7076 AT_CHECK([ovs-ofctl del-flows br0])
7077 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=output:local])
7078
7079 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
7080
7081 ovs-appctl time/stop
7082
7083 # Check that a correct datapath flow is created.
7084 for i in 1 2 3; do
7085     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)'
7086 done
7087
7088 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
7089 recirc_id(0),in_port(1),eth_type(0x1234), packets:2, bytes:120, used:0.0s, actions:100
7090 ])
7091
7092 # Delete the flow.  Then check that the datapath flow is modified to
7093 # drop the packets.  A modified flow inherits the stats, a new
7094 # datapath flow would start from sero.
7095 AT_CHECK([ovs-ofctl del-flows br0])
7096
7097 ovs-appctl time/warp 500
7098 ovs-appctl time/warp 500
7099
7100 for i in 1 2 3; do
7101     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)'
7102 done
7103
7104 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
7105 recirc_id(0),in_port(1),eth_type(0x1234), packets:5, bytes:300, used:0.0s, actions:drop
7106 ])
7107
7108 # Add a flow that matches the non-presence of a vlan tag, and check
7109 # that the datapath flow is modified accordingly.
7110 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,vlan_tci=0x0000/0x1fff,actions=output:local])
7111
7112 ovs-appctl time/warp 500
7113 ovs-appctl time/warp 500
7114
7115 for i in 1 2 3; do
7116     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)'
7117 done
7118
7119 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
7120 recirc_id(0),in_port(1),eth_type(0x1234), packets:8, bytes:480, used:0.0s, actions:100
7121 ])
7122
7123 # Check that VLAN packets will not hit the same datapath megaflow.
7124 for i in 1 2 3; do
7125     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))'
7126 done
7127
7128 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
7129 recirc_id(0),in_port(1),eth_type(0x1234), packets:8, bytes:480, used:0.0s, actions:100
7130 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
7131 ])
7132
7133 # Check that the new flow matches the CFI bit, while both vid and pcp
7134 # are wildcarded.
7135 AT_CHECK([cat ovs-vswitchd.log | grep '\(modify\)\|\(flow_add\)' | STRIP_UFID ], [0], [dnl
7136 dpif_netdev|DBG|flow_add: recirc_id=0,in_port=1,vlan_tci=0x0000,dl_type=0x1234, actions:100
7137 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)
7138 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
7139 dpif_netdev|DBG|flow_add: recirc_id=0,in_port=1,vlan_tci=0xf063/0x1000,dl_type=0x1234, actions:drop
7140 ])
7141 OVS_VSWITCHD_STOP
7142 AT_CLEANUP