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