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