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