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