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