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