]> git.proxmox.com Git - ovs.git/blame - tests/ofproto-dpif.at
bundles: Clean up bundle commit.
[ovs.git] / tests / ofproto-dpif.at
CommitLineData
29901626
BP
1AT_BANNER([ofproto-dpif])
2
27f57736
JS
3AT_SETUP([ofproto-dpif - revalidator/wait])
4OVS_VSWITCHD_START
5AT_CHECK([ovs-appctl revalidator/wait])
6OVS_VSWITCHD_STOP
7AT_CLEANUP
8
adcf00ba
AZ
9AT_SETUP([ofproto-dpif, active-backup bonding])
10# Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
11# and br1 with interfaces p3, p4 and p8.
12# toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
13OVS_VSWITCHD_START(
14 [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
15 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
16 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
17 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
18 add-br br1 -- \
19 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
20 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
21 fail-mode=secure -- \
22 add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
23 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
24 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
55466d72 25WAIT_FOR_DUMMY_PORTS([p3], [p4])
623540e4 26AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
adcf00ba
AZ
27
28AT_CHECK([ovs-ofctl add-flow br0 action=normal])
29AT_CHECK([ovs-ofctl add-flow br1 action=normal])
30ovs-appctl netdev-dummy/set-admin-state up
31ovs-appctl time/warp 100
32ovs-appctl netdev-dummy/set-admin-state p2 down
33ovs-appctl time/stop
34ovs-appctl time/warp 100
35AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
36AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
37ovs-appctl time/warp 100
38ovs-appctl netdev-dummy/set-admin-state p2 up
39ovs-appctl netdev-dummy/set-admin-state p1 down
40ovs-appctl time/warp 100
41AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
42AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
bdba1947 43ovs-appctl time/warp 200 100
53555f51 44sleep 1
623540e4 45AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[348]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
46recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
47recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
48recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0d,nw_frag=no, actions: <del>
49recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0e,nw_frag=no, actions: <del>
50recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
51recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
adcf00ba
AZ
52])
53OVS_VSWITCHD_STOP
54AT_CLEANUP
55
56AT_SETUP([ofproto-dpif, balance-slb bonding])
57# Create br0 with interfaces bond0(p1, p2, p3) and p7,
58# and br1 with interfaces p4, p5, p6 and p8.
59# p1 <-> p4, p2 <-> p5, p3 <-> p6
60# Send some traffic, make sure the traffic are spread based on source mac.
61OVS_VSWITCHD_START(
62 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
63 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
64 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
65 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
66 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
67 add-br br1 -- \
68 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
69 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
70 fail-mode=secure -- \
71 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
72 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
73 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
74 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
55466d72 75WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
adcf00ba
AZ
76AT_CHECK([ovs-ofctl add-flow br0 action=normal])
77AT_CHECK([ovs-ofctl add-flow br1 action=normal])
78AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
79])
adcf00ba
AZ
80ovs-appctl time/stop
81ovs-appctl time/warp 100
82(
83for i in `seq 0 100 |xargs printf '%02x\n'`;
84 do
85 pkt="in_port(7),eth(src=50:54:00:00:00:$i,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
86 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
87 done
88)
89ovs-appctl time/warp 100
90AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
91# Make sure there is resonable distribution to all three ports.
92# We don't want to make this check precise, in case hash function changes.
93AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
94AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
95AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
96OVS_VSWITCHD_STOP
97AT_CLEANUP
98
99AT_SETUP([ofproto-dpif, balance-tcp bonding])
100# Create br0 with interfaces bond0(p1, p2, p3) and p7,
101# and br1 with interfaces bond1(p4, p5, p6) and p8.
102# bond0 <-> bond1
103# Send some traffic, make sure the traffic are spread based on L4 headers.
104OVS_VSWITCHD_START(
105 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
106 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
107 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
108 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
109 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
110 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
111 add-br br1 -- \
112 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
113 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
114 fail-mode=secure -- \
115 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
116 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
117 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
118 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
119 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
120 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
121AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
122])
123AT_CHECK([ovs-ofctl add-flow br0 action=normal])
124AT_CHECK([ovs-ofctl add-flow br1 action=normal])
125AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
126], [])
48105e85 127OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
adcf00ba
AZ
128ovs-appctl time/stop
129ovs-appctl time/warp 100
130ovs-appctl lacp/show > lacp.txt
131ovs-appctl bond/show > bond.txt
132(
25d6a6a8 133for i in `seq 0 255` ;
adcf00ba 134 do
ea2735d3 135 pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(ack)"
adcf00ba
AZ
136 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
137 done
138)
bdba1947 139ovs-appctl time/warp 300 100
adcf00ba
AZ
140AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
141AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
142# Make sure there is resonable distribution to all three ports.
143# We don't want to make this check precise, in case hash function changes.
fd184489
AZ
144AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
145AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
146AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
adcf00ba
AZ
147OVS_VSWITCHD_STOP()
148AT_CLEANUP
149
29901626 150AT_SETUP([ofproto-dpif - resubmit])
023e1e0a 151OVS_VSWITCHD_START
f7b8e494
JP
152ADD_OF_PORTS([br0], [1], [10], [11], [12], [13], [14], [15],
153 [16], [17], [18], [19], [20], [21])
29901626
BP
154AT_DATA([flows.txt], [dnl
155table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
156table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
157table=0 in_port=3 priority=2000 icmp actions=output(20)
158table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
159table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
160table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
161])
162AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
31a19d69 163AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
29901626
BP
164AT_CHECK([tail -1 stdout], [0],
165 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
166])
023e1e0a 167OVS_VSWITCHD_STOP
29901626 168AT_CLEANUP
58a89177 169
55599423
JR
170AT_SETUP([ofproto-dpif - goto table])
171OVS_VSWITCHD_START
172ADD_OF_PORTS([br0], [1], [10], [11])
173echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
4468099e
EJ
174for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
175echo "table=64 actions=output(11)" >> flows.txt
55599423
JR
176AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
177AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
178AT_CHECK([tail -1 stdout], [0],
179 [Datapath actions: 10,11
180])
181OVS_VSWITCHD_STOP
182AT_CLEANUP
183
7fdb60a7
SH
184AT_SETUP([ofproto-dpif - write actions])
185OVS_VSWITCHD_START
186ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
187AT_DATA([flows.txt], [dnl
188table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
189table=1 ip actions=write_actions(output(13)),goto_table(2)
190table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
191])
192AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
193AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
ce58df5b 194AT_CHECK([tail -2 stdout], [0],
16194afd 195 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
d23df9a8 196Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
7fdb60a7
SH
197])
198OVS_VSWITCHD_STOP
199AT_CLEANUP
200
201AT_SETUP([ofproto-dpif - clear actions])
202OVS_VSWITCHD_START
203ADD_OF_PORTS([br0], [1], [10], [11], [12])
204AT_DATA([flows.txt], [dnl
205table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
ce58df5b 206table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
7fdb60a7
SH
207])
208AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
ce58df5b
JR
209AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=9'], [0], [stdout])
210AT_CHECK([tail -2 stdout], [0],
16194afd 211 [Megaflow: recirc_id=0,tcp,in_port=1,nw_frag=no,tp_src=8
d23df9a8 212Datapath actions: 10,set(tcp(src=91)),11
7fdb60a7
SH
213])
214OVS_VSWITCHD_STOP
215AT_CLEANUP
216
5a070238
BP
217AT_SETUP([ofproto-dpif - group chaining not supported])
218OVS_VSWITCHD_START
219ADD_OF_PORTS([br0], [1], [10], [11])
220AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,group:123,bucket=output:11'],
221 [1], [], [stderr])
222AT_CHECK([STRIP_XIDS stderr | sed 1q], [0],
223 [OFPT_ERROR (OF1.2): OFPGMFC_CHAINING_UNSUPPORTED
224])
225OVS_VSWITCHD_STOP
226AT_CLEANUP
227
f4fb341b
SH
228AT_SETUP([ofproto-dpif - all group in action list])
229OVS_VSWITCHD_START
230ADD_OF_PORTS([br0], [1], [10], [11])
231AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
232AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
233AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
d23df9a8
JR
234# Must match on the source address to be able to restore it's value for
235# the second bucket
ce58df5b 236AT_CHECK([tail -2 stdout], [0],
16194afd 237 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
d23df9a8 238Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
f4fb341b
SH
239])
240OVS_VSWITCHD_STOP
241AT_CLEANUP
242
243AT_SETUP([ofproto-dpif - indirect group in action list])
244OVS_VSWITCHD_START
245ADD_OF_PORTS([br0], [1], [10])
246AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
247AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
248AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
249AT_CHECK([tail -1 stdout], [0],
250 [Datapath actions: 10
251])
252OVS_VSWITCHD_STOP
253AT_CLEANUP
254
255AT_SETUP([ofproto-dpif - all group in action set])
256OVS_VSWITCHD_START
257ADD_OF_PORTS([br0], [1], [10], [11])
258AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
259AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
260AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
d23df9a8
JR
261# Must match on the source address to be able to restore it's value for
262# the third bucket
ce58df5b 263AT_CHECK([tail -2 stdout], [0],
16194afd 264 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
d23df9a8 265Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
f4fb341b
SH
266])
267OVS_VSWITCHD_STOP
268AT_CLEANUP
269
270AT_SETUP([ofproto-dpif - indirect group in action set])
271OVS_VSWITCHD_START
272ADD_OF_PORTS([br0], [1], [10])
273AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
274AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
275AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
276AT_CHECK([tail -1 stdout], [0],
277 [Datapath actions: 10
278])
279OVS_VSWITCHD_STOP
280AT_CLEANUP
281
fe7e5749
SH
282AT_SETUP([ofproto-dpif - select group])
283OVS_VSWITCHD_START
284ADD_OF_PORTS([br0], [1], [10], [11])
285AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
286AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
7cb279c2
SH
287
288# Try a bunch of different flows and make sure that they get distributed
289# at least somewhat.
290for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
291 AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"], [0], [stdout])
292 tail -1 stdout >> results
293done
294sort results | uniq -c
295AT_CHECK([sort results | uniq], [0],
fe7e5749 296 [Datapath actions: 10
7cb279c2 297Datapath actions: 11
fe7e5749
SH
298])
299OVS_VSWITCHD_STOP
300AT_CLEANUP
301
302AT_SETUP([ofproto-dpif - select group with watch port])
303OVS_VSWITCHD_START
304ADD_OF_PORTS([br0], [1], [10], [11])
305AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
306AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
307AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
308AT_CHECK([tail -1 stdout], [0],
309 [Datapath actions: 11
310])
311OVS_VSWITCHD_STOP
312AT_CLEANUP
313
7cb279c2
SH
314AT_SETUP([ofproto-dpif - select group with weight])
315OVS_VSWITCHD_START
316ADD_OF_PORTS([br0], [1], [10], [11], [12])
125bf01d 317AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11,weight=2000,bucket=output:12,weight=0'])
7cb279c2
SH
318AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
319AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
320AT_CHECK([tail -1 stdout], [0],
321 [Datapath actions: 11
322])
323OVS_VSWITCHD_STOP
324AT_CLEANUP
325
dd8cd4b4
SH
326AT_SETUP([ofproto-dpif - fast failover group])
327OVS_VSWITCHD_START
328ADD_OF_PORTS([br0], [1], [10], [11])
329AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=ff,bucket=watch_port:10,output:10,bucket=watch_port:11,output:11'])
330AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
331AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
332AT_CHECK([tail -1 stdout], [0],
333 [Datapath actions: drop
334])
335OVS_VSWITCHD_STOP
336AT_CLEANUP
337
b2af3288
AZ
338AT_SETUP([ofproto-dpif - group stats single bucket])
339OVS_VSWITCHD_START
340ADD_OF_PORTS([br0], [1], [10], [11])
341AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
342AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
343(
344for i in `seq 0 2`;
345 do
346 pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
347 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
348 done
349)
cea4a6d7 350AT_CHECK([ovs-appctl revalidator/purge], [0])
b2af3288
AZ
351AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
352AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
353 group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=0,byte_count=0
354OFPST_GROUP reply (OF1.2):
355])
356OVS_VSWITCHD_STOP
357AT_CLEANUP
358
359AT_SETUP([ofproto-dpif - group stats all buckets])
360OVS_VSWITCHD_START
361ADD_OF_PORTS([br0], [1], [10], [11])
362AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
363AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
364(
365for i in `seq 0 2`;
366 do
367 pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
368 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
369 done
370)
cea4a6d7 371AT_CHECK([ovs-appctl revalidator/purge], [0])
b2af3288
AZ
372AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
373AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
374 group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=3,byte_count=180
375OFPST_GROUP reply (OF1.2):
376])
377OVS_VSWITCHD_STOP
378AT_CLEANUP
379
58a89177 380AT_SETUP([ofproto-dpif - registers])
023e1e0a 381OVS_VSWITCHD_START
f7b8e494 382ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
58a89177
EJ
383AT_DATA([flows.txt], [dnl
384in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
385in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
e9358af6
EJ
386in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
387in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
388
58a89177
EJ
389in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
390in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
391in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
392in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
393in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
394in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
395in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
396in_port=9,reg0=0xdeadbeef actions=output:20
397in_port=10,reg1=0xdeadbeef actions=output:21
398in_port=11,reg2=0xeef22dea actions=output:22
e9358af6
EJ
399
400dnl Sanilty check all registers
401in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
402in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
403in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
404in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
bd85dac1 405
58a89177
EJ
406])
407AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 408AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
58a89177 409AT_CHECK([tail -1 stdout], [0],
e9358af6 410 [Datapath actions: 20,21,22,33
58a89177 411])
023e1e0a 412OVS_VSWITCHD_STOP
58a89177 413AT_CLEANUP
f694937d 414
57fa8167
BP
415dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
416dnl in the manner documented in ovs-ofctl(8).
417AT_SETUP([ofproto-dpif - extended registers])
418OVS_VSWITCHD_START
419ADD_OF_PORTS([br0], [1], [2], [3])
420AT_DATA([flows.txt], [dnl
421table=0 actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
422table=1,reg2=0xfedcba98,reg3=0x76543210 actions=2
423
424# These low-priority rules shouldn't match. They're here only to make really
425# sure that the test fails if either of the above rules fails to match.
426table=0,priority=0 actions=3
427table=1,priority=0 actions=3
428])
429AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
430AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
431AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
432])
433OVS_VSWITCHD_STOP
434AT_CLEANUP
435
1b0ee636
TG
436AT_SETUP([ofproto-dpif - load and move order])
437OVS_VSWITCHD_START
438ADD_OF_PORTS([br0], [1], [10], [11])
439AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,move:NXM_NX_REG1[[]]->NXM_OF_IP_SRC[[]],bucket=output:11'])
440AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(load:0xffffffff->NXM_NX_REG1[[]],move:NXM_NX_REG1[[]]->NXM_NX_REG2[[]],group:1234)'])
441AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
442AT_CHECK([tail -2 stdout], [0],
16194afd 443 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
d23df9a8 444Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
1b0ee636
TG
445])
446OVS_VSWITCHD_STOP
447AT_CLEANUP
448
eb1cbc6b
JT
449dnl Tests that 1.5 copy-field can copy into the standardized xregs.
450AT_SETUP([ofproto-dpif - copy-field into extended registers])
451OVS_VSWITCHD_START
452ADD_OF_PORTS([br0], [1], [2], [3])
453AT_DATA([flows.txt], [dnl
454table=0 actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
455table=1,xreg0=0x0000505400000005 actions=2
456
457# These low-priority rules shouldn't match. They're here only to make really
458# sure that the test fails if either of the above rules fails to match.
459table=0,priority=0 actions=3
460table=1,priority=0 actions=3
461])
462AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
463AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
464AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
465])
466OVS_VSWITCHD_STOP
467AT_CLEANUP
468
2bef8e07
JT
469dnl Tests that 1.5 set-field with mask in the metadata register.
470AT_SETUP([ofproto-dpif - masked set-field into metadata])
471OVS_VSWITCHD_START
472ADD_OF_PORTS([br0], [1], [2], [3])
473AT_DATA([flows.txt], [dnl
474table=0 actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1)
475table=1 actions=set_field:0x6b/0xff->metadata,goto_table(2)
476table=2,metadata=0xfafafafa5a5a5a6b actions=2
477
478# These low-priority rules shouldn't match. They're here only to make really
479# sure that the test fails if either of the above rules fails to match.
480table=0,priority=0 actions=3
481table=1,priority=0 actions=3
482table=2,priority=0 actions=3
483])
484AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
485AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
486AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
487])
488OVS_VSWITCHD_STOP
489AT_CLEANUP
490
c61f3870
BP
491
492AT_SETUP([ofproto-dpif - actset_output])
493OVS_VSWITCHD_START
494ADD_OF_PORTS(
495 [br0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13])
496AT_DATA([flows.txt], [dnl
3ca3ce0c 497table=0,actset_output=unset actions=write_actions(output(2)),goto_table(1)
c61f3870
BP
498table=1 actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
499
500# Verify that actset_output got set.
501table=2,priority=20,actset_output=2 actions=4,goto_table(3)
502table=2,priority=10 actions=5,goto_table(3)
503
504# Verify that xreg0 got copied properly from actset_output.
505table=3,priority=20,xreg0=2 actions=6,goto_table(4)
506table=3,priority=10 actions=7,goto_table(4)
507
508# Verify that adding a group action unsets actset_output.
509table=4 actions=write_actions(group(5)),goto_table(5)
510table=5,priority=20,actset_output=unset actions=8,goto_table(6)
511table=5,priority=10 actions=9,goto_table(6)
512
513# Verify that adding another output action doesn't change actset_output
514# (since there's still a group).
515table=6 actions=write_actions(output(3)),goto_table(7)
516table=7,priority=20,actset_output=unset actions=10,goto_table(8)
517table=7,priority=10 actions=11,goto_table(8)
518
519# Verify that clearing the action set, then writing an output action,
520# causes actset_output to be set again.
521table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
522table=9,priority=20,actset_output=2 actions=12
523table=9,priority=10 actions=13
524])
525AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
526AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
527AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
528])
529OVS_VSWITCHD_STOP
530AT_CLEANUP
bd85dac1
AZ
531AT_SETUP([ofproto-dpif - push-pop])
532OVS_VSWITCHD_START
533ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
534AT_DATA([flows.txt], [dnl
535in_port=90 actions=load:20->NXM_NX_REG0[[0..7]],load:21->NXM_NX_REG1[[0..7]],load:22->NXM_NX_REG2[[0..7]], load:33->NXM_NX_REG3[[0..7]], push:NXM_NX_REG0[[]], push:NXM_NX_REG1[[0..7]],push:NXM_NX_REG2[[0..15]], push:NXM_NX_REG3[[]], resubmit:2, resubmit:3, resubmit:4, resubmit:5
536in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
537in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
538in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
539in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
540
541])
542AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 543AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
bd85dac1
AZ
544AT_CHECK([tail -1 stdout], [0],
545 [Datapath actions: 33,22,21,20
546])
547OVS_VSWITCHD_STOP
548AT_CLEANUP
549
f694937d 550AT_SETUP([ofproto-dpif - output])
023e1e0a 551OVS_VSWITCHD_START
f7b8e494 552ADD_OF_PORTS([br0], [1], [9], [10], [11], [55], [66], [77], [88])
f694937d 553AT_DATA([flows.txt], [dnl
557323cd 554in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
f694937d
EJ
555in_port=2 actions=output:9
556in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
557in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
558in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
559in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
560in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
557323cd 561in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
f694937d
EJ
562])
563AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 564AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
f694937d 565AT_CHECK([tail -1 stdout], [0],
557323cd 566 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
f694937d 567])
023e1e0a 568OVS_VSWITCHD_STOP
f694937d 569AT_CLEANUP
8e9ce036 570
f0fd1a17
PS
571AT_SETUP([ofproto-dpif - dec_ttl])
572OVS_VSWITCHD_START
f7b8e494 573ADD_OF_PORTS([br0], [1], [2], [3], [4])
f0fd1a17
PS
574AT_DATA([flows.txt], [dnl
575table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
576table=1 in_port=1 action=dec_ttl,output:3
577])
578AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8249a1fe 579AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
ce58df5b 580AT_CHECK([tail -4 stdout], [0],
16194afd 581 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=2,nw_frag=no
d23df9a8 582Datapath actions: set(ipv4(ttl=1)),2,4
6a7e895f
BP
583This flow is handled by the userspace slow path because it:
584 - Sends "packet-in" messages to the OpenFlow controller.
f0fd1a17 585])
8249a1fe 586AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'], [0], [stdout])
ce58df5b 587AT_CHECK([tail -2 stdout], [0],
16194afd 588 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=3,nw_frag=no
d23df9a8 589Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
f0fd1a17 590])
50aa28fd 591AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'], [0], [stdout])
ce58df5b 592AT_CHECK([tail -2 stdout], [0],
16194afd 593 [Megaflow: recirc_id=0,ipv6,in_port=1,nw_ttl=128,nw_frag=no
d23df9a8 594Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
f0fd1a17
PS
595])
596
982697a4 597AT_CAPTURE_FILE([ofctl_monitor.log])
77a922c7 598AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8249a1fe 599AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
f0fd1a17
PS
600OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
601AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8249a1fe 602NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
78c9486d 603ip,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1
f0fd1a17
PS
604])
605OVS_VSWITCHD_STOP
606AT_CLEANUP
607
65bfce4a
SH
608dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
609dnl buffer to be resized just before pushing the id of the dec_ttl action.
610dnl Thus the implementation must account for this by using the
611dnl reallocated buffer rather than the original buffer.
612dnl
613dnl A number of similar rules are added to try and exercise
614dnl xrealloc sufficiently that it returns a different base pointer
615AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
616OVS_VSWITCHD_START
617ADD_OF_PORTS([br0], [1])
618(for i in `seq 0 255`; do
619 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
620 done) > flows.txt
621AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
622OVS_VSWITCHD_STOP
623AT_CLEANUP
624
625dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
626dnl buffer to be resized just before pushing the id of the dec_ttl action.
627dnl Thus the implementation must account for this by using the
628dnl reallocated buffer rather than the original buffer.
629dnl
630dnl A number of similar rules are added to try and exercise
631dnl xrealloc sufficiently that it returns a different base pointer
632AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
633OVS_VSWITCHD_START
634ADD_OF_PORTS([br0], [1])
635(for i in `seq 0 255`; do
636 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
637 done) > flows.txt
638AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
639OVS_VSWITCHD_STOP
640AT_CLEANUP
641
642dnl A note action at offset 24 in ofpacts will cause the ofpacts
643dnl buffer to be resized just before pushing the id of the dec_ttl action.
644dnl Thus the implementation must account for this by using the
645dnl reallocated buffer rather than the original buffer.
646dnl
647dnl A number of similar rules are added to try and exercise
648dnl xrealloc sufficiently that it returns a different base pointer
649AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
650OVS_VSWITCHD_START
651ADD_OF_PORTS([br0], [1])
652(for i in `seq 0 255`; do
653 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
654 done) > flows.txt
655AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
656OVS_VSWITCHD_STOP
657AT_CLEANUP
f0fd1a17 658
77750738 659AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
e44768b7
JP
660OVS_VSWITCHD_START
661ADD_OF_PORTS([br0], [1], [2])
77750738 662
77750738
JP
663AT_CHECK([ovs-ofctl add-flow br0 action=normal])
664
665# "in_port" defaults to OFPP_NONE if it's not specified.
72d64e33 666flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,icmp_type=8,icmp_code=0"
77750738 667AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
72d64e33
EJ
668AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
6691
6702
671100
672])
77750738
JP
673
674OVS_VSWITCHD_STOP
675AT_CLEANUP
676
8b36f51e 677AT_SETUP([ofproto-dpif - DSCP])
8b36f51e 678OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
72d64e33 679ADD_OF_PORTS([br0], [9])
8b36f51e 680AT_DATA([flows.txt], [dnl
bdda5aca 681actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL
8b36f51e
EJ
682])
683AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
684AT_CHECK([ovs-vsctl -- \
685 set Port p1 qos=@newqos --\
686 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
687 --id=@q1 create Queue dscp=1 --\
688 --id=@q2 create Queue dscp=2], [0], [ignore])
50aa28fd 689AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
ce58df5b 690AT_CHECK([tail -2 stdout], [0],
d23df9a8 691 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no
ce58df5b 692Datapath actions: dnl
e44768b7 693100,dnl
d23df9a8
JR
694set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
695set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
8b36f51e 6961,dnl
d23df9a8
JR
697set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
698set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
699set(ipv4(tos=0/0xfc)),1,100
8b36f51e
EJ
700])
701OVS_VSWITCHD_STOP
702AT_CLEANUP
703
fd19297b 704AT_SETUP([ofproto-dpif - output/flood flags])
f7b8e494
JP
705OVS_VSWITCHD_START
706ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
fd19297b
EJ
707
708AT_DATA([flows.txt], [dnl
a0fbe94a 709in_port=local actions=local,flood
fd19297b
EJ
710in_port=1 actions=flood
711in_port=2 actions=all
bdda5aca
BP
712in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
713in_port=4 actions=enqueue:LOCAL:1,enqueue:1:1,enqueue:2:1,enqueue:3:2,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1
fd19297b
EJ
714])
715AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
716AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
717AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
718
50aa28fd 719AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
a0fbe94a
AR
720AT_CHECK([tail -1 stdout \
721| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
7221
7232
7243
7254
7267
727])
728
50aa28fd 729AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b
EJ
730AT_CHECK([tail -1 stdout \
731| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
e44768b7 732100
fd19297b
EJ
7332
7343
7354
7367
737])
738
50aa28fd 739AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b
EJ
740AT_CHECK([tail -1 stdout \
741| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
fd19297b 7421
e44768b7 743100
fd19297b
EJ
7443
7454
7466
7477
748])
749
50aa28fd 750AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b 751AT_CHECK([tail -1 stdout], [0],
e44768b7 752 [Datapath actions: 100,1,2,4,6,7
fd19297b
EJ
753])
754
50aa28fd 755AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b 756AT_CHECK([tail -1 stdout], [0],
1b567fb9 757 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
fd19297b
EJ
758])
759OVS_VSWITCHD_STOP
760AT_CLEANUP
761
6b83a3c5 762AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
6d328fa2
SH
763OVS_VSWITCHD_START([dnl
764 add-port br0 p1 -- set Interface p1 type=dummy
765])
766ON_EXIT([kill `cat ovs-ofctl.pid`])
767
768AT_CAPTURE_FILE([ofctl_monitor.log])
769
770AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
771
772for i in 1 2 3 ; do
ea2735d3 773 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(syn)'
6d328fa2 774done
8bd16974 775OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
776OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
777AT_CHECK([cat ofctl_monitor.log], [0], [dnl
778NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 779tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
6d328fa2
SH
780dnl
781NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 782tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
6d328fa2
SH
783dnl
784NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 785tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
6d328fa2
SH
786])
787
788AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
789AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
790NXST_FLOW reply:
791])
792
793OVS_VSWITCHD_STOP
794AT_CLEANUP
795
6b83a3c5
SH
796AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
797OVS_VSWITCHD_START([dnl
798 add-port br0 p1 -- set Interface p1 type=dummy
799])
800ON_EXIT([kill `cat ovs-ofctl.pid`])
801
802AT_CAPTURE_FILE([ofctl_monitor.log])
803AT_CHECK([ovs-ofctl del-flows br0])
804
805AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
806
807dnl Test that missed packets are droped
808for i in 1 2 3 ; do
ea2735d3 809 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack,syn)'
6b83a3c5
SH
810done
811OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
812
813AT_CHECK([cat ofctl_monitor.log], [0], [dnl
814])
815
816AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
817AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
818OFPST_FLOW reply (OF1.3):
819])
820
821OVS_VSWITCHD_STOP
822AT_CLEANUP
823
6d328fa2
SH
824AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
825OVS_VSWITCHD_START([dnl
826 add-port br0 p1 -- set Interface p1 type=dummy
827])
828ON_EXIT([kill `cat ovs-ofctl.pid`])
829
830AT_CAPTURE_FILE([ofctl_monitor.log])
831AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
832
833AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
834
835for i in 1 2 3 ; do
ea2735d3 836 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(urg,rst)'
6d328fa2 837done
8bd16974 838OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
839OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
840AT_CHECK([cat ofctl_monitor.log], [0], [dnl
841OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 842tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
6d328fa2
SH
843dnl
844OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 845tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
6d328fa2
SH
846dnl
847OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 848tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
6d328fa2
SH
849])
850
cea4a6d7 851AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
852AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
853 n_packets=3, n_bytes=180, actions=goto_table:1
854OFPST_FLOW reply (OF1.2):
855])
856
857OVS_VSWITCHD_STOP
858AT_CLEANUP
859
860AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
861OVS_VSWITCHD_START([dnl
862 add-port br0 p1 -- set Interface p1 type=dummy
863])
864ON_EXIT([kill `cat ovs-ofctl.pid`])
865
866AT_CAPTURE_FILE([ofctl_monitor.log])
867AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
868
869AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
870
871for i in 1 2 3 ; do
872 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
873done
874
875OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
876AT_CHECK([cat ofctl_monitor.log], [0], [dnl
877])
878
cea4a6d7 879AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
880AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
881 n_packets=3, n_bytes=180, actions=resubmit(1,1)
882OFPST_FLOW reply (OF1.2):
883])
884
885OVS_VSWITCHD_STOP
886AT_CLEANUP
887
888AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
889OVS_VSWITCHD_START([dnl
890 add-port br0 p1 -- set Interface p1 type=dummy
891])
892ON_EXIT([kill `cat ovs-ofctl.pid`])
893
894AT_CAPTURE_FILE([ofctl_monitor.log])
895AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
896AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
897
898dnl Miss table 0, Hit table 1
899AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
900
901for i in 1 2 3 ; do
902 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
903done
8bd16974 904OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
905OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
906
907AT_CHECK([cat ofctl_monitor.log], [0], [dnl
908NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 909tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
910dnl
911NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 912tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
913dnl
914NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 915tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
916])
917
918dnl Hit table 0, Miss all other tables, sent to controller
919AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
920
921for i in 1 2 3 ; do
922 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
923done
8bd16974 924OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
925OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
926
927AT_CHECK([cat ofctl_monitor.log], [0], [dnl
928NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 929tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
930dnl
931NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 932tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
933dnl
934NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 935tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
936])
937
cea4a6d7 938AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
939AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
940 table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
941OFPST_FLOW reply (OF1.2):
942])
943
944OVS_VSWITCHD_STOP
945AT_CLEANUP
946
947AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
948OVS_VSWITCHD_START([dnl
949 add-port br0 p1 -- set Interface p1 type=dummy
950])
951ON_EXIT([kill `cat ovs-ofctl.pid`])
952
953AT_CAPTURE_FILE([ofctl_monitor.log])
954AT_DATA([flows.txt], [dnl
955table=0 actions=goto_table(1)
956table=2 dl_src=10:11:11:11:11:11 actions=controller
957])
958AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
959AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
960
961dnl Hit table 0, Miss table 1, Hit table 2
962AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
963
964for i in 1 2 3 ; do
965 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
966done
8bd16974 967OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 968OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
6d328fa2
SH
969
970AT_CHECK([cat ofctl_monitor.log], [0], [dnl
971NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 972tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
973dnl
974NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 975tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
976dnl
977NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 978tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
979])
980
981dnl Hit table 1, Miss all other tables, sent to controller
982AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
983
984for i in 1 2 3 ; do
985 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
986done
8bd16974 987OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
988OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
989
990AT_CHECK([cat ofctl_monitor.log], [0], [dnl
991NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 992tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
993dnl
994NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 995tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
996dnl
997NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 998tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
999])
1000
cea4a6d7 1001AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1002AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1003 n_packets=6, n_bytes=360, actions=goto_table:1
1004 table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1005OFPST_FLOW reply (OF1.2):
1006])
1007
1008OVS_VSWITCHD_STOP
1009AT_CLEANUP
1010
1011AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1012OVS_VSWITCHD_START([dnl
1013 add-port br0 p1 -- set Interface p1 type=dummy
1014])
1015ON_EXIT([kill `cat ovs-ofctl.pid`])
1016
1017AT_CAPTURE_FILE([ofctl_monitor.log])
1018AT_DATA([flows.txt], [dnl
1019table=0 actions=resubmit(1,1)
1020table=2 dl_src=10:11:11:11:11:11 actions=controller
1021])
1022AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1023AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1024
1025dnl Hit table 0, Miss table 1, Dropped
1026AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1027
1028for i in 1 2 3 ; do
1029 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1030done
0c473314 1031OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
6d328fa2
SH
1032
1033AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1034])
1035
1036dnl Hit table 1, Dropped
1037AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1038
1039for i in 1 2 3 ; do
1040 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1041done
1042OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1043
1044AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1045])
1046
cea4a6d7 1047AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1048AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1049 n_packets=6, n_bytes=360, actions=resubmit(1,1)
1050 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1051OFPST_FLOW reply (OF1.2):
1052])
1053
1054OVS_VSWITCHD_STOP
1055AT_CLEANUP
1056
1057AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1058OVS_VSWITCHD_START([dnl
1059 add-port br0 p1 -- set Interface p1 type=dummy
1060])
1061ON_EXIT([kill `cat ovs-ofctl.pid`])
1062
1063AT_CAPTURE_FILE([ofctl_monitor.log])
1064AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1065
1066AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1067
1068dnl Test that missed packets are droped
1069for i in 1 2 3 ; do
1070 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1071done
1072OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1073
1074AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1075])
1076
1077AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1078AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1079NXST_FLOW reply:
1080])
1081
1082OVS_VSWITCHD_STOP
1083AT_CLEANUP
1084
1085AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1086OVS_VSWITCHD_START([dnl
1087 add-port br0 p1 -- set Interface p1 type=dummy
1088])
1089ON_EXIT([kill `cat ovs-ofctl.pid`])
1090
1091AT_CAPTURE_FILE([ofctl_monitor.log])
1092AT_CHECK([ovs-ofctl del-flows br0])
1093AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1094AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1095
1096AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1097
1098dnl Test that missed packets are droped
1099for i in 1 2 3 ; do
1100 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1101done
1102OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1103
1104AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1105])
1106
cea4a6d7 1107AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1108AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1109 n_packets=3, n_bytes=180, actions=goto_table:1
1110OFPST_FLOW reply (OF1.2):
1111])
1112
1113OVS_VSWITCHD_STOP
1114AT_CLEANUP
1115
1116AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1117OVS_VSWITCHD_START([dnl
1118 add-port br0 p1 -- set Interface p1 type=dummy
1119])
1120ON_EXIT([kill `cat ovs-ofctl.pid`])
1121
1122AT_CAPTURE_FILE([ofctl_monitor.log])
1123AT_CHECK([ovs-ofctl del-flows br0])
1124AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1125AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1126
1127AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1128
1129dnl Test that missed packets are droped
1130for i in 1 2 3 ; do
1131 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1132done
1133OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1134
1135AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1136])
1137
cea4a6d7 1138AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1139AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1140 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1141OFPST_FLOW reply (OF1.2):
1142])
1143
1144OVS_VSWITCHD_STOP
1145AT_CLEANUP
1146
15056dc8
EJ
1147AT_SETUP([ofproto-dpif - controller])
1148OVS_VSWITCHD_START([dnl
1149 add-port br0 p1 -- set Interface p1 type=dummy
1150])
57c94f35 1151ON_EXIT([kill `cat ovs-ofctl.pid`])
15056dc8
EJ
1152
1153AT_CAPTURE_FILE([ofctl_monitor.log])
1154AT_DATA([flows.txt], [dnl
1155cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
54834960 1156cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
15056dc8
EJ
1157cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1158
54834960
EJ
1159cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1160cookie=0x4 table=2 in_port=81 actions=load:2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,controller,resubmit(82,3)
1161cookie=0x5 table=3 in_port=82 actions=load:3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,controller,resubmit(83,4)
1162cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1163cookie=0x7 table=5 in_port=84 actions=load:5->NXM_NX_REG4[[]],load:6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,controller,resubmit(85,6)
1164cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1165cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
78cef7fd 1166cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
56d72f37 1167cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[[]],controller,load:0xc0a88001->OXM_OF_ARP_SPA[[]],controller,load:0x404444444441->OXM_OF_ARP_THA[[]],load:0x01010101->OXM_OF_ARP_SPA[[]],load:0x02020202->OXM_OF_ARP_TPA[[]],controller
15056dc8
EJ
1168])
1169AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1170
1171dnl Flow miss.
77a922c7 1172AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1173
1174for i in 1 2 3 ; do
dc235f7f 1175 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
15056dc8 1176done
57c94f35 1177OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1178OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1179
15056dc8 1180AT_CHECK([cat ofctl_monitor.log], [0], [dnl
f0fd1a17 1181OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1182tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
15056dc8 1183dnl
f0fd1a17 1184OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1185tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
15056dc8 1186dnl
f0fd1a17 1187OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1188tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
15056dc8
EJ
1189])
1190
1191dnl Singleton controller action.
77a922c7 1192AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1193
1194for i in 1 2 3 ; do
dc235f7f 1195 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
15056dc8 1196done
57c94f35 1197OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1198OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1199
15056dc8
EJ
1200AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1201OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1202tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
15056dc8
EJ
1203dnl
1204OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1205tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
15056dc8
EJ
1206dnl
1207OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1208tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
15056dc8
EJ
1209])
1210
1211dnl Modified controller action.
77a922c7 1212AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1213
1214for i in 1 2 3 ; do
dc235f7f 1215 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=30:33:33:33:33:33,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x001)'
15056dc8 1216done
57c94f35 1217OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1218OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1219
15056dc8
EJ
1220AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1221OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1222tcp,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
15056dc8
EJ
1223dnl
1224OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1225tcp,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
15056dc8
EJ
1226dnl
1227OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1228tcp,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
15056dc8
EJ
1229])
1230
363dd1d9
JS
1231dnl Modified VLAN controller action.
1232AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1233
1234for i in 1 2 3; do
8249a1fe 1235 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:41,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
363dd1d9 1236done
57c94f35 1237OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1238OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
363dd1d9 1239
363dd1d9
JS
1240AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1241NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1242ip,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
363dd1d9
JS
1243dnl
1244NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1245ip,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
363dd1d9
JS
1246dnl
1247NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1248ip,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
363dd1d9
JS
1249])
1250
349fbdc2
SH
1251dnl Checksum TCP.
1252AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1253
1254for i in 1 ; do
1255 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)'
1256done
1257OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1258ovs-appctl -t ovs-ofctl exit
1259
1260AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1261NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1262tcp,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1263dnl
1264NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
78c9486d 1265tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1266dnl
1267NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
78c9486d 1268tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1269dnl
1270NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
78c9486d 1271tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1272dnl
1273NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
78c9486d 1274tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:1a03
349fbdc2
SH
1275dnl
1276NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1277tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:3205
349fbdc2
SH
1278dnl
1279NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1280tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=fin tcp_csum:31b8
349fbdc2
SH
1281dnl
1282NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1283tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
349fbdc2
SH
1284dnl
1285NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1286tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
349fbdc2
SH
1287])
1288
1289dnl Checksum UDP.
1290AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1291
1292for i in 1 ; do
1293 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
1294done
1295OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1296ovs-appctl -t ovs-ofctl exit
1297
1298AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1299NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1300udp,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1301dnl
1302NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
78c9486d 1303udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1304dnl
1305NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
78c9486d 1306udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1307dnl
1308NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
78c9486d 1309udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1310dnl
1311NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
78c9486d 1312udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37
349fbdc2
SH
1313dnl
1314NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1315udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439
349fbdc2
SH
1316dnl
1317NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1318udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec
349fbdc2
SH
1319dnl
1320NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1321udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
349fbdc2
SH
1322dnl
1323NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1324udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
349fbdc2
SH
1325])
1326
1327dnl Modified ARP controller action.
1328AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1329
1330for i in 1 2 3; do
1331 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
1332done
1333
368a198a 1334OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
349fbdc2
SH
1335OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1336AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1337NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1338arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1339NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1340arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1341NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1342arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
349fbdc2 1343NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1344arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1345NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1346arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1347NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1348arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
349fbdc2 1349NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1350arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1351NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1352arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1353NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1354arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
349fbdc2
SH
1355])
1356
1357AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1358
1359dnl Checksum SCTP.
1360AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1361
1362for i in 1 ; do
1363 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04'
1364done
1365
f7a22c7e 1366AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
349fbdc2
SH
1367OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1368OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1369AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1370NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
78c9486d 1371sctp,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1372dnl
1373NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered)
78c9486d 1374sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1375dnl
1376NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=102 (unbuffered)
78c9486d 1377sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1378dnl
1379NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=102 (unbuffered)
78c9486d 1380sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1381dnl
1382NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=102 (unbuffered)
78c9486d 1383sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1384dnl
1385NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
78c9486d 1386sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1387dnl
1388NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
78c9486d 1389sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:7f12662e
349fbdc2
SH
1390dnl
1391NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
78c9486d 1392sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67
349fbdc2
SH
1393dnl
1394NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
78c9486d 1395sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67
349fbdc2
SH
1396])
1397
1398AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1399 cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1400 cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1401 cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1402 cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1403 cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1404 cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1405 cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6)
1406 cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1407 cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1408 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1409 cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535
1410 n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1411NXST_FLOW reply:
1412])
1413
1414OVS_VSWITCHD_STOP
1415AT_CLEANUP
1416
1417AT_SETUP([ofproto-dpif - MPLS handling])
1418OVS_VSWITCHD_START([dnl
1419 add-port br0 p1 -- set Interface p1 type=dummy
1420])
1421ON_EXIT([kill `cat ovs-ofctl.pid`])
1422
1423AT_CAPTURE_FILE([ofctl_monitor.log])
1424AT_DATA([flows.txt], [dnl
1425cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1426cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller
1427cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1428cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1429cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller
1430cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller
1431cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller
1432cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller
1ffd16af 1433cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
349fbdc2
SH
1434cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1435cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1436cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller
1ffd16af
SH
1437
1438cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1439cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1440cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1441cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller
1442cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,OXM_OF_IPV4_SRC[[0..7]]),controller
1443cookie=0xd dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,OXM_OF_IPV4_SRC[[0..15]],slaves:1,2),controller
1444cookie=0xd dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,OXM_OF_IPV4_SRC[[]]=OXM_OF_IPV4_DST[[]]),controller
1445
1446cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1447cookie=0xd table=1 arp actions=controller
1448
1449cookie=0xd dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48,controller
1450cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1451cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1452
1453cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1454cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1455cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1456
1457cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1458cookie=0xd dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1459cookie=0xd dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1460
1461cookie=0xd dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1462cookie=0xd dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1463cookie=0xd dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1464
1465cookie=0xd dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1466cookie=0xd dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1467cookie=0xd dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1468
1469cookie=0xd dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1470cookie=0xd dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1471cookie=0xd dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
349fbdc2
SH
1472])
1473AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1474
b02475c5
SH
1475dnl Modified MPLS controller action.
1476AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1477
1478for i in 1 2 3; do
791a09be 1479 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=17,tos=0,ttl=64,frag=no),udp(src=7777,dst=80)'
b02475c5 1480done
57c94f35 1481OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1482OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1483
b02475c5
SH
1484AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1485NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1486mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1487dnl
1488NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1489mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1490dnl
1491NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1492mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1493])
1494
1495dnl Modified MPLS controller action.
1496AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1497
b0a17866 1498for i in 1 2 3; do
8249a1fe 1499 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
b0a17866
SH
1500done
1501OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1502OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b0a17866
SH
1503
1504AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1505NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1506ip,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
b0a17866
SH
1507dnl
1508NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1509ip,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
b0a17866
SH
1510dnl
1511NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1512ip,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
b0a17866
SH
1513])
1514
1515dnl Modified MPLS controller action.
1516AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1517
b02475c5
SH
1518dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1)
1519
1520for i in 1 2 3; do
1521 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:43,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'
1522done
bece9ea7 1523OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1524OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
bece9ea7 1525
b02475c5
SH
1526AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1527NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1528mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
b02475c5
SH
1529dnl
1530NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1531mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
b02475c5
SH
1532dnl
1533NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1534mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
b02475c5
SH
1535])
1536
1537dnl Modified MPLS controller action.
1538AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1539
1540for i in 1 2 3; do
8249a1fe 1541 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))'
b02475c5 1542done
57c94f35 1543OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1544OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1545
b02475c5
SH
1546AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1547NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1548mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1549dnl
1550NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1551mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1552dnl
1553NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1554mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1555])
1556
b676167a
SH
1557dnl Modified MPLS controller action.
1558AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1559
1560for i in 1 2 3; do
8249a1fe 1561 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:45,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
b676167a 1562done
57c94f35 1563OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1564OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b676167a 1565
b676167a
SH
1566AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1567NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1568mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
b676167a
SH
1569dnl
1570NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1571mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
b676167a
SH
1572dnl
1573NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1574mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
b676167a
SH
1575])
1576
0f3f3c3d
SH
1577dnl Modified MPLS controller action.
1578AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1579
1580for i in 1 2 3; do
8249a1fe 1581 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:46,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
0f3f3c3d 1582done
57c94f35 1583OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1584OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
0f3f3c3d 1585
0f3f3c3d
SH
1586AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1587NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1588mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1589dnl
1590NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1591mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1592dnl
1593NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1594mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1595])
1596
1597dnl Modified MPLS controller action.
1598AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1599
1600for i in 1 2 3; do
8249a1fe 1601 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:47,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
0f3f3c3d 1602done
57c94f35 1603OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1604OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
0f3f3c3d 1605
0f3f3c3d
SH
1606AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1607NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1608mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1609dnl
1610NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1611mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1612dnl
1613NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1614mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1615])
1616
1ffd16af
SH
1617AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1618
1619dnl Modified MPLS controller action.
1620AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1621
1622for i in 1 2 3; do
1623 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:49,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=64,bos=1)'
1624done
1625OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1626ovs-appctl -t ovs-ofctl exit
1627
1628AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1629NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1630mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1ffd16af
SH
1631dnl
1632NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1633mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1ffd16af
SH
1634dnl
1635NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1636mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1ffd16af
SH
1637])
1638
1639AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1640
0f3f3c3d
SH
1641dnl Modified MPLS controller action.
1642AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1643
1644for i in 1 2 3; do
8249a1fe 1645 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:48,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
0f3f3c3d 1646done
57c94f35 1647OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1648OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
0f3f3c3d 1649
0f3f3c3d
SH
1650AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1651NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1652mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
0f3f3c3d
SH
1653dnl
1654NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1655mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
0f3f3c3d
SH
1656dnl
1657NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1658mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
0f3f3c3d
SH
1659])
1660
b02475c5
SH
1661dnl Modified MPLS actions.
1662AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1663
1664for i in 1 2 3; do
02830175 1665 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:55:55:55:55:55,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)'
b02475c5 1666done
57c94f35 1667OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1668OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1669
b02475c5
SH
1670AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1671NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1672mpls,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1673dnl
1674NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1675mpls,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1676dnl
1677NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1678mpls,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1679])
1680
1681dnl Modified MPLS ipv6 controller action.
1682AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1683
1684for i in 1 2 3; do
1685 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=70:77:77:77:77:77,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'
1686done
57c94f35 1687OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1688OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1689
b02475c5
SH
1690AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1691NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1692mplsm,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
b02475c5
SH
1693dnl
1694NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1695mplsm,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
b02475c5
SH
1696dnl
1697NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1698mplsm,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
b02475c5
SH
1699])
1700
1701
1702dnl Modified MPLS pop action.
cff78c88
SH
1703dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1704dnl 60:66:66:66:66:66 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
1705dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1706
b02475c5
SH
1707AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1708
1709for i in 1 2 3; do
cff78c88 1710 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 66 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
b02475c5 1711done
cff78c88
SH
1712#for i in 2 3; do
1713# ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=60:66:66:66:66:66,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=100,bos=1)'
1714#done
57c94f35 1715OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1716OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1717
b02475c5 1718AT_CHECK([cat ofctl_monitor.log], [0], [dnl
cff78c88 1719NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1720tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
b02475c5 1721dnl
cff78c88 1722NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1723tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
b02475c5 1724dnl
cff78c88 1725NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1726tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
b02475c5
SH
1727])
1728
5c0243a9 1729AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
0d56eaf2 1730
1ffd16af
SH
1731dnl Modified MPLS pop action.
1732dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1733dnl 60:66:66:66:00:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1734dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1735dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1736AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1737
1738for i in 1 2 3; do
1739 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1740done
1741OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1742OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1743
1744AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1745NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1746tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1747dnl
1748NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1749tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1750dnl
1751NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1752tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1753])
1754
1755AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1756
1757dnl Modified MPLS pop action.
1758dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1759dnl 60:66:66:66:00:02 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1760dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1761dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1762AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1763
1764for i in 1 2 3; do
1765 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 02 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1766done
1767OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1768OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1769
1770AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1771NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1772tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
1773dnl
1774NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1775tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
1776dnl
1777NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1778tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
1779])
1780
1781AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1782
1783dnl Modified MPLS pop action.
1784dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1785dnl 60:66:66:66:00:03 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1786dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1787dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1788AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1789
1790for i in 1 2 3; do
1791 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 03 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1792done
1793OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1794OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1795
1796AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1797NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1798tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
1799dnl
1800NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1801tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
1802dnl
1803NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1804tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
1805])
1806
1807AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1808
1809dnl Modified MPLS pop action.
1810dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1811dnl 60:66:66:66:00:04 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1812dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1813dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1814AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1815
1816for i in 1 2 3; do
1817 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 04 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1818done
1819OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1820OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1821
1822AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1823NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1824tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
1825dnl
1826NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1827tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
1828dnl
1829NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1830tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
1831])
1832
1833AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1834
1835dnl Modified MPLS pop action.
1836dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1837dnl 60:66:66:66:00:05 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1838dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1839dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1840AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1841
1842for i in 1 2 3; do
1843 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 05 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1844done
1845OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1846OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1847
1848AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1849NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1850tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1ffd16af
SH
1851dnl
1852NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1853tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1ffd16af
SH
1854dnl
1855NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1856tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1ffd16af
SH
1857])
1858
1859AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1860
1861dnl Modified MPLS pop action.
1862dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1863dnl 60:66:66:66:00:06 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1864dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1865dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1866AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1867
1868for i in 1 2 3; do
1869 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 06 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1870done
1871OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1872OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1873
1874AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1875NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1876tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1ffd16af
SH
1877dnl
1878NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1879tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1ffd16af
SH
1880dnl
1881NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1882tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1ffd16af
SH
1883])
1884
1885AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1886
1887dnl Modified MPLS pop action.
1888dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1889dnl 60:66:66:66:00:07 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1890dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1891dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1892AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1893
1894for i in 1 2 3; do
1895 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 07 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1896done
1897OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1898OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1899
1900AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1901NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1902tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1903dnl
1904NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1905tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1906dnl
1907NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1908tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1909])
1910
1911AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1912
1913dnl Modified MPLS pop action.
1914dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
1915dnl 60:66:66:66:00:08 > ff:ff:ff:ff:ff:ff, ethertype MPLS unicast (0x8847), length 46: MPLS (label 20, exp 0, [S], ttl 32)
1916AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1917
1918for i in 1 2 3; do
1919 ovs-appctl netdev-dummy/receive p1 'ff ff ff ff ff ff 60 66 66 66 00 08 88 47 00 01 41 20 00 01 08 00 06 04 00 02 60 66 66 66 00 08 c0 a8 00 01 ff ff ff ff ff ff ff ff ff ff'
1920done
1921OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1922OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1923
1924AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1925NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
78c9486d 1926arp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
1ffd16af
SH
1927dnl
1928NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
78c9486d 1929arp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
1ffd16af
SH
1930dnl
1931NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
78c9486d 1932arp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
1ffd16af
SH
1933])
1934
1935AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1936
1937dnl Modified MPLS pop action.
1938dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1939dnl 60:66:66:66:00:09 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1940dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1941dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1942AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1943
1944for i in 1 2 3; do
1945 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 09 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1946done
1947OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1948OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1949
1950AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1951NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1952tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1953dnl
1954NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1955tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1956dnl
1957NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1958tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
1959])
1960
1961AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1962
1963dnl Modified MPLS pop action.
1964dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1965dnl 60:66:66:66:00:0a > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1966dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1967dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1968AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1969
1970for i in 1 2 3; do
1971 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0a 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1972done
1973OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1974OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1975
1976AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1977NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1978tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
1979dnl
1980NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1981tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
1982dnl
1983NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1984tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
1985])
1986
1987AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1988
1989dnl Modified MPLS pop action.
1990dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1991dnl 60:66:66:66:00:0b > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1992dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1993dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1994AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1995
1996for i in 1 2 3; do
1997 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0b 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1998done
1999OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2000OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2001
2002AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2003NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2004tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
1ffd16af
SH
2005dnl
2006NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2007tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
1ffd16af
SH
2008dnl
2009NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2010tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
1ffd16af
SH
2011])
2012
2013AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2014
2015dnl Modified MPLS pop action.
2016dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2017dnl 60:66:66:66:01:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2018dnl (label 20, exp 0, [S], ttl 31)
2019dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2020dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2021AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2022
2023for i in 1 2 3; do
2024 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 00 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2025done
2026OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2027OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2028
2029AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2030NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2031mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2032dnl
2033NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2034mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2035dnl
2036NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2037mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2038])
2039
2040AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2041
2042dnl Modified MPLS pop action.
2043dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2044dnl 60:66:66:66:01:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2045dnl (label 20, exp 0, [S], ttl 31)
2046dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2047dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2048AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2049
2050for i in 1 2 3; do
2051 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 01 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2052done
2053OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2054OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2055
2056AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5af43325 2057NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2058mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2059dnl
5af43325 2060NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2061mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2062dnl
5af43325 2063NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2064mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af
SH
2065])
2066
2067AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2068
2069dnl Modified MPLS pop action.
2070dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2071dnl 60:66:66:66:01:02 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2072dnl (label 20, exp 0, [S], ttl 31)
2073dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2074dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2075AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2076
2077for i in 1 2 3; do
2078 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 02 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2079done
2080OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2081OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2082
2083AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2084NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2085mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2086dnl
2087NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2088mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2089dnl
2090NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2091mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2092])
2093
2094AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2095
2096dnl Modified MPLS pop action.
2097dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2098dnl 60:66:66:66:02:00 > 50:54:00:00:02:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2099dnl (label 20, exp 0, [S], ttl 31)
2100dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2101dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2102AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2103
2104for i in 1 2 3; do
2105 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 00 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2106done
2107OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2108OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2109
2110AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5af43325 2111NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2112tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2113dnl
5af43325 2114NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2115tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2116dnl
5af43325 2117NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2118tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2119])
2120
2121AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2122
2123dnl Modified MPLS pop action.
2124dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2125dnl 60:66:66:66:02:01 > 50:54:00:00:02:01, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2126dnl (label 20, exp 0, [S], ttl 31)
2127dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2128dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2129AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2130
2131for i in 1 2 3; do
2132 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 01 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2133done
2134OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2135OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2136
2137AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2138NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2139tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2140dnl
2141NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2142tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2143dnl
2144NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2145tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2146])
2147
2148AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2149
2150dnl Modified MPLS pop action.
2151dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2152dnl 60:66:66:66:02:10 > 50:54:00:00:02:10, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2153dnl (label 20, exp 0, [S], ttl 31)
2154dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2155dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2156AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2157
2158for i in 1 2 3; do
2159 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 10 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2160done
2161OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2162OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2163
2164AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2165NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2166tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2167dnl
2168NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2169tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2170dnl
2171NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2172tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2173])
2174
2175AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2176
2177dnl Modified MPLS pop action.
2178dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2179dnl 60:66:66:66:03:00 > 50:54:00:00:00:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2180dnl (label 20, exp 0, ttl 31)
2181dnl (label 20, exp 0, [S], ttl 30)
2182dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2183dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2184AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2185
2186for i in 1 2 3; do
2187 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 00 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2188done
2189OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2190OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2191
2192AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5af43325 2193NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2194mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2195dnl
5af43325 2196NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2197mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2198dnl
5af43325 2199NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2200mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af
SH
2201])
2202
2203AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2204
2205dnl Modified MPLS pop action.
2206dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2207dnl 60:66:66:66:03:01 > 50:54:00:00:00:00, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2208dnl (label 20, exp 0, ttl 31)
2209dnl (label 20, exp 0, [S], ttl 30)
2210dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2211dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2212AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2213
2214for i in 1 2 3; do
2215 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 01 88 48 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2216done
2217OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2218OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2219
2220AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5af43325 2221NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2222mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af 2223dnl
5af43325 2224NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2225mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af 2226dnl
5af43325 2227NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2228mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af
SH
2229])
2230
2231AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2232
2233dnl Modified MPLS pop action.
2234dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2235dnl 60:66:66:66:03:10 > 50:54:00:00:00:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2236dnl (label 20, exp 0, ttl 31)
2237dnl (label 20, exp 0, [S], ttl 30)
2238dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2239dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2240AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2241
2242for i in 1 2 3; do
2243 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 10 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2244done
2245OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2246OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2247
2248AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5af43325 2249NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2250mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af 2251dnl
5af43325 2252NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2253mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af 2254dnl
5af43325 2255NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2256mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af
SH
2257])
2258
2259AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2260
2261dnl Modified MPLS pop action.
2262dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2263dnl 60:66:66:66:04:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2264dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2265dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2266AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2267
2268for i in 1 2 3; do
2269 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 00 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2270done
2271OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2272OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2273
2274AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2275NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2276mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
1ffd16af
SH
2277dnl
2278NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2279mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
1ffd16af
SH
2280dnl
2281NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2282mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
1ffd16af
SH
2283])
2284
2285AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2286
2287dnl Modified MPLS pop action.
2288dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2289dnl 60:66:66:66:04:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2290dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2291dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2292AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2293
2294for i in 1 2 3; do
2295 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 01 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2296done
2297OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2298OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2299
2300AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2301NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2302mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
1ffd16af
SH
2303dnl
2304NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2305mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
1ffd16af
SH
2306dnl
2307NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2308mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
1ffd16af
SH
2309])
2310
2311AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2312
2313dnl Modified MPLS pop action.
2314dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2315dnl 60:66:66:66:04:10 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2316dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2317dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2318AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2319
2320for i in 1 2 3; do
2321 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 10 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2322done
2323OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2324OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2325
2326AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2327NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2328mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
1ffd16af
SH
2329dnl
2330NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2331mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
1ffd16af
SH
2332dnl
2333NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2334mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
1ffd16af
SH
2335])
2336
2337AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2338
2339dnl Modified MPLS pop action.
2340dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2341dnl 60:66:66:66:05:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2342dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2343dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2344AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2345
2346for i in 1 2 3; do
2347 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 00 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2348done
2349OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2350OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2351
2352AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2353NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2354mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
1ffd16af
SH
2355dnl
2356NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2357mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
1ffd16af
SH
2358dnl
2359NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2360mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
1ffd16af
SH
2361])
2362
2363AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2364
2365dnl Modified MPLS pop action.
2366dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2367dnl 60:66:66:66:05:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2368dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2369dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2370AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2371
2372for i in 1 2 3; do
2373 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2374done
2375OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2376OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2377
2378AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5af43325 2379NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2380mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2381dnl
5af43325 2382NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2383mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2384dnl
5af43325 2385NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2386mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2387])
2388
2389AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2390
2391dnl Modified MPLS pop action.
2392dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2393dnl 60:66:66:66:05:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2394dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2395dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2396AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2397
2398for i in 1 2 3; do
2399 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 10 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2400done
2401OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2402OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2403
2404AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5af43325 2405NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2406mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2407dnl
5af43325 2408NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2409mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2410dnl
5af43325 2411NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2412mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2413])
2414
cea4a6d7 2415AT_CHECK([ovs-appctl revalidator/purge], [0])
ef0ce8ae 2416AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b02475c5
SH
2417 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2418 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2419 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
b676167a 2420 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,CONTROLLER:65535
0f3f3c3d
SH
2421 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),CONTROLLER:65535
2422 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535
2423 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535
b0a17866 2424 cookie=0xa, n_packets=3, n_bytes=180, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,CONTROLLER:65535
1ffd16af 2425 cookie=0xa, n_packets=3, n_bytes=180, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
392c30ba 2426 cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
b02475c5 2427 cookie=0xc, n_packets=3, n_bytes=180, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[[]],load:0x7->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
1ffd16af 2428 cookie=0xd, n_packets=3, n_bytes=180, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
c2d936a4 2429 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
1ffd16af
SH
2430 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->NXM_OF_IP_DST[[]],CONTROLLER:65535
2431 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:NXM_OF_IP_DST[[]]->NXM_OF_IP_SRC[[]],CONTROLLER:65535
2432 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:NXM_OF_IP_DST[[]],pop:NXM_OF_IP_SRC[[]],CONTROLLER:65535
2433 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,NXM_OF_IP_SRC[[0..7]]),CONTROLLER:65535
2434 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,NXM_OF_IP_SRC[[0..15]],slaves:1,2),CONTROLLER:65535
2435 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]]),CONTROLLER:65535
2436 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48,CONTROLLER:65535
2437 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,CONTROLLER:65535
2438 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,CONTROLLER:65535
2439 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,CONTROLLER:65535
2440 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
c2d936a4 2441 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
1ffd16af
SH
2442 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,CONTROLLER:65535
2443 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2444 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
cff78c88 2445 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
1ffd16af
SH
2446 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2447 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2448 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2449 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,CONTROLLER:65535
c2d936a4
BP
2450 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2451 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
1ffd16af
SH
2452 cookie=0xd, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,CONTROLLER:65535
2453 cookie=0xd, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2454 cookie=0xd, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2455 cookie=0xd, table=1, n_packets=3, n_bytes=168, arp actions=CONTROLLER:65535
ef0ce8ae 2456NXST_FLOW reply:
15056dc8
EJ
2457])
2458
2459OVS_VSWITCHD_STOP
8e9ce036 2460AT_CLEANUP
04c956fc 2461
1ffd16af
SH
2462AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2463OVS_VSWITCHD_START([dnl
2464 add-port br0 p1 -- set Interface p1 type=dummy
2465])
2466ON_EXIT([kill `cat ovs-ofctl.pid`])
2467
2468AT_CAPTURE_FILE([ofctl_monitor.log])
2469AT_DATA([flows.txt], [dnl
2470table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2471table=1 ip,ip_dscp=8 actions=controller
2472])
2473AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2474
2475
2476dnl Modified MPLS pop action.
2477dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2478dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2479dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2480dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2481AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2482
2483for i in 1 2 3; do
2484 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2485done
2486OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2487OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2488
2489AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2490OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2491tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2492dnl
2493OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2494tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2495dnl
2496OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2497tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2498])
2499
cea4a6d7 2500AT_CHECK([ovs-appctl revalidator/purge], [0])
1ffd16af
SH
2501AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2502 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
2503 table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
2504OFPST_FLOW reply (OF1.2):
2505])
2506
2507OVS_VSWITCHD_STOP
2508AT_CLEANUP
2509
2510AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
2511OVS_VSWITCHD_START([dnl
2512 add-port br0 p1 -- set Interface p1 type=dummy
2513])
2514ON_EXIT([kill `cat ovs-ofctl.pid`])
2515
2516dnl N.B: The first (and only) action that accesses L3 data after the
2517dnl pop_mpls action is present in write_actions. This exercises recirculation
2518dnl triggered in write_actions due to a previous action not in write actions.
2519AT_CAPTURE_FILE([ofctl_monitor.log])
2520AT_DATA([flows.txt], [dnl
2521mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
2522])
2523AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2524
2525dnl Modified MPLS pop action.
2526dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2527dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2528dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2529dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2530AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2531
2532for i in 1 2 3; do
2533 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2534done
2535OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2536OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2537
2538AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2539OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2540tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2541dnl
2542OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2543tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2544dnl
2545OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2546tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2547])
2548
cea4a6d7 2549AT_CHECK([ovs-appctl revalidator/purge], [0])
1ffd16af
SH
2550AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2551 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
2552OFPST_FLOW reply (OF1.2):
2553])
2554
2555OVS_VSWITCHD_STOP
2556AT_CLEANUP
527ae97e
SH
2557
2558AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
2559OVS_VSWITCHD_START([dnl
2560 add-port br0 p1 -- set Interface p1 type=dummy
2561])
2562ON_EXIT([kill `cat ovs-ofctl.pid`])
2563
2564AT_CAPTURE_FILE([ofctl_monitor.log])
2565# A table-miss flow has priority 0 and no match
2566AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2567
2568dnl Singleton controller action.
2569AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2570
2571for i in 1 2 3 ; do
2572 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2573done
2574OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2575ovs-appctl -t ovs-ofctl exit
2576
2577AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2578OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 2579tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2580dnl
2581OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 2582tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2583dnl
2584OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 2585tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2586])
2587
cea4a6d7 2588AT_CHECK([ovs-appctl revalidator/purge], [0])
527ae97e
SH
2589AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2590 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2591NXST_FLOW reply:
2592])
2593
2594OVS_VSWITCHD_STOP
2595AT_CLEANUP
2596
2597
2598AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
2599OVS_VSWITCHD_START([dnl
2600 add-port br0 p1 -- set Interface p1 type=dummy
2601])
2602ON_EXIT([kill `cat ovs-ofctl.pid`])
2603
2604AT_CAPTURE_FILE([ofctl_monitor.log])
2605# A table-miss flow has priority 0 and no match
2606AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2607
2608dnl Singleton controller action.
2609AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2610
2611for i in 1 2 3 ; do
2612 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2613done
2614OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2615ovs-appctl -t ovs-ofctl exit
2616
2617AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2618
2619AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2620OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 2621tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2622dnl
2623OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 2624tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2625dnl
2626OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 2627tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
ba96552a
SS
2628])
2629
cea4a6d7 2630AT_CHECK([ovs-appctl revalidator/purge], [0])
ba96552a
SS
2631AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2632 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2633OFPST_FLOW reply (OF1.3):
2634])
2635
2636OVS_VSWITCHD_STOP
2637AT_CLEANUP
2638
2639AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)])
2640OVS_VSWITCHD_START([dnl
2641 add-port br0 p1 -- set Interface p1 type=dummy
2642])
2643ON_EXIT([kill `cat ovs-ofctl.pid`])
2644
5b7278a1
JS
2645ovs-appctl time/stop
2646
ba96552a
SS
2647AT_CAPTURE_FILE([ofctl_monitor.log])
2648# A table-miss flow has priority 0 and no match
2649AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2650
2651dnl Singleton controller action.
2652AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2653
2654# Become slave (OF 1.3), which should disable everything except port status.
2655ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2656
5b7278a1
JS
2657# Ensure that ovs-vswitchd gets a chance to reply before sending another command.
2658ovs-appctl time/warp 500 100
2659
ba96552a
SS
2660# Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
2661ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
2662
5b7278a1 2663ovs-appctl time/warp 500 100
ba96552a
SS
2664for i in 1 2 3 ; do
2665 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2666done
2667OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2668ovs-appctl -t ovs-ofctl exit
2669
cea4a6d7 2670AT_CHECK([ovs-appctl revalidator/purge], [0])
ba96552a
SS
2671AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2672send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1
2673OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1
2674dnl
2675send: OFPT_SET_ASYNC (OF1.3) (xid=0x2):
2676 master:
2677 PACKET_IN: (off)
2678 PORT_STATUS: (off)
2679 FLOW_REMOVED: (off)
2680
2681 slave:
2682 PACKET_IN: no_match
2683 PORT_STATUS: (off)
2684 FLOW_REMOVED: (off)
2685dnl
2686OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2687tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2688dnl
2689OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2690tcp,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
2691dnl
2692OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2693tcp,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
2694])
2695
2696AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2697
2698AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2699 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2700OFPST_FLOW reply (OF1.3):
2701])
2702
2703OVS_VSWITCHD_STOP
2704AT_CLEANUP
2705
807c7989
SS
2706
2707AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)])
2708OVS_VSWITCHD_START([dnl
2709 add-port br0 p1 -- set Interface p1 type=dummy
2710])
2711ON_EXIT([kill `cat ovs-ofctl.pid`])
2712
2713AT_CAPTURE_FILE([ofctl_monitor.log])
2714# A table-miss flow has priority 0 and no match
2715AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2716
2717dnl Singleton controller action.
2718AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2719
2720for i in 1 2 3 ; do
2721 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2722done
2723OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2724ovs-appctl -t ovs-ofctl exit
2725
cea4a6d7 2726AT_CHECK([ovs-appctl revalidator/purge], [0])
807c7989
SS
2727AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2728OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2729tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2730dnl
2731OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2732tcp,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
2733dnl
2734OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2735tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2736])
2737
2738AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2739
2740AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2741 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2742OFPST_FLOW reply (OF1.4):
2743])
2744
2745OVS_VSWITCHD_STOP
2746AT_CLEANUP
2747
2748
3a11fd5b
SS
2749
2750AT_SETUP([ofproto-dpif - packet-in reason in group table (Openflow 1.3)])
2751OVS_VSWITCHD_START([dnl
2752 add-port br0 p1 -- set Interface p1 type=dummy
2753])
2754ON_EXIT([kill `cat ovs-ofctl.pid`])
2755
2756AT_CAPTURE_FILE([ofctl_monitor.log])
2757# A table-miss flow has priority 0 and no match
2758AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2759AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'in_port=1 actions=group:1234'])
2760
2761dnl Singleton controller action.
2762AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2763
2764for i in 1 2 3 ; do
2765 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2766done
2767OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2768ovs-appctl -t ovs-ofctl exit
2769
2770AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2771
2772AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2773OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2774tcp,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
2775dnl
2776OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2777tcp,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
2778dnl
2779OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2780tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2781])
2782
2783AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2784
2785AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2786 n_packets=3, n_bytes=180, in_port=1 actions=group:1234
2787OFPST_FLOW reply (OF1.3):
2788])
2789
2790OVS_VSWITCHD_STOP
2791AT_CLEANUP
2792
2793
2794AT_SETUP([ofproto-dpif - packet-in reason in group table (Openflow 1.4)])
2795OVS_VSWITCHD_START([dnl
2796 add-port br0 p1 -- set Interface p1 type=dummy
2797])
2798ON_EXIT([kill `cat ovs-ofctl.pid`])
2799
2800AT_CAPTURE_FILE([ofctl_monitor.log])
2801# A table-miss flow has priority 0 and no match
2802AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2803AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'in_port=1 actions=group:1234'])
2804
2805dnl Singleton controller action.
2806AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2807
2808for i in 1 2 3 ; do
2809 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2810done
2811OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2812ovs-appctl -t ovs-ofctl exit
2813
2814AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2815
2816AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2817OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2818tcp,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
2819dnl
2820OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2821tcp,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
2822dnl
2823OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
2824tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2825])
2826
2827AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2828
2829AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2830 n_packets=3, n_bytes=180, in_port=1 actions=group:1234
2831OFPST_FLOW reply (OF1.4):
2832])
2833
2834OVS_VSWITCHD_STOP
2835AT_CLEANUP
2836
f6c8a6b1
BP
2837AT_SETUP([ofproto-dpif - ARP modification slow-path])
2838OVS_VSWITCHD_START
2839ADD_OF_PORTS([br0], [1], [2])
2840
2841ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
2842ovs-ofctl add-flow br0 'in_port=1,arp actions=load:2->OXM_OF_ARP_OP[[]],2,load:0xc0a88001->OXM_OF_ARP_SPA[[]],2,load:0x404444444441->OXM_OF_ARP_THA[[]],2'
2843
2844# Input some packets that should follow the arp modification slow-path.
2845for i in 1 2 3; do
2846 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
2847done
2848AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2849
2850# Check the packets that were output.
2851AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
78c9486d
JR
2852arp,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
2853arp,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
2854arp,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
2855arp,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
2856arp,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
2857arp,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
2858arp,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
2859arp,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
2860arp,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
2861])
2862
f6c8a6b1
BP
2863OVS_VSWITCHD_STOP
2864AT_CLEANUP
2865
ecac4ebf 2866AT_SETUP([ofproto-dpif - VLAN handling])
04c956fc 2867OVS_VSWITCHD_START(
023e1e0a
BP
2868 [set Bridge br0 fail-mode=standalone -- \
2869 add-port br0 p1 trunks=10,12 -- \
ecac4ebf 2870 add-port br0 p2 tag=10 -- \
5e9ceccd
BP
2871 add-port br0 p3 tag=12 \
2872 other-config:priority-tags=true -- \
ecac4ebf
BP
2873 add-port br0 p4 tag=12 -- \
2874 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
2875 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
2876 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
5e9ceccd
BP
2877 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
2878 other-config:priority-tags=true -- \
ecac4ebf
BP
2879 set Interface p1 type=dummy -- \
2880 set Interface p2 type=dummy -- \
2881 set Interface p3 type=dummy -- \
2882 set Interface p4 type=dummy -- \
2883 set Interface p5 type=dummy -- \
2884 set Interface p6 type=dummy -- \
2885 set Interface p7 type=dummy -- \
2886 set Interface p8 type=dummy --])
04c956fc 2887
247527db
BP
2888dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
2889dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
ecac4ebf 2890dnl actions.
04c956fc 2891for tuple in \
e44768b7
JP
2892 "100 none 0 drop" \
2893 "100 0 0 drop" \
2894 "100 0 1 drop" \
2895 "100 10 0 1,5,6,7,8,pop_vlan,2" \
2896 "100 10 1 1,5,6,7,8,pop_vlan,2" \
2897 "100 11 0 5,7" \
2898 "100 11 1 5,7" \
2899 "100 12 0 1,5,6,pop_vlan,3,4,7,8" \
2900 "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
247527db
BP
2901 "1 none 0 drop" \
2902 "1 0 0 drop" \
2903 "1 0 1 drop" \
e44768b7
JP
2904 "1 10 0 5,6,7,8,100,pop_vlan,2" \
2905 "1 10 1 5,6,7,8,100,pop_vlan,2" \
247527db
BP
2906 "1 11 0 drop" \
2907 "1 11 1 drop" \
e44768b7
JP
2908 "1 12 0 5,6,100,pop_vlan,3,4,7,8" \
2909 "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2910 "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
2911 "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
2912 "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
247527db
BP
2913 "2 10 0 drop" \
2914 "2 10 1 drop" \
2915 "2 11 0 drop" \
2916 "2 11 1 drop" \
2917 "2 12 0 drop" \
2918 "2 12 1 drop" \
e44768b7
JP
2919 "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2920 "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2921 "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
247527db
BP
2922 "3 10 0 drop" \
2923 "3 10 1 drop" \
2924 "3 11 0 drop" \
2925 "3 11 1 drop" \
2926 "3 12 0 drop" \
2927 "3 12 1 drop" \
e44768b7
JP
2928 "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2929 "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2930 "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
247527db
BP
2931 "4 10 0 drop" \
2932 "4 10 1 drop" \
2933 "4 11 0 drop" \
2934 "4 11 1 drop" \
2935 "4 12 0 drop" \
2936 "4 12 1 drop" \
e44768b7
JP
2937 "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
2938 "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
2939 "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
2940 "5 10 0 1,6,7,8,100,pop_vlan,2" \
2941 "5 10 1 1,6,7,8,100,pop_vlan,2" \
2942 "5 11 0 7,100" \
2943 "5 11 1 7,100" \
2944 "5 12 0 1,6,100,pop_vlan,3,4,7,8" \
2945 "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2946 "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
2947 "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
2948 "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
2949 "6 10 0 1,5,7,8,100,pop_vlan,2" \
2950 "6 10 1 1,5,7,8,100,pop_vlan,2" \
247527db
BP
2951 "6 11 0 drop" \
2952 "6 11 1 drop" \
e44768b7
JP
2953 "6 12 0 1,5,100,pop_vlan,3,4,7,8" \
2954 "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2955 "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2956 "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2957 "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
2958 "7 10 0 1,5,6,8,100,pop_vlan,2" \
2959 "7 10 1 1,5,6,8,100,pop_vlan,2" \
2960 "7 11 0 5,100" \
2961 "7 11 1 5,100" \
2962 "7 12 0 1,5,6,100,pop_vlan,3,4,8" \
2963 "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
2964 "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
2965 "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
2966 "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
2967 "8 10 0 1,5,6,7,100,pop_vlan,2" \
2968 "8 10 1 1,5,6,7,100,pop_vlan,2" \
247527db
BP
2969 "8 11 0 drop" \
2970 "8 11 1 drop" \
e44768b7
JP
2971 "8 12 0 1,5,6,100,pop_vlan,3,4,7" \
2972 "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
04c956fc
BP
2973do
2974 set $tuple
2975 in_port=$1
2976 vlan=$2
ecac4ebf
BP
2977 pcp=$3
2978 expected=$4
04c956fc
BP
2979
2980 if test $vlan = none; then
247527db 2981 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
04c956fc 2982 else
247527db 2983 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=$vlan,pcp=$pcp),encap(eth_type(0xabcd))"
04c956fc
BP
2984 fi
2985
395e68ce
BP
2986 echo "----------------------------------------------------------------------"
2987 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
2988
50aa28fd 2989 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
ecac4ebf 2990 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
04c956fc 2991
247527db 2992 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
becffb86 2993 mv stdout expout
247527db 2994 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
04c956fc
BP
2995done
2996
2997OVS_VSWITCHD_STOP
2998AT_CLEANUP
7257b535 2999
56879058
JS
3000AT_SETUP([ofproto-dpif - MPLS handling])
3001OVS_VSWITCHD_START([dnl
3002 add-port br0 p1 -- set Interface p1 type=dummy
3003])
3004ON_EXIT([kill `cat ovs-ofctl.pid`])
3005
3006AT_CAPTURE_FILE([ofctl_monitor.log])
3007AT_DATA([flows.txt], [dnl
3008dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
63636ee8 3009dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
0c1625e8 3010dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
56879058
JS
3011])
3012AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3013
3014dnl In this test, we push an MPLS tag to an ethernet packet.
3015AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3016
3017for i in 1 2 3; do
3018 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:00,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3019done
62022172 3020OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3021OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
56879058
JS
3022
3023AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3024OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3025mpls,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
302600000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
302700000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
302800000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
302900000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3030dnl
3031OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3032mpls,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
303300000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
303400000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
303500000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
303600000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3037dnl
3038OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3039mpls,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
304000000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
304100000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
304200000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
304300000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3044])
3045
63636ee8
JS
3046dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3047dnl copied exactly, except for the BOS bit.
3048AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3049
3050for i in 1 2 3; do
3051 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:01,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3052done
62022172 3053OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3054OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
63636ee8
JS
3055
3056AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3057OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3058mpls,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
305900000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
306000000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
306100000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
306200000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3063dnl
3064OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3065mpls,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
306600000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
306700000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
306800000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
306900000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3070dnl
3071OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3072mpls,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
307300000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
307400000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
307500000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
0c1625e8
SH
307600000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3077])
3078
3079dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3080dnl copied exactly, except for the BOS bit. The ethertype should be updated
3081dnl to the MPLS ethertype of the MPLS push action which differs to that
3082dnl of the input packet.
3083AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3084
3085for i in 1 2 3; do
3086 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:02,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3087done
62022172 3088OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c1625e8
SH
3089OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
3090
3091AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3092OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3093mplsm,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
309400000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
309500000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
309600000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
309700000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3098dnl
3099OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3100mplsm,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
310100000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
310200000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
310300000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
310400000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3105dnl
3106OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3107mplsm,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
310800000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
310900000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
311000000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
63636ee8
JS
311100000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3112])
3113
56879058
JS
3114OVS_VSWITCHD_STOP
3115AT_CLEANUP
3116
846e159a
SH
3117AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
3118OVS_VSWITCHD_START([dnl
3119 add-port br0 p1 -- set Interface p1 type=dummy
3120])
3121ON_EXIT([kill `cat ovs-ofctl.pid`])
3122
3123AT_CAPTURE_FILE([ofctl_monitor.log])
3124AT_DATA([flows.txt], [dnl
3125cookie=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
3126cookie=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
3127cookie=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
3128cookie=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
3129cookie=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
3130cookie=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
3131cookie=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
3132cookie=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
3133cookie=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
3134cookie=0xa dl_src=40:44:44:44:54:59,vlan_tci=0x1000/0x1000 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],set_vlan_pcp:1,load:99->OXM_OF_VLAN_VID[[]],controller
3135])
3136AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3137
3138dnl Modified MPLS controller action.
3139dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3140dnl both of these in the final flow
3141AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3142
3143for i in 1 2 3; do
3144 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:50,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3145done
62022172 3146OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3147OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3148
3149AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3150OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3151mpls,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
315200000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
315300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
315400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
315500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
315600000040 00 00 00 00
3157dnl
3158OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3159mpls,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
316000000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
316100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
316200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
316300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
316400000040 00 00 00 00
3165dnl
3166OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3167mpls,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
316800000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
316900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
317000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
317100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
317200000040 00 00 00 00
3173])
3174
3175dnl Modified MPLS controller action.
3176dnl In this test, the input packet in vlan-tagged, which should be stripped
3177dnl before we push the MPLS and VLAN tags.
3178AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3179
3180for i in 1 2 3; do
3181 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:51,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3182done
62022172 3183OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3184OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3185
3186AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3187OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3188mpls,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
318900000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
319000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
319100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
319200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3193dnl
3194OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3195mpls,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
319600000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
319700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
319800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
319900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3200dnl
3201OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3202mpls,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
320300000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
320400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
320500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
320600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3207])
3208
3209dnl Modified MPLS controller action.
3210dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3211dnl both of these in the final flow
3212AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3213
3214for i in 1 2 3; do
3215 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:52,dst=52:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3216done
62022172 3217OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3218OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3219
3220AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3221OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3222mpls,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
322300000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
322400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
322500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
322600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
322700000040 00 00 00 00
3228dnl
3229OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3230mpls,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
323100000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
323200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
323300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
323400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
323500000040 00 00 00 00
3236dnl
3237OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3238mpls,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
323900000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
324000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
324100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
324200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
324300000040 00 00 00 00
3244])
3245
3246dnl Modified MPLS controller action.
3247dnl In this test, the input packet in vlan-tagged, which should be stripped
3248dnl before we push the MPLS and VLAN tags.
3249AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3250
3251for i in 1 2 3; do
3252 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:53,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3253done
62022172 3254OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3255OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3256
3257AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3258OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3259mpls,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
326000000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
326100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
326200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
326300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3264dnl
3265OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3266mpls,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
326700000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
326800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
326900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
327000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3271dnl
3272OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3273mpls,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
327400000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
327500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
327600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
327700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3278])
3279
3280dnl Modified MPLS controller action.
3281dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3282dnl actions are reordered, so we see both of these in the final flow.
3283AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3284
3285for i in 1 2 3; do
3286 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:54,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3287done
62022172 3288OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3289OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3290
3291AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3292OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3293mpls,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
329400000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
329500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
329600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
329700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
329800000040 00 00 00 00
3299dnl
3300OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3301mpls,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
330200000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
330300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
330400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
330500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
330600000040 00 00 00 00
3307dnl
3308OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3309mpls,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
331000000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
331100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
331200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
331300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
331400000040 00 00 00 00
3315])
3316
3317dnl Modified MPLS controller action.
3318dnl In this test, the input packet in vlan-tagged, which should be stripped
3319dnl before we push the MPLS and VLAN tags.
3320AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3321
3322for i in 1 2 3; do
3323 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:55,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3324done
62022172 3325OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
28ae2f37 3326OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
846e159a
SH
3327
3328AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3329OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3330mpls,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
333100000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
333200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
333300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
333400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3335dnl
3336OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3337mpls,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
333800000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
333900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
334000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
334100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3342dnl
3343OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3344mpls,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
334500000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
334600000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
334700000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
334800000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3349])
3350
3351dnl Modified MPLS controller action.
3352dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3353dnl actions are reordered, so we see both of these in the final flow.
3354AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3355
3356for i in 1 2 3; do
3357 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:56,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3358done
62022172 3359OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3360OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3361
3362AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3363OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3364mpls,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
336500000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
336600000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
336700000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
336800000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
336900000040 00 00 00 00
3370dnl
3371OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3372mpls,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
337300000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
337400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
337500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
337600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
337700000040 00 00 00 00
3378dnl
3379OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
78c9486d 3380mpls,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
338100000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
338200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
338300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
338400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
338500000040 00 00 00 00
3386])
3387
3388dnl Modified MPLS controller action.
3389dnl In this test, the input packet in vlan-tagged, which should be stripped
3390dnl before we push the MPLS and VLAN tags.
3391AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
3392
3393for i in 1 2 3; do
3394 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:57,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3395done
62022172 3396OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3397OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3398
3399AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3400OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3401mpls,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
340200000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
340300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
340400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
340500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3406dnl
3407OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3408mpls,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
340900000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
341000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
341100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
341200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3413dnl
3414OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3415mpls,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
341600000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
341700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
341800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
341900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3420])
3421
3422dnl Modified MPLS controller action.
3423dnl In this test, the input packet in vlan-tagged, which should be stripped
3424dnl before we push the MPLS and VLAN tags.
3425AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3426
3427for i in 1 2 3; do
3428 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:58,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3429done
62022172 3430OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3431OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3432
3433AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3434OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3435mpls,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
343600000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
343700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
343800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
343900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3440dnl
3441OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3442mpls,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
344300000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
344400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
344500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
344600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3447dnl
3448OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3449mpls,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
345000000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
345100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
345200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
345300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3454])
3455
3456dnl Modified MPLS controller action.
3457dnl In this test, the input packet in vlan-tagged, which should be modified
3458dnl before we push MPLS and VLAN tags.
3459AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3460
3461for i in 1 2 3; do
3462 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:59,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3463done
62022172 3464OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
846e159a
SH
3465ovs-appctl -t ovs-ofctl exit
3466
3467AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3468OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3469mpls,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
347000000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
347100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
347200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
347300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3474dnl
3475OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3476mpls,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
347700000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
347800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
347900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
348000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3481dnl
3482OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 3483mpls,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
348400000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
348500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
348600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
348700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3488])
3489
cea4a6d7 3490AT_CHECK([ovs-appctl revalidator/purge], [0])
846e159a
SH
3491AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3492 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3493 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3494 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3495 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3496 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3497 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3498 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3499 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3500 cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:58 actions=load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3501 cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:59 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],set_field:1->vlan_pcp,load:0x63->OXM_OF_VLAN_VID[[]],CONTROLLER:65535
3502OFPST_FLOW reply (OF1.2):
3503])
3504
3505OVS_VSWITCHD_STOP
3506AT_CLEANUP
3507
b8778a0d 3508AT_SETUP([ofproto-dpif - fragment handling - trace])
023e1e0a 3509OVS_VSWITCHD_START
72d64e33 3510ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
7257b535 3511AT_DATA([flows.txt], [dnl
12e4681c
JR
3512priority=75 tcp ip_frag=no tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
3513priority=75 tcp ip_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
12e4681c
JR
3514priority=50 tcp ip_frag=no actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
3515priority=50 tcp ip_frag=first actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
b8778a0d 3516priority=50 tcp ip_frag=later actions=output:6
7257b535
BP
3517])
3518AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3519
a61680c6 3520base_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
3521no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3522first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3523later_flow="$base_flow,frag=later)"
3524
3525 # mode no first later
3526for tuple in \
3527 'normal 1 5 6' \
3528 'drop 1 drop drop' \
3529 'nx-match 1 2 6'
3530do
3531 set $tuple
3532 mode=$1
3533 no=$2
3534 first=$3
3535 later=$4
3536
3537 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3538 for type in no first later; do
3539 eval flow=\$${type}_flow exp_output=\$$type
7fd51d39 3540 printf "\n%s\n" "----$mode $type-----"
50aa28fd 3541 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
7fd51d39
BP
3542 : > expout
3543 if test $mode = drop && test $type != no; then
3544 echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
12e4681c 3545 echo "Datapath actions: $exp_output" >> expout
b8778a0d 3546 elif test $type = later; then
12e4681c
JR
3547 echo "Datapath actions: $exp_output" >> expout
3548 else
3549 echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout
7fd51d39 3550 fi
7fd51d39 3551 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
7257b535
BP
3552 done
3553done
023e1e0a 3554OVS_VSWITCHD_STOP
7257b535 3555AT_CLEANUP
848e8809 3556
b8778a0d
JR
3557AT_SETUP([ofproto-dpif - fragment handling - upcall])
3558OVS_VSWITCHD_START
3559ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3560AT_DATA([flows.txt], [dnl
3561priority=75 tcp ip_frag=no tp_dst=80 actions=set_field:81->tcp_dst,output:1
3562priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2
3563priority=50 tcp ip_frag=no actions=set_field:81->tcp_dst,output:4
3564priority=50 tcp ip_frag=first actions=set_field:81->tcp_dst,output:5
3565priority=50 tcp ip_frag=later actions=output:6
3566])
3567AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3568
3569base_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"
3570no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3571first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3572later_flow="$base_flow,frag=later)"
3573
3574AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3575
3576mode=normal
3577
3578AT_CHECK([ovs-ofctl set-frags br0 $mode])
3579for type in no first later; do
3580 eval flow=\$${type}_flow
3581 printf "\n%s\n" "----$mode $type-----"
3582
3583 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3584done
3585
3586AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3587recirc_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
3588recirc_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
3589recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3590])
3591
3592mode=drop
3593
98bb4286 3594AT_CHECK([ovs-appctl revalidator/purge], [0])
b8778a0d
JR
3595AT_CHECK([ovs-ofctl set-frags br0 $mode])
3596for type in no first later; do
3597 eval flow=\$${type}_flow
3598 printf "\n%s\n" "----$mode $type-----"
3599
3600 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3601done
3602
3603AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3604recirc_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
3605recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop
3606recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop
3607])
3608
3609mode=nx-match
3610
98bb4286 3611AT_CHECK([ovs-appctl revalidator/purge], [0])
b8778a0d
JR
3612AT_CHECK([ovs-ofctl set-frags br0 $mode])
3613for type in no first later; do
3614 eval flow=\$${type}_flow
3615 printf "\n%s\n" "----$mode $type-----"
3616
3617 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3618done
3619
3620AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3621recirc_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
3622recirc_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
3623recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3624])
3625
3626OVS_VSWITCHD_STOP
3627AT_CLEANUP
3628
3629AT_SETUP([ofproto-dpif - fragment handling - actions])
3630OVS_VSWITCHD_START
3631ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3632
3633AT_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])
3634AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3635source field tcp_dst lacks correct prerequisites
3636ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3637])
3638
3639AT_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])
3640AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3641destination field tcp_src lacks correct prerequisites
3642ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3643])
3644
3645AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr])
3646AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3647set_field udp_src lacks correct prerequisities
3648ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3649])
3650
3651AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr])
3652AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3653set_field udp_dst lacks correct prerequisities
3654ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3655])
3656
3657AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr])
3658AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3659set_field sctp_src lacks correct prerequisities
3660ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3661])
3662
3663AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr])
3664AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3665set_field sctp_dst lacks correct prerequisities
3666ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3667])
3668
3669AT_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])
3670AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3671source field tcp_dst lacks correct prerequisites
3672ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3673])
3674
3675AT_DATA([flows.txt], [dnl
3676priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1
3677])
3678AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt])
3679
3680AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3681
3682mode=normal
3683
3684AT_CHECK([ovs-ofctl set-frags br0 $mode])
3685for frag in 4000 6000 6008 4010; do
3686 printf "\n%s\n" "----$mode $frag-----"
3687
3688 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 003c 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016 751e267b 00000000 a002 16d0 1736 0000 02 04 05 b4 04 02 08 0a 2d 25 08 5f 00 00 00 00 01 03 03 07"])
3689done
3690
3691AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3692recirc_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
3693recirc_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
3694recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1
3695])
3696
98bb4286 3697AT_CHECK([ovs-appctl revalidator/purge], [0])
b8778a0d
JR
3698AT_CHECK([ovs-ofctl set-frags br0 $mode])
3699for frag in 4000 6000 6008 4010; do
3700 printf "\n%s\n" "----$mode $frag truncated transport header -----"
3701
3702 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"])
3703done
3704
3705AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3706recirc_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
3707recirc_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
3708recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3709])
3710
98bb4286 3711AT_CHECK([ovs-appctl revalidator/purge], [0])
b8778a0d
JR
3712AT_CHECK([ovs-ofctl set-frags br0 $mode])
3713for frag in 4000 6000 6001 4002; do
3714 printf "\n%s\n" "----$mode $frag missing transport header-----"
3715
3716 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"])
3717done
3718
3719AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3720recirc_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
3721recirc_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
3722recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3723])
3724
3725OVS_VSWITCHD_STOP
3726AT_CLEANUP
3727
848e8809
EJ
3728AT_SETUP([ofproto-dpif - exit])
3729OVS_VSWITCHD_START
f7b8e494 3730ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14])
848e8809
EJ
3731AT_DATA([flows.txt], [dnl
3732in_port=1 actions=output:10,exit,output:11
3733in_port=2 actions=output:12,resubmit:1,output:12
3734in_port=3 actions=output:13,resubmit:2,output:14
3735])
3736AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 3737AT_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
3738AT_CHECK([tail -1 stdout], [0],
3739 [Datapath actions: 10
3740])
50aa28fd 3741AT_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
3742AT_CHECK([tail -1 stdout], [0],
3743 [Datapath actions: 12,10
3744])
50aa28fd 3745AT_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
3746AT_CHECK([tail -1 stdout], [0],
3747 [Datapath actions: 13,12,10
3748])
3749OVS_VSWITCHD_STOP
3750AT_CLEANUP
c06bba01
JP
3751
3752
3753AT_SETUP([ofproto-dpif - mirroring, select_all])
432fca23
BP
3754OVS_VSWITCHD_START
3755ADD_OF_PORTS([br0], 1, 2, 3)
3756ovs-vsctl \
c06bba01
JP
3757 set Bridge br0 mirrors=@m --\
3758 --id=@p3 get Port p3 --\
432fca23 3759 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
c06bba01 3760
c06bba01
JP
3761AT_DATA([flows.txt], [dnl
3762in_port=1 actions=output:2
3763in_port=2 actions=output:1
3764])
3765AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3766
247527db 3767flow="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 3768AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3769AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3770 [Datapath actions: 2,3
c06bba01
JP
3771])
3772
247527db 3773flow="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 3774AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3775AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3776 [Datapath actions: 1,3
c06bba01
JP
3777])
3778
3779OVS_VSWITCHD_STOP
3780AT_CLEANUP
3781
3782
3783AT_SETUP([ofproto-dpif - mirroring, select_src])
432fca23
BP
3784OVS_VSWITCHD_START
3785ADD_OF_PORTS([br0], 1, 2, 3)
3786ovs-vsctl \
c06bba01
JP
3787 set Bridge br0 mirrors=@m --\
3788 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
432fca23 3789 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
c06bba01 3790
c06bba01
JP
3791AT_DATA([flows.txt], [dnl
3792in_port=1 actions=output:2
3793in_port=2 actions=output:1
3794])
3795AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3796
247527db 3797flow="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 3798AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3799AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3800 [Datapath actions: 2,3
c06bba01
JP
3801])
3802
247527db 3803flow="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 3804AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3805AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3806 [Datapath actions: 1
c06bba01
JP
3807])
3808OVS_VSWITCHD_STOP
3809AT_CLEANUP
3810
33158a18 3811AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
432fca23
BP
3812OVS_VSWITCHD_START
3813ADD_OF_PORTS([br0], 1, 2)
3814ovs-vsctl \
33158a18
JP
3815 set Bridge br0 mirrors=@m --\
3816 --id=@p2 get Port p2 --\
432fca23 3817 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
33158a18 3818
33158a18
JP
3819AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
3820
3821# "in_port" defaults to OFPP_NONE if it's not specified.
72d64e33 3822flow="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
3823AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
3824AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3825 [Datapath actions: 1,2
33158a18
JP
3826])
3827
3828OVS_VSWITCHD_STOP
3829AT_CLEANUP
3830
c06bba01
JP
3831
3832AT_SETUP([ofproto-dpif - mirroring, select_dst])
432fca23
BP
3833OVS_VSWITCHD_START
3834ADD_OF_PORTS([br0], 1, 2, 3)
3835ovs-vsctl \
c06bba01
JP
3836 set Bridge br0 mirrors=@m --\
3837 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
432fca23 3838 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
c06bba01 3839
c06bba01
JP
3840AT_DATA([flows.txt], [dnl
3841in_port=1 actions=output:2
3842in_port=2 actions=output:1
3843])
3844AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3845
247527db 3846flow="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 3847AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3848AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3849 [Datapath actions: 2,3
c06bba01
JP
3850])
3851
247527db 3852flow="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 3853AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3854AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3855 [Datapath actions: 1
c06bba01
JP
3856])
3857
3858OVS_VSWITCHD_STOP
3859AT_CLEANUP
3860
3861
3862AT_SETUP([ofproto-dpif - mirroring, select_vlan])
432fca23
BP
3863OVS_VSWITCHD_START
3864ADD_OF_PORTS([br0], 1, 2, 3)
3865ovs-vsctl \
c06bba01
JP
3866 set Bridge br0 mirrors=@m --\
3867 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
432fca23 3868 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
c06bba01 3869
c06bba01
JP
3870AT_DATA([flows.txt], [dnl
3871in_port=1, actions=output:2
3872])
3873AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3874
247527db 3875flow="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 3876AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3877AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3878 [Datapath actions: 2
c06bba01
JP
3879])
3880
247527db 3881flow="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 3882AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3883AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3884 [Datapath actions: 2
c06bba01
JP
3885])
3886
247527db 3887flow="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 3888AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3889AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3890 [Datapath actions: 2,3
c06bba01
JP
3891])
3892
3893OVS_VSWITCHD_STOP
3894AT_CLEANUP
3895
3896
3897AT_SETUP([ofproto-dpif - mirroring, output_port])
432fca23
BP
3898OVS_VSWITCHD_START
3899ADD_OF_PORTS([br0], 1, 2, 3)
3900ovs-vsctl \
c06bba01
JP
3901 set Bridge br0 mirrors=@m --\
3902 --id=@p3 get Port p3 --\
432fca23 3903 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
c06bba01 3904
c06bba01
JP
3905AT_DATA([flows.txt], [dnl
3906in_port=1 actions=mod_vlan_vid:17,output:2
3907in_port=2 actions=output:1
3908])
3909AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3910
247527db 3911flow="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 3912AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3913AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3914 [Datapath actions: push_vlan(vid=17,pcp=0),2,pop_vlan,3
c06bba01
JP
3915])
3916
247527db 3917flow="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 3918AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3919AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3920 [Datapath actions: 1,3
c06bba01
JP
3921])
3922
3923OVS_VSWITCHD_STOP
3924AT_CLEANUP
3925
c06bba01 3926AT_SETUP([ofproto-dpif - mirroring, output_vlan])
432fca23
BP
3927OVS_VSWITCHD_START
3928ADD_OF_PORTS([br0], 1, 2)
3929ovs-vsctl \
c06bba01 3930 set Bridge br0 mirrors=@m --\
432fca23 3931 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
c06bba01 3932
c06bba01
JP
3933AT_DATA([flows.txt], [dnl
3934in_port=1 actions=output:2
3935in_port=2 actions=mod_vlan_vid:17,output:1
3936])
3937AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3938
247527db 3939flow="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 3940AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01
JP
3941actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3942
e44768b7 3943expected="2,push_vlan(vid=12,pcp=0),1,2,100"
247527db 3944AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
c06bba01 3945mv stdout expout
247527db 3946AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
c06bba01 3947
247527db 3948flow="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 3949AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01
JP
3950actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3951
e44768b7 3952expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
247527db 3953AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
c06bba01 3954mv stdout expout
247527db 3955AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
c06bba01
JP
3956
3957OVS_VSWITCHD_STOP
3958AT_CLEANUP
b44a10b7 3959
22bb3cbc
AW
3960# Two testcases below are for the ofproto/trace command
3961# The first one tests all correct syntax:
3962# ofproto/trace [dp_name] odp_flow [-generate|packet]
3963# ofproto/trace br_name br_flow [-generate|packet]
3964AT_SETUP([ofproto-dpif - ofproto/trace command 1])
3965OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
3966ADD_OF_PORTS([br0], 1, 2, 3)
3967
3968AT_DATA([flows.txt], [dnl
3969in_port=1 actions=output:2
3970in_port=2 actions=output:1
3971])
3972AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3973
c2a77f33 3974odp_flow="in_port(1)"
22bb3cbc 3975br_flow="in_port=1"
0a37839c
GS
3976# Test command: ofproto/trace odp_flow with in_port as a name.
3977AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3978AT_CHECK([tail -1 stdout], [0], [dnl
3979Datapath actions: 2
3980])
3981
3982odp_flow="in_port(1)"
22bb3cbc
AW
3983# Test command: ofproto/trace odp_flow
3984AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3985AT_CHECK([tail -1 stdout], [0], [dnl
3986Datapath actions: 2
3987])
3988
3989# Test command: ofproto/trace dp_name odp_flow
3990AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
3991AT_CHECK([tail -1 stdout], [0], [dnl
3992Datapath actions: 2
3993])
3994# Test commmand: ofproto/trace br_name br_flow
3995AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
3996AT_CHECK([tail -1 stdout], [0], [dnl
3997Datapath actions: 2
3998])
3999
4000# Delete the inserted flows
4001AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
4002AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
4003
78c9486d 4004# This section below tests the [-generate] option
22bb3cbc 4005odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
78c9486d 4006br_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
4007
4008# Test command: ofproto/trace odp_flow
4009AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4010# Check for no MAC learning entry
4011AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4012 port VLAN MAC Age
4013])
4014
4015# Test command: ofproto/trace br_name br_flow
4016AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4017# Check for no MAC learning entry
4018AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4019 port VLAN MAC Age
4020])
4021
4022# Test command: ofproto/trace odp_flow -generate
4023AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
4024# Check for the MAC learning entry
4025AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4026 port VLAN MAC Age
4027 3 0 50:54:00:00:00:05 ?
4028])
4029
4030# Test command: ofproto/trace dp_name odp_flow -generate
4031AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4032 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
4033 -generate], [0], [stdout])
4034# Check for both MAC learning entries
4035AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4036 port VLAN MAC Age
4037 3 0 50:54:00:00:00:05 ?
4038 1 0 50:54:00:00:00:06 ?
4039])
4040
4041# Test command: ofproto/trace br_name br_flow -generate
4042AT_CHECK([ovs-appctl ofproto/trace br0 \
4043 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
4044 -generate], [0], [stdout])
4045# Check for both MAC learning entries.
4046AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4047 port VLAN MAC Age
4048 3 0 50:54:00:00:00:05 ?
4049 1 0 50:54:00:00:00:06 ?
4050 2 0 50:54:00:00:00:07 ?
4051])
4052
4053# This section beflow tests the [packet] option
4054# The ovs-tcpundump of packets between port1 and port2
4055pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4056pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
4057
4058# Construct the MAC learning table
4059AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4060 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
4061 -generate], [0], [stdout])
4062
4063# Construct the MAC learning table
4064AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4065 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
4066 -generate], [0], [stdout])
4067
4068# Test command: ofproto/trace odp_flow packet
4069AT_CHECK([ovs-appctl ofproto/trace \
4070 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4071AT_CHECK([tail -1 stdout], [0], [dnl
4072Datapath actions: 2
4073])
b6f00895 4074AT_CHECK([head -n 2 stdout], [0], [dnl
22bb3cbc 4075Bridge: br0
78c9486d 4076Flow: 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
4077])
4078
4079# Test command: ofproto/trace dp_name odp_flow packet
4080AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4081 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4082AT_CHECK([tail -1 stdout], [0], [dnl
4083Datapath actions: 2
4084])
b6f00895 4085AT_CHECK([head -n 2 stdout], [0], [dnl
22bb3cbc 4086Bridge: br0
78c9486d 4087Flow: 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
4088])
4089
4090# Test command: ofproto/trace br_name br_flow packet
4091AT_CHECK([ovs-appctl ofproto/trace br0 \
1362e248 4092 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
22bb3cbc 4093AT_CHECK([tail -1 stdout], [0], [dnl
ed2e7245 4094Datapath actions: 1
22bb3cbc
AW
4095])
4096AT_CHECK([head -n 2 stdout], [0], [dnl
b6f00895 4097Bridge: br0
78c9486d 4098Flow: 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
4099])
4100
4101OVS_VSWITCHD_STOP
4102AT_CLEANUP
4103
4104# The second test tests the corner cases
4105AT_SETUP([ofproto-dpif - ofproto/trace command 2])
4106OVS_VSWITCHD_START
4107ADD_OF_PORTS([br0], 1, 2)
4108
4109# Define flows
4110odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
4111br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
4112# Define options
4113generate="-generate"
4114pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4115
4116# Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
4117m4_foreach(
4118[option],
4119[[],
4120["$generate"],
4121["$pkt"]],
4122[AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
4123 [2], [], [stderr])
4124AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 4125Cannot find the datapath
22bb3cbc
AW
4126ovs-appctl: ovs-vswitchd: server returned an error
4127])])
4128
4129# Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
4130m4_foreach(
4131[option],
4132[[],
4133["$generate"],
4134["$pkt"]],
4135[AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
4136 [2], [], [stderr])
4137AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 4138Cannot find the datapath
22bb3cbc
AW
4139ovs-appctl: ovs-vswitchd: server returned an error
4140])])
4141
4142# Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
4143m4_foreach(
4144[option],
4145[[],
4146["$generate"],
4147["$pkt"]],
4148[AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
4149 [2], [], [stderr])
4150AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 4151Cannot find the datapath
22bb3cbc
AW
4152ovs-appctl: ovs-vswitchd: server returned an error
4153])])
4154
4155# Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
4156m4_foreach(
4157[option],
4158[[],
4159["$generate"],
4160["$pkt"]],
4161[AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
4162 [2], [], [stderr])
4163AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 4164Cannot find the datapath
22bb3cbc
AW
4165ovs-appctl: ovs-vswitchd: server returned an error
4166])])
4167
4168# Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
4169m4_foreach(
4170[option],
4171[[],
4172["$generate"],
4173["$pkt"]],
4174[AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
4175 [2], [], [stderr])
4176AT_CHECK([tail -2 stderr], [0], [dnl
4177Unknown bridge name
4178ovs-appctl: ovs-vswitchd: server returned an error
4179])])
4180
4181# Test incorrect command: ofproto/trace br_flow [-generate|packet]
4182m4_foreach(
4183[option],
4184[[],
4185["$generate"],
4186["$pkt"]],
4187[AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
4188 [2], [], [stderr])
4189AT_CHECK([tail -2 stderr], [0], [dnl
4190Must specify bridge name
4191ovs-appctl: ovs-vswitchd: server returned an error
4192])])
4193
4194# Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
4195AT_CHECK([ovs-appctl ofproto/trace \
4196 ovs-dummy "$odp_flow" garbage_option],
4197 [2], [stdout],[stderr])
4198AT_CHECK([tail -2 stderr], [0], [dnl
4199Trailing garbage in packet data
4200ovs-appctl: ovs-vswitchd: server returned an error
4201])
4202
4203# Test incorrect command: ofproto/trace with 4 arguments
4204AT_CHECK([ovs-appctl ofproto/trace \
4205 arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
4206AT_CHECK([tail -2 stderr], [0], [dnl
4207"ofproto/trace" command takes at most 3 arguments
4208ovs-appctl: ovs-vswitchd: server returned an error
4209])
4210
4211# Test incorrect command: ofproto/trace with 0 argument
4212AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
4213AT_CHECK([tail -2 stderr], [0], [dnl
4214"ofproto/trace" command requires at least 1 arguments
4215ovs-appctl: ovs-vswitchd: server returned an error
4216])
4217
4218OVS_VSWITCHD_STOP
4219AT_CLEANUP
4220
aee0979b
BP
4221AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
4222OVS_VSWITCHD_START
4223ADD_OF_PORTS([br0], 1, 2, 3)
4224
4225AT_DATA([flows.txt], [dnl
4226in_port=1 actions=output:2
4227in_port=2 actions=output:1
4228])
4229AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4230
4231AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
4232AT_CHECK([tail -1 stdout], [0], [dnl
4233Datapath actions: push_vlan(vid=123,pcp=0),2
4234])
4235
4236OVS_VSWITCHD_STOP
4237AT_CLEANUP
4238
4239
b44a10b7
BP
4240m4_define([OFPROTO_TRACE],
4241 [flow="$2"
4242 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
4243 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4244 expected="$4"
4245 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
4246 [0], [stdout])
4247 mv stdout expout
4248 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
4249 [0], [expout])])
4250
4251AT_SETUP([ofproto-dpif - MAC learning])
432fca23
BP
4252OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4253ADD_OF_PORTS([br0], 1, 2, 3)
b44a10b7 4254
b44a10b7
BP
4255arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
4256
4257# Trace an ARP packet arriving on p3, to create a MAC learning entry.
4258OFPROTO_TRACE(
50aa28fd 4259 [ovs-dummy],
247527db 4260 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4261 [-generate],
e44768b7 4262 [1,2,100])
b44a10b7
BP
4263
4264# Check for the MAC learning entry.
83664f72 4265AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4266 port VLAN MAC Age
247527db 4267 3 0 50:54:00:00:00:05 ?
b44a10b7
BP
4268])
4269
4270# Trace a packet arrival destined for the learned MAC.
4271# (This will also learn a MAC.)
4272OFPROTO_TRACE(
50aa28fd 4273 [ovs-dummy],
247527db 4274 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
b44a10b7 4275 [-generate],
247527db 4276 [3])
b44a10b7
BP
4277
4278# Check for both MAC learning entries.
83664f72 4279AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4280 port VLAN MAC Age
247527db
BP
4281 3 0 50:54:00:00:00:05 ?
4282 1 0 50:54:00:00:00:06 ?
b44a10b7
BP
4283])
4284
4285# Trace a packet arrival that updates the first learned MAC entry.
4286OFPROTO_TRACE(
50aa28fd 4287 [ovs-dummy],
247527db 4288 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4289 [-generate],
e44768b7 4290 [1,3,100])
b44a10b7
BP
4291
4292# Check that the MAC learning entry was updated.
83664f72 4293AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4294 port VLAN MAC Age
247527db
BP
4295 1 0 50:54:00:00:00:06 ?
4296 2 0 50:54:00:00:00:05 ?
b44a10b7
BP
4297])
4298
4299# Add another bridge.
4300AT_CHECK(
4301 [ovs-vsctl \
4302 -- add-br br1 \
ad28062f
BP
4303 -- set bridge br1 datapath-type=dummy])
4304ADD_OF_PORTS([br1], 4, 5)
b44a10b7
BP
4305
4306# Trace some packet arrivals in br1 to create MAC learning entries there too.
4307OFPROTO_TRACE(
50aa28fd 4308 [ovs-dummy],
247527db 4309 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4310 [-generate],
e44768b7 4311 [5,101])
b44a10b7 4312OFPROTO_TRACE(
50aa28fd 4313 [ovs-dummy],
247527db 4314 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4315 [-generate],
e44768b7 4316 [4,101])
b44a10b7
BP
4317
4318# Check that the MAC learning entries were added.
83664f72 4319AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4320 port VLAN MAC Age
247527db
BP
4321 4 0 50:54:00:00:00:06 ?
4322 5 0 50:54:00:00:00:07 ?
b44a10b7
BP
4323])
4324
4325# Delete port p1 and see that its MAC learning entry disappeared, and
4326# that the MAC learning entry for the same MAC was also deleted from br1.
4327AT_CHECK([ovs-vsctl del-port p1])
83664f72 4328AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4329 port VLAN MAC Age
247527db 4330 2 0 50:54:00:00:00:05 ?
b44a10b7 4331])
83664f72 4332AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4333 port VLAN MAC Age
247527db 4334 5 0 50:54:00:00:00:07 ?
b44a10b7
BP
4335])
4336
4337OVS_VSWITCHD_STOP
4338AT_CLEANUP
17f7f7e0 4339
c4069512
BP
4340AT_SETUP([ofproto-dpif - MAC table overflow])
4341OVS_VSWITCHD_START(
ad28062f
BP
4342 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
4343ADD_OF_PORTS([br0], 1, 2, 3)
c4069512
BP
4344
4345arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
4346
4347AT_CHECK([ovs-appctl time/stop])
4348
4349# Trace 10 ARP packets arriving on p3, to create MAC learning entries.
4350for i in 0 1 2 3 4 5 6 7 8 9; do
4351 OFPROTO_TRACE(
50aa28fd 4352 [ovs-dummy],
c4069512
BP
4353 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
4354 [-generate],
4355 [1,2,100])
4356 ovs-appctl time/warp 1000
4357done
4358
4359# Check for the MAC learning entries.
4360AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4361 [0], [dnl
4362 3 0 50:54:00:00:00:00
4363 3 0 50:54:00:00:00:01
4364 3 0 50:54:00:00:00:02
4365 3 0 50:54:00:00:00:03
4366 3 0 50:54:00:00:00:04
4367 3 0 50:54:00:00:00:05
4368 3 0 50:54:00:00:00:06
4369 3 0 50:54:00:00:00:07
4370 3 0 50:54:00:00:00:08
4371 3 0 50:54:00:00:00:09
4372 port VLAN MAC Age
4373])
4374
4375# Trace another ARP packet on another MAC.
4376OFPROTO_TRACE(
50aa28fd 4377 [ovs-dummy],
c4069512
BP
4378 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
4379 [-generate],
4380 [1,2,100])
4381
4382# Check that the new one chased the oldest one out of the table.
4383AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
4384 [0], [dnl
4385 3 0 50:54:00:00:00:01 ?
4386 3 0 50:54:00:00:00:02 ?
4387 3 0 50:54:00:00:00:03 ?
4388 3 0 50:54:00:00:00:04 ?
4389 3 0 50:54:00:00:00:05 ?
4390 3 0 50:54:00:00:00:06 ?
4391 3 0 50:54:00:00:00:07 ?
4392 3 0 50:54:00:00:00:08 ?
4393 3 0 50:54:00:00:00:09 ?
4394 3 0 50:54:00:00:00:10 ?
4395 port VLAN MAC Age
4396])
4397OVS_VSWITCHD_STOP
4398AT_CLEANUP
4399
e731d71b
AS
4400# CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS)
4401#
4402# Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
4403#
4404# IP_VERSION_TYPE is used in AT_SETUP
4405m4_define([CHECK_SFLOW_SAMPLING_PACKET],
4406 [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector])
0af89118 4407 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
e731d71b
AS
4408 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4409
4410 ON_EXIT([kill `cat test-sflow.pid`])
eadd1644 4411 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
e731d71b 4412 AT_CAPTURE_FILE([sflow.log])
b52ecd96 4413 SFLOW_PORT=`parse_listening_port < test-sflow.log`
e731d71b
AS
4414 ovs-appctl time/stop
4415
4416 ADD_OF_PORTS([br0], 1, 2)
4417 ovs-vsctl \
4418 set Interface br0 options:ifindex=1002 -- \
4419 set Interface p1 options:ifindex=1004 -- \
4420 set Interface p2 options:ifindex=1003 -- \
4421 set Bridge br0 sflow=@sf -- \
4422 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
9a9808d7 4423 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
e731d71b
AS
4424
4425 dnl open with ARP packets to seed the bridge-learning. The output
4426 dnl ifIndex numbers should be reported predictably after that.
4427 dnl Since we set sampling=1 we should see all of these packets
4428 dnl reported. Sorting the output by data-source and seqNo makes
4429 dnl it deterministic. Ensuring that we send at least two packets
4430 dnl into each port means we get to check the seq nos are
4431 dnl incrementing correctly.
4432 dnl because packets from different ports can be handled by separate
4433 dnl threads, put some sleeps
4434
4435 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.2,tip=192.168.0.1,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
4436 sleep 1
4437 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:07,tha=00:00:00:00:00:00)'
4438 sleep 1
4439 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
4440 sleep 1
4441 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'
4442 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=fe80::1,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'
4443
4444 dnl sleep long enough to get more than one counter sample
4445 dnl from each datasource so we can check sequence numbers
bdba1947 4446 ovs-appctl time/warp 3000 100
e731d71b
AS
4447 OVS_VSWITCHD_STOP
4448 ovs-appctl -t test-sflow exit
8073dd31 4449
e731d71b 4450 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
8073dd31
NM
4451 /g']], [0], [dnl
4452HEADER
4453 dgramSeqNo=1
743cea45 4454 ds=127.0.0.1>2:1000
8073dd31
NM
4455 fsSeqNo=1
4456 in_vlan=0
4457 in_priority=0
4458 out_vlan=0
4459 out_priority=0
4460 meanSkip=1
4461 samplePool=1
4462 dropEvents=0
743cea45 4463 in_ifindex=1004
8073dd31
NM
4464 in_format=0
4465 out_ifindex=2
4466 out_format=2
4467 hdr_prot=1
4468 pkt_len=64
4469 stripped=4
4470 hdr_len=60
743cea45 4471 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-05-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-05-C0-A8-00-02-00-00-00-00-00-00-C0-A8-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
8073dd31
NM
4472HEADER
4473 dgramSeqNo=1
743cea45 4474 ds=127.0.0.1>2:1000
8073dd31
NM
4475 fsSeqNo=2
4476 in_vlan=0
4477 in_priority=0
4478 out_vlan=0
4479 out_priority=0
4480 meanSkip=1
4481 samplePool=2
4482 dropEvents=0
4483 in_ifindex=1003
4484 in_format=0
743cea45
NM
4485 out_ifindex=2
4486 out_format=2
8073dd31
NM
4487 hdr_prot=1
4488 pkt_len=64
4489 stripped=4
4490 hdr_len=60
743cea45 4491 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-07-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-07-C0-A8-00-01-00-00-00-00-00-00-C0-A8-00-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
8073dd31
NM
4492HEADER
4493 dgramSeqNo=1
743cea45 4494 ds=127.0.0.1>2:1000
8073dd31
NM
4495 fsSeqNo=3
4496 in_vlan=0
4497 in_priority=0
4498 out_vlan=0
4499 out_priority=0
4500 meanSkip=1
4501 samplePool=3
4502 dropEvents=0
743cea45 4503 in_ifindex=1004
8073dd31 4504 in_format=0
743cea45 4505 out_ifindex=1003
8073dd31
NM
4506 out_format=0
4507 hdr_prot=1
4508 pkt_len=64
4509 stripped=4
4510 hdr_len=60
743cea45 4511 hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-01-C0-A8-00-02-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
8073dd31
NM
4512HEADER
4513 dgramSeqNo=1
743cea45
NM
4514 ds=127.0.0.1>2:1000
4515 fsSeqNo=4
8073dd31
NM
4516 in_vlan=0
4517 in_priority=0
4518 out_vlan=0
4519 out_priority=0
4520 meanSkip=1
743cea45 4521 samplePool=4
8073dd31 4522 dropEvents=0
743cea45 4523 in_ifindex=1003
8073dd31 4524 in_format=0
743cea45
NM
4525 out_ifindex=1004
4526 out_format=0
8073dd31
NM
4527 hdr_prot=1
4528 pkt_len=64
4529 stripped=4
4530 hdr_len=60
743cea45 4531 hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-02-C0-A8-00-01-00-00-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
8073dd31
NM
4532HEADER
4533 dgramSeqNo=1
743cea45
NM
4534 ds=127.0.0.1>2:1000
4535 fsSeqNo=5
8073dd31
NM
4536 in_vlan=0
4537 in_priority=0
4538 out_vlan=0
4539 out_priority=0
4540 meanSkip=1
743cea45 4541 samplePool=5
8073dd31 4542 dropEvents=0
743cea45 4543 in_ifindex=1003
8073dd31 4544 in_format=0
743cea45 4545 out_ifindex=1004
8073dd31
NM
4546 out_format=0
4547 hdr_prot=1
4548 pkt_len=64
4549 stripped=4
4550 hdr_len=60
52105b67 4551 hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-67-00-00-00-00-00-0A-80-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-01-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-02-00-00-00-00-00-00
8073dd31
NM
4552])
4553
50b9699f 4554 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -18 | sed 's/ /\
8073dd31
NM
4555 /g']], [0], [dnl
4556IFCOUNTERS
4557 dgramSeqNo=2
4558 ds=127.0.0.1>0:1002
4559 csSeqNo=1
4560 ifindex=1002
4561 type=6
4562 ifspeed=100000000
4563 direction=0
1839c356 4564 status=0
8073dd31
NM
4565 in_octets=0
4566 in_unicasts=0
4567 in_multicasts=0
4568 in_broadcasts=4294967295
4569 in_discards=0
4570 in_errors=0
4571 in_unknownprotos=4294967295
4572 out_octets=120
4573 out_unicasts=2
4574 out_multicasts=4294967295
4575 out_broadcasts=4294967295
4576 out_discards=0
4577 out_errors=0
4578 promiscuous=0
4579IFCOUNTERS
4580 dgramSeqNo=2
4581 ds=127.0.0.1>0:1003
4582 csSeqNo=1
4583 ifindex=1003
4584 type=6
4585 ifspeed=100000000
4586 direction=0
4587 status=0
52105b67 4588 in_octets=138
8073dd31
NM
4589 in_unicasts=3
4590 in_multicasts=0
4591 in_broadcasts=4294967295
4592 in_discards=0
4593 in_errors=0
4594 in_unknownprotos=4294967295
4595 out_octets=120
4596 out_unicasts=2
4597 out_multicasts=4294967295
4598 out_broadcasts=4294967295
4599 out_discards=0
4600 out_errors=0
4601 promiscuous=0
4602IFCOUNTERS
4603 dgramSeqNo=2
4604 ds=127.0.0.1>0:1004
4605 csSeqNo=1
4606 ifindex=1004
4607 type=6
4608 ifspeed=100000000
4609 direction=0
4610 status=0
4611 in_octets=84
4612 in_unicasts=2
4613 in_multicasts=0
4614 in_broadcasts=4294967295
4615 in_discards=0
4616 in_errors=0
4617 in_unknownprotos=4294967295
4618 out_octets=180
4619 out_unicasts=3
4620 out_multicasts=4294967295
4621 out_broadcasts=4294967295
4622 out_discards=0
4623 out_errors=0
4624 promiscuous=0
4625IFCOUNTERS
4626 dgramSeqNo=3
4627 ds=127.0.0.1>0:1002
4628 csSeqNo=2
4629 ifindex=1002
4630 type=6
4631 ifspeed=100000000
4632 direction=0
1839c356 4633 status=0
8073dd31
NM
4634 in_octets=0
4635 in_unicasts=0
4636 in_multicasts=0
4637 in_broadcasts=4294967295
4638 in_discards=0
4639 in_errors=0
4640 in_unknownprotos=4294967295
4641 out_octets=120
4642 out_unicasts=2
4643 out_multicasts=4294967295
4644 out_broadcasts=4294967295
4645 out_discards=0
4646 out_errors=0
4647 promiscuous=0
4648IFCOUNTERS
4649 dgramSeqNo=3
4650 ds=127.0.0.1>0:1003
4651 csSeqNo=2
4652 ifindex=1003
4653 type=6
4654 ifspeed=100000000
4655 direction=0
4656 status=0
52105b67 4657 in_octets=138
8073dd31
NM
4658 in_unicasts=3
4659 in_multicasts=0
4660 in_broadcasts=4294967295
4661 in_discards=0
4662 in_errors=0
4663 in_unknownprotos=4294967295
4664 out_octets=120
4665 out_unicasts=2
4666 out_multicasts=4294967295
4667 out_broadcasts=4294967295
4668 out_discards=0
4669 out_errors=0
4670 promiscuous=0
4671IFCOUNTERS
4672 dgramSeqNo=3
4673 ds=127.0.0.1>0:1004
4674 csSeqNo=2
4675 ifindex=1004
4676 type=6
4677 ifspeed=100000000
4678 direction=0
4679 status=0
4680 in_octets=84
4681 in_unicasts=2
4682 in_multicasts=0
4683 in_broadcasts=4294967295
4684 in_discards=0
4685 in_errors=0
4686 in_unknownprotos=4294967295
4687 out_octets=180
4688 out_unicasts=3
4689 out_multicasts=4294967295
4690 out_broadcasts=4294967295
4691 out_discards=0
4692 out_errors=0
4693 promiscuous=0
50b9699f
NM
4694OPENFLOWPORT
4695 datapath_id=18364758544493064720
4696 port_no=1
4697OPENFLOWPORT
4698 datapath_id=18364758544493064720
4699 port_no=1
4700OPENFLOWPORT
4701 datapath_id=18364758544493064720
4702 port_no=2
4703OPENFLOWPORT
4704 datapath_id=18364758544493064720
4705 port_no=2
4706OPENFLOWPORT
4707 datapath_id=18364758544493064720
4708 port_no=65534
4709OPENFLOWPORT
4710 datapath_id=18364758544493064720
4711 port_no=65534
4712PORTNAME
4713 portName=br0
4714PORTNAME
4715 portName=br0
4716PORTNAME
4717 portName=p1
4718PORTNAME
4719 portName=p1
4720PORTNAME
4721 portName=p2
4722PORTNAME
4723 portName=p2
8073dd31 4724])
e731d71b 4725 AT_CLEANUP])
17f7f7e0 4726
e731d71b
AS
4727CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4])
4728CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6])
1e04fcc8 4729
50b9699f
NM
4730dnl Test sFlow LAG structures
4731AT_SETUP([ofproto-dpif - sFlow LACP structures])
80ee73d3 4732AT_SKIP_IF([test "$IS_WIN32" = "yes"])
50b9699f
NM
4733OVS_VSWITCHD_START([dnl
4734 add-bond br0 bond p1 p2 -- \
4735 set Port bond lacp=active bond-mode=active-backup \
4736 other_config:lacp-time="fast" \
4737 other_config:lacp-system-id=11:22:33:44:55:66 \
4738 other_config:lacp-system-priority=54321 -- \
4739 set Interface p1 type=dummy \
4740 other_config:lacp-port-id=11 \
4741 other_config:lacp-port-priority=111 \
4742 other_config:lacp-aggregation-key=3333 -- \
4743 set Interface p2 type=dummy \
4744 other_config:lacp-port-id=22 \
4745 other_config:lacp-port-priority=222 \
4746 other_config:lacp-aggregation-key=3333 ])
4747
4748ON_EXIT([kill `cat test-sflow.pid`])
4749AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
4750AT_CAPTURE_FILE([sflow.log])
4751SFLOW_PORT=`parse_listening_port < test-sflow.log`
4752
4753ovs-appctl time/stop
4754
4755ovs-vsctl \
4756 set Interface p1 options:ifindex=1003 -- \
4757 set Bridge br0 sflow=@sf -- \
4758 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
4759 header=128 sampling=1 polling=1
4760
4761dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
cea4a6d7
JS
4762AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
4763AT_CHECK([ovs-appctl revalidator/purge], [0])
50b9699f
NM
4764OVS_VSWITCHD_STOP
4765ovs-appctl -t test-sflow exit
4766AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
4767 /g']], [0], [dnl
4768LACPCOUNTERS
4769 sysID=11:22:33:44:55:66
4770 partnerID=00:00:00:00:00:00
4771 aggID=3333
4772 actorAdmin=0x7
4773 actorOper=0xbf
4774 partnerAdmin=0x0
4775 partnerOper=0x2
4776 LACPUDsRx=0
4777 markerPDUsRx=4294967295
4778 markerRespPDUsRx=4294967295
4779 unknownRx=4294967295
4780 illegalRx=0
4781 LACPUDsTx=1
4782 markerPDUsTx=4294967295
4783 markerRespPDUsTx=4294967295
4784])
4785
4786AT_CLEANUP
4787
e731d71b
AS
4788# CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
4789#
4790# Test that basic NetFlow reports flow statistics correctly:
4791# The initial packet of a flow are correctly accounted.
4792# Later packets within a flow are correctly accounted.
4793# Flow actions changing (in this case, due to MAC learning)
4794# cause a record to be sent.
4795#
4796# IP_VERSION_TYPE is used in AT_SETUP
4797m4_define([CHECK_NETFLOW_EXPIRATION],
4798 [AT_SETUP([ofproto-dpif - NetFlow flow expiration - $2 collector])
4799 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4800 ADD_OF_PORTS([br0], 1, 2)
4801
4802 ovs-appctl time/stop
4803 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 4804 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 4805 AT_CAPTURE_FILE([netflow.log])
b52ecd96 4806 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
e731d71b
AS
4807
4808 ovs-vsctl \
4809 set Bridge br0 netflow=@nf -- \
4810 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4811 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
4812
4813 for delay in 1000 30000; do
4814 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
5788e39f 4815 sleep 1 # ensure the order in which these two packets are processed
e731d71b
AS
4816 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'
4817
4818 ovs-appctl time/warp $delay
4819 done
17f7f7e0 4820
e731d71b 4821 ovs-appctl time/warp 6000
27f57736 4822 ovs-appctl revalidator/wait
e731d71b
AS
4823 OVS_VSWITCHD_STOP
4824 ovs-appctl -t test-netflow exit
e79a6c83 4825
e731d71b 4826 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
e79a6c83 4827
e731d71b 4828 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
e79a6c83 4829
e731d71b
AS
4830 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
4831 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
4832 AT_CHECK([test $separate = 2 || test $combined = 1], [0])
17f7f7e0 4833
e731d71b 4834 AT_CLEANUP])
17f7f7e0 4835
e731d71b
AS
4836CHECK_NETFLOW_EXPIRATION([127.0.0.1], [IPv4])
4837CHECK_NETFLOW_EXPIRATION([[[::1]]], [IPv6])
1e04fcc8 4838
e731d71b
AS
4839# CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
4840#
4841# Test that basic NetFlow reports active expirations correctly.
4842#
4843# IP_VERSION_TYPE is used in AT_SETUP
4844m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
4845 [AT_SETUP([ofproto-dpif - NetFlow active expiration - $2 collector])
1e04fcc8 4846
e731d71b
AS
4847 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4848 ADD_OF_PORTS([br0], 1, 2)
17f7f7e0 4849
e731d71b 4850 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 4851 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 4852 AT_CAPTURE_FILE([netflow.log])
b52ecd96 4853 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
17f7f7e0 4854
e731d71b
AS
4855 ovs-vsctl \
4856 set Bridge br0 netflow=@nf -- \
4857 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4858 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
17f7f7e0 4859
e731d71b
AS
4860 AT_CHECK([ovs-appctl time/stop])
4861 n=1
4862 while test $n -le 60; do
4863 n=`expr $n + 1`
17f7f7e0 4864
e731d71b
AS
4865 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=1234,dst=80)'
4866 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)'
17f7f7e0 4867
e731d71b
AS
4868 ovs-appctl time/warp 1000
4869 done
17f7f7e0 4870
e731d71b
AS
4871 ovs-appctl time/warp 10000
4872
27f57736 4873 ovs-appctl revalidator/wait
e731d71b
AS
4874 OVS_VSWITCHD_STOP
4875 ovs-appctl -t test-netflow exit
4876
4877 # Count the number of reported packets:
4878 # - From source to destination before MAC learning kicks in (just one).
4879 # - From source to destination after that.
4880 # - From destination to source.
4881 n_learn=0
4882 n_in=0
4883 n_out=0
4884 n_other=0
4885 n_recs=0
4886 none=0
4887 while read line; do
4888 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
4889 case $pkts in
4890 [[0-9]]*) ;;
4891 *) continue ;;
4892 esac
4893
4894 case $line in
4895 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
4896 counter=n_learn
4897 ;;
4898 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
4899 counter=n_in
4900 ;;
4901 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
4902 counter=n_out
4903 ;;
4904 *)
4905 counter=n_other
4906 ;;
4907 esac
4908 eval $counter=\`expr \$$counter + \$pkts\`
4909 n_recs=`expr $n_recs + 1`
4910 done < netflow.log
4911
4912 # There should be exactly 1 MAC learning packet,
4913 # exactly 59 other packets in that direction,
4914 # and exactly 60 packets in the other direction.
4915 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
4916])
4917
4918 AT_CLEANUP])
4919
4920CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1], [IPv4])
4921CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]], [IPv6])
f27f2134 4922
23a7d252
JS
4923AT_SETUP([ofproto-dpif - flow stats])
4924OVS_VSWITCHD_START
4925AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
4926AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
4927
4928ovs-appctl time/stop
4929
4930for i in `seq 1 10`; do
4931 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
4932done
4933
cea4a6d7
JS
4934AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
4935AT_CHECK([ovs-appctl revalidator/purge], [0])
e96a5c24 4936AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
11f9de00 4937AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
e96a5c24 4938 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
11f9de00 4939 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
e96a5c24
JS
4940])
4941OVS_VSWITCHD_STOP
4942AT_CLEANUP
4943
4944AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
4945OVS_VSWITCHD_START
4946AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
4947AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
4948
4949ovs-appctl time/stop
4950
4951for i in `seq 1 10`; do
4952 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
4953done
4954
4955ovs-appctl time/warp 100
4956AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
4957ovs-appctl time/warp 1000
4958
23a7d252 4959AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
11f9de00 4960AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
23a7d252 4961 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
11f9de00 4962 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
23a7d252
JS
4963])
4964OVS_VSWITCHD_STOP
4965AT_CLEANUP
4966
f27f2134
BP
4967AT_SETUP([idle_age and hard_age increase over time])
4968OVS_VSWITCHD_START
4969
4970# get_ages DURATION HARD IDLE
4971#
4972# Fetch the flow duration, hard age, and idle age into the variables
4973# whose names are given as arguments. Rounds DURATION down to the
4974# nearest integer. If hard_age doesn't appear in the output, sets
4975# HARD to "none". If idle_age doesn't appear in the output, sets IDLE
4976# to 0.
4977get_ages () {
4978 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
4979
4980 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
4981 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
4982 AS_VAR_COPY([$1], [duration])
4983
4984 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
4985 if test X"$hard" = X; then
4986 hard=none
4987 else
4988 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
4989 fi
4990 AS_VAR_COPY([$2], [hard])
4991
4992 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
4993 if test X"$idle" = X; then
4994 idle=0
4995 else
4996 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
4997 fi
4998 AS_VAR_COPY([$3], [idle])
4999}
5000
5001# Add a flow and get its initial hard and idle age.
5002AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
5003get_ages duration1 hard1 idle1
5004
31ef9f51 5005ovs-appctl time/stop
f27f2134
BP
5006# Warp time forward by 10 seconds, then modify the flow's actions.
5007ovs-appctl time/warp 10000
5008get_ages duration2 hard2 idle2
5009AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
5010
5011# Warp time forward by 10 seconds.
5012ovs-appctl time/warp 10000
5013get_ages duration3 hard3 idle3
5014
5015# Warp time forward 10 more seconds, then pass some packets through the flow,
5016# then warp forward a few more times because idle times are only updated
5017# occasionally.
5018ovs-appctl time/warp 10000
5019ovs-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 5020ovs-appctl time/warp 3000 1000
c0526804 5021sleep 1
f27f2134
BP
5022get_ages duration4 hard4 idle4
5023
5024printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
5025printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
5026printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
5027
5028# Duration should increase steadily over time.
5029AT_CHECK([test $duration1 -lt $duration2])
5030AT_CHECK([test $duration2 -lt $duration3])
5031AT_CHECK([test $duration3 -lt $duration4])
5032
5033# Hard age should be "none" initially because it's the same as flow_duration,
5034# then it should increase.
5035AT_CHECK([test $hard1 = none])
5036AT_CHECK([test $hard2 = none])
5037AT_CHECK([test $hard3 != none])
5038AT_CHECK([test $hard4 != none])
5039AT_CHECK([test $hard3 -lt $hard4])
5040
5041# Idle age should increase from 1 to 2 to 3, then decrease.
5042AT_CHECK([test $idle1 -lt $idle2])
5043AT_CHECK([test $idle2 -lt $idle3])
5044AT_CHECK([test $idle3 -gt $idle4])
5045
5046# Check some invariant relationships.
5047AT_CHECK([test $duration1 = $idle1])
5048AT_CHECK([test $duration2 = $idle2])
5049AT_CHECK([test $duration3 = $idle3])
5050AT_CHECK([test $idle3 -gt $hard3])
5051AT_CHECK([test $idle4 -lt $hard4])
5052AT_CHECK([test $hard4 -lt $duration4])
5053
5054OVS_VSWITCHD_STOP
5055AT_CLEANUP
0e553d9c
BP
5056
5057AT_SETUP([ofproto-dpif - fin_timeout])
5058OVS_VSWITCHD_START
b5c1a5df 5059ovs-appctl time/stop
0e553d9c
BP
5060AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
5061AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5062[NXST_FLOW reply:
5063 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5064])
31ef9f51 5065
0e553d9c
BP
5066# Check that a TCP SYN packet does not change the timeout. (Because
5067# flow stats updates are mainly what implements the fin_timeout
5068# feature, we warp forward a couple of times to ensure that flow stats
5069# run before re-checking the flow table.)
323cc924 5070AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
0e553d9c
BP
5071AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5072warped
5073])
cea4a6d7 5074AT_CHECK([ovs-appctl revalidator/purge], [0])
0e553d9c
BP
5075AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5076[NXST_FLOW reply:
5077 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5078])
5079# Check that a TCP FIN packet does change the timeout.
323cc924 5080AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
0e553d9c
BP
5081AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5082warped
5083])
5084AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5085[NXST_FLOW reply:
5086 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
5087])
5088OVS_VSWITCHD_STOP
5089AT_CLEANUP
27022416
JP
5090
5091AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
5092OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5093ADD_OF_PORTS([br0], [1], [2])
5094ADD_OF_PORTS([br1], [3])
5095
5096AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
5097dummy@br0
5098dummy@br1
5099])
5100OVS_VSWITCHD_STOP
5101AT_CLEANUP
5102
5103AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
5104OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5105ADD_OF_PORTS([br0], [1], [2])
5106ADD_OF_PORTS([br1], [3])
5107
5108AT_CHECK([ovs-appctl dpif/show], [0], [dnl
dc54ef36 5109dummy@ovs-dummy: hit:0 missed:0
e79a6c83 5110 br0:
dc54ef36
EJ
5111 br0 65534/100: (dummy)
5112 p1 1/1: (dummy)
5113 p2 2/2: (dummy)
e79a6c83 5114 br1:
dc54ef36
EJ
5115 br1 65534/101: (dummy)
5116 p3 3/3: (dummy)
27022416
JP
5117])
5118OVS_VSWITCHD_STOP
5119AT_CLEANUP
5120
5121AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
054e5aa6 5122# bump max-idle to avoid the flows being reclaimed behind us
27022416 5123OVS_VSWITCHD_START([add-br br1 -- \
054e5aa6
YT
5124 set bridge br1 datapath-type=dummy fail-mode=secure -- \
5125 set Open_vSwitch . other_config:max-idle=10000])
27022416
JP
5126ADD_OF_PORTS([br0], [1], [2])
5127ADD_OF_PORTS([br1], [3])
5128
323cc924
BP
5129AT_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)'])
5130AT_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)'])
5131AT_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 5132ovs-appctl revalidator/wait
70e5ed6f 5133AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd
DDP
5134recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5135recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
27022416
JP
5136])
5137
70e5ed6f 5138AT_CHECK([ovs-appctl dpif/dump-flows br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd 5139recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
27022416
JP
5140])
5141
70e5ed6f 5142AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd
DDP
5143skb_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
5144skb_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
5145])
5146
70e5ed6f 5147AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd 5148skb_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
818650e6
JS
5149])
5150
5151OVS_VSWITCHD_STOP
5152AT_CLEANUP
5153
5154AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow])
5155
5156OVS_VSWITCHD_START([add-br br1 -- \
5157 set bridge br1 datapath-type=dummy fail-mode=secure -- \
5158 set Open_vSwitch . other_config:max-idle=10000])
5159ADD_OF_PORTS([br0], [1], [2])
5160
5161AT_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)'])
5162ovs-appctl revalidator/wait
5163AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
5164
5165UFID=`sed -n 's/\(ufid:[[0-9a-fA-F]]*\).*/\1/p' stdout`
5166AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
5167recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
04b541df
GS
5168])
5169
27022416
JP
5170OVS_VSWITCHD_STOP
5171AT_CLEANUP
5172
50c1efc9 5173AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
8bfd0fda
BP
5174OVS_VSWITCHD_START([dnl
5175 add-port br0 p1 -- set Interface p1 type=dummy
5176])
623540e4 5177AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8bfd0fda
BP
5178ON_EXIT([kill `cat ovs-ofctl.pid`])
5179
5180AT_CAPTURE_FILE([ofctl_monitor.log])
5181AT_DATA([flows.txt], [dnl
5182dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5183dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5184])
5185AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5186
5187dnl Packet is sent to userspace because a MPLS push or pop action is applied to
47fb7f71 5188dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
8bfd0fda 5189dnl
47fb7f71 5190dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
8bfd0fda 5191dnl 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
5192dnl (label 20, exp 0, [S], ttl 32)
5193dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5194dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
5195
5196for dl_src in 00 01; do
47fb7f71 5197 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
5198done
5199sleep 1 # wait for the datapath flow installed
70e5ed6f 5200AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
22d38fca
JR
5201recirc_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))
5202recirc_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 5203])
8bfd0fda
BP
5204
5205OVS_VSWITCHD_STOP
5206AT_CLEANUP
5207
5208
50c1efc9 5209AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
8bfd0fda
BP
5210OVS_VSWITCHD_START([dnl
5211 add-port br0 p1 -- set Interface p1 type=dummy
5212])
623540e4 5213AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8bfd0fda
BP
5214ON_EXIT([kill `cat ovs-ofctl.pid`])
5215
5216AT_CAPTURE_FILE([ofctl_monitor.log])
5217AT_DATA([flows.txt], [dnl
5218dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5219dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5220])
5221AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5222
5223dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
5224dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
47fb7f71 5225dnl can't determine the resulting MPLS label after MPLS push/pop actions.
8bfd0fda
BP
5226dnl
5227dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
5228dnl 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)
5229dnl (label 20, exp 0, ttl 32)
5230dnl (label 20, exp 0, ttl 32)
5231dnl (label 20, exp 0, [S], ttl 32)
5232dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5233dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
8bfd0fda 5234
47fb7f71
JS
5235for dl_src in 00 01; do
5236 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
5237done
5238sleep 1 # wait for the datapath flow installed
70e5ed6f 5239AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
22d38fca
JR
5240recirc_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))
5241recirc_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
5242])
5243
5244OVS_VSWITCHD_STOP
5245AT_CLEANUP
5246
0a740f48
EJ
5247AT_SETUP([ofproto-dpif - patch ports])
5248OVS_VSWITCHD_START([add-br br1 \
5249-- set bridge br1 datapath-type=dummy fail-mode=secure \
5250-- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
5251-- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5252
5253ADD_OF_PORTS([br0], [2])
5254ADD_OF_PORTS([br1], [3])
5255
64bb477f
JS
5256AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5257], [])
aef0491b 5258AT_CHECK([ovs-appctl time/stop])
623540e4 5259AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9fc0165a 5260
0a740f48
EJ
5261AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
5262AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
5263
5264for i in $(seq 1 10); do
5265 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
5266 if [[ $i -eq 1 ]]; then
5267 sleep 1
5268 fi
0a740f48
EJ
5269done
5270
5271for i in $(seq 1 5); do
5272 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
5273 if [[ $i -eq 1 ]]; then
5274 sleep 1
5275 fi
0a740f48
EJ
5276done
5277
0a8763fc
EJ
5278AT_CHECK([ovs-appctl time/warp 500], [0],
5279[warped
735d7efb 5280])
732207ad 5281sleep 1 # wait for log writer
735d7efb 5282
0a740f48 5283AT_CHECK([ovs-appctl dpif/show], [0], [dnl
dc54ef36 5284dummy@ovs-dummy: hit:13 missed:2
e79a6c83 5285 br0:
dc54ef36
EJ
5286 br0 65534/100: (dummy)
5287 p2 2/2: (dummy)
5288 pbr0 1/none: (patch: peer=pbr1)
e79a6c83 5289 br1:
dc54ef36
EJ
5290 br1 65534/101: (dummy)
5291 p3 3/3: (dummy)
5292 pbr1 1/none: (patch: peer=pbr0)
0a740f48
EJ
5293])
5294
70e5ed6f 5295AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
16194afd
DDP
5296recirc_id=0,ip,in_port=100,nw_frag=no, actions:101,3,2
5297recirc_id=0,ip,in_port=101,nw_frag=no, actions:100,2,3
c2a77f33
JS
5298])
5299
70e5ed6f 5300AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
16194afd 5301skb_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 5302])
70e5ed6f 5303AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
16194afd 5304skb_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
5305])
5306
5307AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
5308OFPST_PORT reply (xid=0x4): 1 ports
5309 port 1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
5310 tx pkts=10, bytes=600, drop=0, errs=0, coll=0
5311])
5312
5313AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
5314OFPST_PORT reply (xid=0x4): 1 ports
5315 port 1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
5316 tx pkts=5, bytes=300, drop=0, errs=0, coll=0
5317])
5318
5319OVS_VSWITCHD_STOP
5320AT_CLEANUP
655ab909 5321
65e0be10
BP
5322AT_SETUP([ofproto-dpif - port duration])
5323OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
5324ADD_OF_PORTS([br0], 1, 2)
5325
31ef9f51 5326ovs-appctl time/stop
65e0be10
BP
5327ovs-appctl time/warp 10000
5328
5329AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
125bf01d 5330AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
65e0be10 5331[dnl
65e0be10 5332 duration=?s
65e0be10 5333 duration=?s
65e0be10
BP
5334 duration=?s
5335])
5336OVS_VSWITCHD_STOP
5337AT_CLEANUP
bcd2633a
JP
5338
5339dnl ----------------------------------------------------------------------
5340AT_BANNER([ofproto-dpif -- megaflows])
5341
bcd2633a
JP
5342AT_SETUP([ofproto-dpif megaflow - port classification])
5343OVS_VSWITCHD_START
623540e4 5344AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5345ADD_OF_PORTS([br0], [1], [2])
5346AT_DATA([flows.txt], [dnl
5347table=0 in_port=1 actions=output(2)
5348])
5349AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5350AT_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 5351sleep 1
bcd2633a 5352AT_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 5353sleep 1
c2a77f33 5354AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd 5355recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
bcd2633a
JP
5356])
5357OVS_VSWITCHD_STOP
5358AT_CLEANUP
5359
5360AT_SETUP([ofproto-dpif megaflow - L2 classification])
5361OVS_VSWITCHD_START
623540e4 5362AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5363ADD_OF_PORTS([br0], [1], [2])
5364AT_DATA([flows.txt], [dnl
5365table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
5366])
5367AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5368AT_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)'])
5369AT_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 5370sleep 1
c2a77f33 5371AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5372recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5373recirc_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
5374])
5375OVS_VSWITCHD_STOP
5376AT_CLEANUP
5377
5378AT_SETUP([ofproto-dpif megaflow - L3 classification])
5379OVS_VSWITCHD_START
623540e4 5380AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a 5381ADD_OF_PORTS([br0], [1], [2])
13751fd8 5382AT_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
5383AT_DATA([flows.txt], [dnl
5384table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
5385])
5386AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5387AT_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)'])
5388AT_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 5389sleep 1
c2a77f33 5390AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5391recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
5392recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
bcd2633a
JP
5393])
5394OVS_VSWITCHD_STOP
5395AT_CLEANUP
5396
13751fd8
JR
5397AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
5398OVS_VSWITCHD_START
623540e4 5399AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
13751fd8
JR
5400ADD_OF_PORTS([br0], [1], [2])
5401AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], [])
5402AT_DATA([flows.txt], [dnl
5403table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
5404])
5405AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5406AT_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)'])
5407AT_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 5408sleep 1
c2a77f33 5409AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5410recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:1:2:3:4:5,nw_frag=no, actions: <del>
5411recirc_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
5412])
5413OVS_VSWITCHD_STOP
5414AT_CLEANUP
5415
bcd2633a
JP
5416AT_SETUP([ofproto-dpif megaflow - L4 classification])
5417OVS_VSWITCHD_START
623540e4 5418AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5419ADD_OF_PORTS([br0], [1], [2])
5420AT_DATA([flows.txt], [dnl
5421table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
5422])
5423AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5424AT_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 5425sleep 1
bcd2633a 5426AT_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 5427sleep 1
c2a77f33 5428AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd 5429recirc_id=0,icmp,in_port=1,nw_frag=no,icmp_type=0x8/0xff, actions: <del>
bcd2633a
JP
5430])
5431OVS_VSWITCHD_STOP
5432AT_CLEANUP
5433
5434AT_SETUP([ofproto-dpif megaflow - normal])
5435OVS_VSWITCHD_START
623540e4 5436AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5437ADD_OF_PORTS([br0], [1], [2])
5438AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5439AT_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)'])
5440AT_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 5441sleep 1
c2a77f33 5442AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5443recirc_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>
5444recirc_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
5445])
5446OVS_VSWITCHD_STOP
5447AT_CLEANUP
5448
5449AT_SETUP([ofproto-dpif megaflow - mpls])
5450OVS_VSWITCHD_START
623540e4 5451AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5452ADD_OF_PORTS([br0], [1], [2])
5453AT_DATA([flows.txt], [dnl
5454table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
5455table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
5456])
5457AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5458AT_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)'])
5459AT_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 5460sleep 1
c2a77f33 5461AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
22d38fca
JR
5462recirc_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>
5463recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:0b,mpls_bos=1, actions: <del>
bcd2633a
JP
5464])
5465OVS_VSWITCHD_STOP
5466AT_CLEANUP
5467
e731d71b
AS
5468# CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR, IP_VERSION_TYPE)
5469#
5470# IP_VERSION_TYPE is used in AT_SETUP
5471m4_define([CHECK_MEGAFLOW_NETFLOW],
5472 [AT_SETUP([ofproto-dpif megaflow - netflow - $2 collector])
5473 OVS_VSWITCHD_START
623540e4 5474 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
e731d71b
AS
5475 ADD_OF_PORTS([br0], [1], [2])
5476
5477 dnl NetFlow configuration disables wildcarding relevant fields
5478 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 5479 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 5480 AT_CAPTURE_FILE([netflow.log])
b52ecd96 5481 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
e731d71b
AS
5482 ovs-vsctl \
5483 set Bridge br0 netflow=@nf -- \
5484 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5485 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
5486
5487 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5488 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)'])
5489 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)'])
5490 sleep 1
c2a77f33 5491 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5492recirc_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>
5493recirc_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 5494])
e731d71b
AS
5495 OVS_VSWITCHD_STOP
5496 AT_CLEANUP])
5497
5498CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
5499CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
bcd2633a
JP
5500
5501AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
5502OVS_VSWITCHD_START(
5503 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
5504 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
5505 set interface p2 type=dummy ofport_request=2 -- \
5506 set interface p3 type=dummy ofport_request=3])
5507AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5508])
623540e4 5509AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5510
5511AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5512AT_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)'])
5513AT_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 5514sleep 1
c2a77f33 5515AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5516recirc_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>
5517recirc_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
5518])
5519OVS_VSWITCHD_STOP
5520AT_CLEANUP
5521
5522AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
5523OVS_VSWITCHD_START(
5524 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
5525 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
5526 set interface p2 type=dummy ofport_request=2 -- \
5527 set interface p3 type=dummy ofport_request=3])
5528AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5529])
623540e4 5530AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5531
5532AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5533AT_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)'])
5534AT_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 5535sleep 1
c2a77f33 5536AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5537recirc_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>
5538recirc_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
5539])
5540OVS_VSWITCHD_STOP
5541AT_CLEANUP
5542
5543AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
5544# Create bond0 on br0 with interfaces p0 and p1
5545# and bond1 on br1 with interfaces p2 and p3
5546# with p0 patched to p2 and p1 patched to p3.
5547OVS_VSWITCHD_START(
5548 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
5549 other-config:lacp-time=fast \
5550 other-config:bond-rebalance-interval=0 -- \
5551 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
5552 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
5553 add-br br1 -- \
5554 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
5555 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
5556 fail-mode=secure -- \
5557 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
5558 other-config:lacp-time=fast \
5559 other-config:bond-rebalance-interval=0 -- \
5560 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
5561 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
5562
5563AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5564])
623540e4 5565AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5566ADD_OF_PORTS([br0], [7])
5567AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5568AT_CHECK([ovs-ofctl add-flow br1 action=normal])
31ef9f51 5569ovs-appctl time/stop
bcd2633a
JP
5570ovs-appctl time/warp 5000
5571AT_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)'])
5572AT_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 5573sleep 1
c2a77f33 5574AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5575recirc_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>
5576recirc_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
5577])
5578OVS_VSWITCHD_STOP
5579AT_CLEANUP
5580
5581AT_SETUP([ofproto-dpif megaflow - resubmit port action])
5582OVS_VSWITCHD_START
623540e4 5583AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5584ADD_OF_PORTS([br0], [1], [2])
5585AT_DATA([flows.txt], [dnl
5586table=0 in_port=1,ip actions=resubmit(90)
5587table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
5588])
5589AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5590AT_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)'])
5591AT_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 5592sleep 1
c2a77f33 5593AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5594recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5595recirc_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
5596])
5597OVS_VSWITCHD_STOP
5598AT_CLEANUP
5599
5600AT_SETUP([ofproto-dpif megaflow - resubmit table action])
5601OVS_VSWITCHD_START
623540e4 5602AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5603ADD_OF_PORTS([br0], [1], [2])
5604AT_DATA([flows.txt], [dnl
5605table=0 in_port=1,ip actions=resubmit(,1)
5606table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5607])
5608AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5609AT_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)'])
5610AT_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=
56111,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
ae692725 5612sleep 1
c2a77f33 5613AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5614recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5615recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
bcd2633a
JP
5616])
5617OVS_VSWITCHD_STOP
5618AT_CLEANUP
5619
5620AT_SETUP([ofproto-dpif megaflow - goto_table action])
5621OVS_VSWITCHD_START
623540e4 5622AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5623ADD_OF_PORTS([br0], [1], [2])
5624AT_DATA([flows.txt], [dnl
5625table=0 in_port=1,ip actions=goto_table(1)
5626table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5627])
5628AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
5629AT_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)'])
5630AT_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 5631sleep 1
c2a77f33 5632AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5633recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5634recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
bcd2633a
JP
5635])
5636OVS_VSWITCHD_STOP
5637AT_CLEANUP
5638
5639AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
5640OVS_VSWITCHD_START
623540e4 5641AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5642ADD_OF_PORTS([br0], [1], [2], [3])
5643ovs-vsctl \
5644 set Bridge br0 mirrors=@m --\
5645 --id=@p3 get Port p3 --\
5646 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
5647
5648AT_DATA([flows.txt], [dnl
5649in_port=1 actions=output:2
5650])
5651AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5652AT_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 5653sleep 1
bcd2633a 5654AT_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 5655sleep 1
c2a77f33 5656AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd 5657recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
bcd2633a
JP
5658])
5659OVS_VSWITCHD_STOP
5660AT_CLEANUP
5661
5662AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
5663OVS_VSWITCHD_START
623540e4 5664AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5665ADD_OF_PORTS([br0], [1], [2], [3])
5666ovs-vsctl \
5667 set Bridge br0 mirrors=@m --\
5668 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
5669 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
5670
5671AT_DATA([flows.txt], [dnl
5672in_port=1 actions=output:2
5673])
5674AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5675AT_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))'])
5676AT_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 5677sleep 1
c2a77f33 5678AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5679recirc_id=0,ip,in_port=1,dl_vlan=11,nw_frag=no, actions: <del>
5680recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,nw_frag=no, actions: <del>
bcd2633a
JP
5681])
5682OVS_VSWITCHD_STOP
5683AT_CLEANUP
5684
5685AT_SETUP([ofproto-dpif megaflow - move action])
5686OVS_VSWITCHD_START
623540e4 5687AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5688ADD_OF_PORTS([br0], [1], [2])
5689AT_DATA([flows.txt], [dnl
5690table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
5691table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
5692table=0 in_port=91 reg0=0x0a000002,actions=output(2)
5693])
5694AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5695AT_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)'])
5696AT_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 5697sleep 1
c2a77f33 5698AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5699recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
5700recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
bcd2633a
JP
5701])
5702OVS_VSWITCHD_STOP
5703AT_CLEANUP
5704
5705AT_SETUP([ofproto-dpif megaflow - push action])
5706OVS_VSWITCHD_START
623540e4 5707AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5708ADD_OF_PORTS([br0], [1], [2])
5709AT_DATA([flows.txt], [dnl
5710table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
5711])
5712AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5713AT_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)'])
5714AT_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 5715sleep 1
c2a77f33 5716AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5717recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
5718recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
bcd2633a
JP
5719])
5720OVS_VSWITCHD_STOP
5721AT_CLEANUP
5722
5723AT_SETUP([ofproto-dpif megaflow - learning])
5724OVS_VSWITCHD_START
623540e4 5725AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5726ADD_OF_PORTS([br0], [1], [2])
5727AT_DATA([flows.txt], [dnl
5728table=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
5729])
5730AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
31ef9f51 5731ovs-appctl time/stop
956f2bf0
BP
5732# We send each packet twice because the first packet in each flow causes the
5733# flow table to change and thus revalidations, which (depending on timing)
5734# can keep a megaflow from being installed. The revalidations are done by
5735# the second iteration, allowing the flows to be installed.
5736for i in 1 2; do
5737 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)'])
5738 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)'])
5739 ovs-appctl time/warp 100
5740done
ae692725 5741sleep 1
bcd2633a 5742dnl The original flow is missing due to a revalidation.
c2a77f33 5743AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5744recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5745recirc_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
5746])
5747OVS_VSWITCHD_STOP
5748AT_CLEANUP
d4f4a9b2
JP
5749
5750AT_SETUP([ofproto-dpif megaflow - tunnels])
5751OVS_VSWITCHD_START(
2c0ea78f 5752 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
623540e4 5753AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
2c0ea78f
GS
5754AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
5755 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
5756AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
5757 ofport_request=3])
5758AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
5759 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
5760 ofport_request=4 options:key=flow])
d4f4a9b2
JP
5761AT_DATA([flows.txt], [dnl
5762in_port=1,actions=output(2)
5763in_port=3,actions=output(4)
5764])
5765AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5766dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
5767dnl will cause the packet to be dropped.
5768AT_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 5769sleep 1
d4f4a9b2
JP
5770AT_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)'])
5771AT_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 5772sleep 1
d4f4a9b2 5773AT_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 5774sleep 1
c2a77f33 5775AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5776recirc_id=0,ip,in_port=1,nw_ecn=1,nw_frag=no, actions: <del>
5777recirc_id=0,ip,in_port=3,nw_tos=0,nw_ecn=1,nw_ttl=64,nw_frag=no, actions: <del>
5778recirc_id=0,ip,in_port=3,nw_tos=252,nw_ecn=1,nw_ttl=128,nw_frag=no, actions: <del>
1dd35f8a
JP
5779])
5780OVS_VSWITCHD_STOP
5781AT_CLEANUP
5782
5783AT_SETUP([ofproto-dpif megaflow - dec_ttl])
5784OVS_VSWITCHD_START
623540e4 5785AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
1dd35f8a 5786ADD_OF_PORTS([br0], [1], [2])
13751fd8 5787AT_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
5788AT_DATA([flows.txt], [dnl
5789table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
5790])
5791AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5792AT_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)'])
5793AT_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 5794sleep 1
c2a77f33 5795AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5796recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_ttl=64,nw_frag=no, actions: <del>
5797recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
d4f4a9b2
JP
5798])
5799OVS_VSWITCHD_STOP
5800AT_CLEANUP
74cc3969 5801
f74e7df7
JP
5802AT_SETUP([ofproto-dpif megaflow - set dl_dst])
5803OVS_VSWITCHD_START
623540e4 5804AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
f74e7df7
JP
5805ADD_OF_PORTS([br0], [1], [2])
5806AT_DATA([flows.txt], [dnl
5807table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
5808])
5809AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5810AT_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)'])
5811AT_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 5812sleep 1
d23df9a8
JR
5813dnl The first packet is essentially a no-op, as the new destination MAC is the
5814dnl same as the original. The second entry actually updates the destination
5815dnl MAC.
70e5ed6f 5816AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
16194afd
DDP
5817recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions:2
5818recirc_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
5819])
5820OVS_VSWITCHD_STOP
5821AT_CLEANUP
5822
8c301900
JR
5823AT_SETUP([ofproto-dpif megaflow - disabled])
5824OVS_VSWITCHD_START
623540e4 5825AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8c301900
JR
5826ADD_OF_PORTS([br0], [1], [2])
5827AT_DATA([flows.txt], [dnl
5828table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
5829table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
5830])
e79a6c83 5831AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
8c301900 5832], [])
64bb477f
JS
5833AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5834], [])
8c301900
JR
5835AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
5836AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5837for i in 1 2 3 4; do
5838 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)'])
5839 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
5840 if [[ $i -eq 1 ]]; then
5841 sleep 1
5842 fi
8c301900 5843done
ae692725 5844sleep 1
70e5ed6f 5845AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
78c9486d
JR
5846pkt_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
5847pkt_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 5848])
70e5ed6f 5849AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_DUMP | grep 'packets:3'], [0], [dnl
7d170098 5850skb_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 5851skb_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
5852])
5853OVS_VSWITCHD_STOP
5854AT_CLEANUP
5855
74cc3969
BP
5856AT_SETUP([ofproto-dpif - datapath port number change])
5857OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5858ADD_OF_PORTS([br0], 1)
5859
5860# Trace a flow that should output to p1.
5861AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5862 [0], [stdout])
5863AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
5864])
5865
5866# Change p1's port number to 5.
5867AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
5868
5869# Trace a flow that should output to p1 in its new location.
5870AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5871 [0], [stdout])
5872AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
5873])
5874OVS_VSWITCHD_STOP
5875AT_CLEANUP
2d344ba5
AW
5876
5877# Tests the bundling with various bfd and cfm configurations.
5878AT_SETUP([ofproto - bundle with variable bfd/cfm config])
5879OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
5880 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
5881 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
5882 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
5883 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
5884 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
5885 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
5886 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
5887 set Interface p0 cfm_mpid=1 -- \
5888 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
5889
5890ovs-appctl time/stop
5891# advance the clock to stablize everything.
bdba1947 5892ovs-appctl time/warp 5000 100
2d344ba5
AW
5893# cfm/show should show 'recv' fault.
5894AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5895 fault: recv
5896])
5897# bfd/show should show 'up'.
5898AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5899 Local Session State: up
5900 Remote Session State: up
5901 Local Session State: up
5902 Remote Session State: up
5903])
5904# bond/show should show 'may-enable: true' for all slaves.
5905AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
5906 may_enable: true
5907 may_enable: true
5908 may_enable: true
5909 may_enable: true
5910])
5911
5912# now disable the bfd on p1.
5913AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
5914# advance the clock to stablize everything.
bdba1947 5915ovs-appctl time/warp 5000 100
2d344ba5
AW
5916# cfm/show should show 'recv' fault.
5917AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5918 fault: recv
5919])
5920# bfd/show should show 'down'.
5921AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5922 Local Session State: down
5923 Remote Session State: down
5924])
5925# bond/show should show 'may-enable: false' for p0.
125bf01d 5926AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
2d344ba5
AW
5927 may_enable: false
5928 may_enable: true
2d344ba5
AW
5929])
5930
5931# now enable the bfd on p1 and disable bfd on p0.
5932AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
5933AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
5934# advance the clock to stablize everything.
bdba1947 5935ovs-appctl time/warp 5000 100
2d344ba5
AW
5936# cfm/show should show 'recv' fault.
5937AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5938 fault: recv
5939])
5940# bfd/show should show 'down'.
5941AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5942 Local Session State: down
5943 Remote Session State: down
5944])
5945# bond/show should show 'may-enable: false' for p0 and p1.
5946AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
5947 may_enable: false
5948 may_enable: true
5949 may_enable: false
5950 may_enable: true
5951])
5952
e441a806
AW
5953OVS_VSWITCHD_STOP
5954AT_CLEANUP
5955
5956AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
5957OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
5958
5959# enable bfd on p0.
5960AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
5961# check log.
1335a8d5 5962OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
5963# disable bfd on p0.
5964AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
5965# check log.
1335a8d5 5966OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
5967AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
5968
5969# enable cfm on p0.
5970AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
5971# check log.
1335a8d5 5972OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
5973# disable cfm on p0.
5974AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
5975# check log.
1335a8d5 5976OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
5977AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
5978
5979# enable both bfd and cfm on p0.
5980AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
5981# check log.
1335a8d5 5982OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
5983# disable bfd on p0.
5984AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
5985# check log, there should not be the log of thread terminated.
738cd849 5986AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
e441a806
AW
5987])
5988# reenable bfd on p0.
5989AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
5990# check log, should still be on log of thread created.
738cd849 5991AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
e441a806
AW
5992monitor thread created
5993])
5994# disable bfd and cfm together.
5995AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
5996# check log.
1335a8d5 5997OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
5998
5999OVS_VSWITCHD_STOP
6000AT_CLEANUP
6001
6002# this test helps avoid the deadlock between the main thread and monitor thread.
6003AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
6004OVS_VSWITCHD_START
6005
6006for i in `seq 1 199`
6007do
6008 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])
6009done
6010
98cf638b
AW
6011OVS_VSWITCHD_STOP
6012AT_CLEANUP
98b07853
BP
6013\f
6014AT_BANNER([ofproto-dpif - flow translation resource limits])
6015
6016AT_SETUP([ofproto-dpif - infinite resubmit])
6017OVS_VSWITCHD_START
6018AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
222820c6 6019AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
98b07853
BP
6020 [0], [stdout])
6021AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
6022])
6023AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
6024 [0], [1
6025])
6026OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
6027AT_CLEANUP
6028
6029AT_SETUP([ofproto-dpif - exponential resubmit chain])
6030OVS_VSWITCHD_START
6031ADD_OF_PORTS([br0], 1)
6032(for i in `seq 1 64`; do
6033 j=`expr $i + 1`
6034 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6035 done
6036 echo "in_port=65, actions=local") > flows
6037 AT_CHECK([ovs-ofctl add-flows br0 flows])
222820c6 6038AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
98b07853
BP
6039AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
6040])
6041OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
6042AT_CLEANUP
6043
6044AT_SETUP([ofproto-dpif - too many output actions])
6045OVS_VSWITCHD_START
6046ADD_OF_PORTS([br0], 1)
6047(for i in `seq 1 12`; do
6048 j=`expr $i + 1`
6049 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6050 done
6051 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
542024c4 6052AT_CHECK([ovs-ofctl add-flows br0 flows])
222820c6 6053AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
0f032e95
BP
6054AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
6055 [0], [1
98b07853 6056])
0f032e95 6057AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
542024c4 6058])
0f032e95 6059OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
98b07853
BP
6060AT_CLEANUP
6061
6062AT_SETUP([ofproto-dpif - stack too deep])
6063OVS_VSWITCHD_START
6064ADD_OF_PORTS([br0], 1)
6065(for i in `seq 1 12`; do
6066 j=`expr $i + 1`
6067 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6068 done
6069 push="push:NXM_NX_REG0[[]]"
6070 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
6071 AT_CHECK([ovs-ofctl add-flows br0 flows])
222820c6 6072AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
98b07853
BP
6073AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
6074])
6075OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
6076AT_CLEANUP
d611866c
SH
6077
6078
2608616d 6079AT_SETUP([ofproto-dpif packet-out controller])
d611866c
SH
6080OVS_VSWITCHD_START
6081ADD_OF_PORTS([br0], 1, 2)
6082
6083AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
6084
6085AT_CAPTURE_FILE([ofctl_monitor.log])
6086AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6087
6088for i in 1 2 3; do
6089 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
6090done
6091
6092OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6093AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6094NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
78c9486d 6095in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6096dnl
6097NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
78c9486d 6098in_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
6099dnl
6100NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
78c9486d 6101in_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
6102])
6103
6104AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6105 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6106NXST_FLOW reply:
6107])
6108
3c1bb396
BP
6109(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6110 table 0:
6111 active=1, lookup=0, matched=0"
d611866c
SH
6112 x=1
6113 while test $x -lt 254; do
3c1bb396
BP
6114 echo "
6115 table $x:
6116 active=0, lookup=0, matched=0"
d611866c
SH
6117 x=`expr $x + 1`
6118 done) > expout
6119AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6120
6121OVS_VSWITCHD_STOP
6122AT_CLEANUP
6123
2608616d 6124AT_SETUP([ofproto-dpif packet-out controller (patch port)])
d611866c
SH
6125OVS_VSWITCHD_START(
6126 [-- \
6127 add-port br0 p1 -- \
6128 set interface p1 type=patch options:peer=p2 -- \
6129 add-br br1 -- \
6130 set bridge br1 datapath-type=dummy -- \
6131 set bridge br1 fail-mode=secure -- \
6132 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
6133 add-port br1 p2 -- \
6134 set interface p2 type=patch options:peer=p1 --])
6135
6136AT_CAPTURE_FILE([ofctl_monitor.log])
6137AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6138
6139for i in 1 2 3; do
6140 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
6141done
6142
6143OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6144AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6145NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
78c9486d 6146in_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
6147dnl
6148NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
78c9486d 6149in_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
6150dnl
6151NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
78c9486d 6152in_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
6153])
6154
3c1bb396 6155(printf "OFPST_TABLE reply (OF1.3) (xid=0x2):"
d611866c
SH
6156 x=0
6157 while test $x -lt 254; do
3c1bb396
BP
6158 echo "
6159 table $x:
6160 active=0, lookup=0, matched=0"
d611866c
SH
6161 x=`expr $x + 1`
6162 done) > expout
6163AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6164
3c1bb396
BP
6165(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6166 table 0:
6167 active=0, lookup=3, matched=0"
d611866c
SH
6168 x=1
6169 while test $x -lt 254; do
3c1bb396
BP
6170 echo "
6171 table $x:
6172 active=0, lookup=0, matched=0"
d611866c
SH
6173 x=`expr $x + 1`
6174 done) > expout
6175AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
6176
6177OVS_VSWITCHD_STOP
6178AT_CLEANUP
6179
6180
2608616d 6181AT_SETUP([ofproto-dpif packet-out goto_table])
d611866c
SH
6182OVS_VSWITCHD_START
6183ADD_OF_PORTS([br0], 1, 2)
6184
6185AT_DATA([flows.txt], [dnl
6186table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
6187table=1 dl_dst=50:54:00:00:00:0a actions=controller
6188])
6189AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
6190
6191AT_CAPTURE_FILE([ofctl_monitor.log])
6192AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6193
6194for i in 1 2 3; do
6195 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)'
6196done
6197
6198OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6199OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6200AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6201NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6202in_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
6203dnl
6204NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6205in_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
6206dnl
6207NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6208in_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
6209])
6210
cea4a6d7 6211AT_CHECK([ovs-appctl revalidator/purge], [0])
d611866c
SH
6212AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
6213 n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
6214 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6215OFPST_FLOW reply (OF1.3):
6216])
6217
3c1bb396
BP
6218(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6219 table 0:
6220 active=1, lookup=3, matched=3
6221
6222 table 1:
6223 active=1, lookup=3, matched=3"
d611866c
SH
6224 x=2
6225 while test $x -lt 254; do
3c1bb396
BP
6226 echo "
6227 table $x:
6228 active=0, lookup=0, matched=0"
d611866c
SH
6229 x=`expr $x + 1`
6230 done) > expout
6231AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6232
6233OVS_VSWITCHD_STOP
6234AT_CLEANUP
6235
6236
2608616d 6237AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
d611866c
SH
6238OVS_VSWITCHD_START
6239ADD_OF_PORTS([br0], 1, 2)
6240
3c1bb396
BP
6241AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
6242AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
d611866c
SH
6243
6244AT_CAPTURE_FILE([ofctl_monitor.log])
6245AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6246
6247for i in 1 2 3; do
6248 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)'
6249done
6250
6251OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6252OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6253AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6254NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6255in_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
6256dnl
6257NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6258in_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
6259dnl
6260NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6261in_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
6262])
6263
cea4a6d7 6264AT_CHECK([ovs-appctl revalidator/purge], [0])
3c1bb396 6265AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
d611866c 6266 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
3c1bb396 6267OFPST_FLOW reply (OF1.1):
d611866c
SH
6268])
6269
3c1bb396
BP
6270(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6271 table 0:
6272 active=0, lookup=3, matched=0
6273
6274 table 1:
6275 active=1, lookup=3, matched=3"
d611866c
SH
6276 x=2
6277 while test $x -lt 254; do
3c1bb396
BP
6278 echo "
6279 table $x:
6280 active=0, lookup=0, matched=0"
d611866c
SH
6281 x=`expr $x + 1`
6282 done) > expout
6283AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6284
6285OVS_VSWITCHD_STOP
6286AT_CLEANUP
b0e2ec32
JR
6287
6288AT_SETUP([ofproto-dpif - ICMPv6])
6289OVS_VSWITCHD_START
6290ADD_OF_PORTS([br0], 1)
6291
6292AT_CAPTURE_FILE([ofctl_monitor.log])
6293
6294AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6295
6296ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
6297
6298OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6299
6300AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6301NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
78c9486d 6302icmp6,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
6303])
6304
6305OVS_VSWITCHD_STOP
6306AT_CLEANUP