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