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