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