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