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