]> git.proxmox.com Git - ovs.git/blame - tests/ofproto-dpif.at
datapath-windows: Added specific pool tag for vport code
[ovs.git] / tests / ofproto-dpif.at
CommitLineData
29901626
BP
1AT_BANNER([ofproto-dpif])
2
27f57736
JS
3AT_SETUP([ofproto-dpif - revalidator/wait])
4OVS_VSWITCHD_START
5AT_CHECK([ovs-appctl revalidator/wait])
6OVS_VSWITCHD_STOP
7AT_CLEANUP
8
adcf00ba
AZ
9AT_SETUP([ofproto-dpif, active-backup bonding])
10# Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
11# and br1 with interfaces p3, p4 and p8.
12# toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
13OVS_VSWITCHD_START(
14 [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
15 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
16 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
17 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
18 add-br br1 -- \
19 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
20 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
21 fail-mode=secure -- \
22 add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
23 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
24 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
55466d72 25WAIT_FOR_DUMMY_PORTS([p3], [p4])
623540e4 26AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
adcf00ba
AZ
27
28AT_CHECK([ovs-ofctl add-flow br0 action=normal])
29AT_CHECK([ovs-ofctl add-flow br1 action=normal])
30ovs-appctl netdev-dummy/set-admin-state up
31ovs-appctl time/warp 100
32ovs-appctl netdev-dummy/set-admin-state p2 down
33ovs-appctl time/stop
34ovs-appctl time/warp 100
35AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
36AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
37ovs-appctl time/warp 100
38ovs-appctl netdev-dummy/set-admin-state p2 up
39ovs-appctl netdev-dummy/set-admin-state p1 down
40ovs-appctl time/warp 100
41AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
42AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
bdba1947 43ovs-appctl time/warp 200 100
53555f51 44sleep 1
623540e4 45AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[348]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
46recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
47recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
48recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0d,nw_frag=no, actions: <del>
49recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0e,nw_frag=no, actions: <del>
50recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
51recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
adcf00ba
AZ
52])
53OVS_VSWITCHD_STOP
54AT_CLEANUP
55
56AT_SETUP([ofproto-dpif, balance-slb bonding])
57# Create br0 with interfaces bond0(p1, p2, p3) and p7,
58# and br1 with interfaces p4, p5, p6 and p8.
59# p1 <-> p4, p2 <-> p5, p3 <-> p6
60# Send some traffic, make sure the traffic are spread based on source mac.
61OVS_VSWITCHD_START(
62 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
63 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
64 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
65 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
66 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
67 add-br br1 -- \
68 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
69 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
70 fail-mode=secure -- \
71 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
72 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
73 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
74 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
55466d72 75WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
adcf00ba
AZ
76AT_CHECK([ovs-ofctl add-flow br0 action=normal])
77AT_CHECK([ovs-ofctl add-flow br1 action=normal])
78AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
79])
adcf00ba
AZ
80ovs-appctl time/stop
81ovs-appctl time/warp 100
82(
83for i in `seq 0 100 |xargs printf '%02x\n'`;
84 do
85 pkt="in_port(7),eth(src=50:54:00:00:00:$i,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
86 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
87 done
88)
89ovs-appctl time/warp 100
90AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
91# Make sure there is resonable distribution to all three ports.
92# We don't want to make this check precise, in case hash function changes.
93AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
94AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
95AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
96OVS_VSWITCHD_STOP
97AT_CLEANUP
98
99AT_SETUP([ofproto-dpif, balance-tcp bonding])
100# Create br0 with interfaces bond0(p1, p2, p3) and p7,
101# and br1 with interfaces bond1(p4, p5, p6) and p8.
102# bond0 <-> bond1
103# Send some traffic, make sure the traffic are spread based on L4 headers.
104OVS_VSWITCHD_START(
105 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
106 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
107 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
108 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
109 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
110 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
111 add-br br1 -- \
112 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
113 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
114 fail-mode=secure -- \
115 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
116 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
117 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
118 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
119 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
120 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
121AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
122])
123AT_CHECK([ovs-ofctl add-flow br0 action=normal])
124AT_CHECK([ovs-ofctl add-flow br1 action=normal])
125AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
126], [])
48105e85 127OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
adcf00ba
AZ
128ovs-appctl time/stop
129ovs-appctl time/warp 100
130ovs-appctl lacp/show > lacp.txt
131ovs-appctl bond/show > bond.txt
132(
25d6a6a8 133for i in `seq 0 255` ;
adcf00ba 134 do
ea2735d3 135 pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(ack)"
adcf00ba
AZ
136 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
137 done
138)
bdba1947 139ovs-appctl time/warp 300 100
adcf00ba
AZ
140AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
141AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
142# Make sure there is resonable distribution to all three ports.
143# We don't want to make this check precise, in case hash function changes.
fd184489
AZ
144AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
145AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
146AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
f9038ef6
AW
147
148OVS_VSWITCHD_STOP()
149AT_CLEANUP
150
151# Makes sure recirculation does not change the way packet is handled.
152AT_SETUP([ofproto-dpif, balance-tcp bonding, different recirc flow ])
153OVS_VSWITCHD_START(
154 [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
155 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
156 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
157 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
158 add-br br1 -- \
159 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
160 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
161 fail-mode=standalone -- \
162 add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
163 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
164 set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
165 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
166 add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
167 add-br br-int -- \
168 set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
169 set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
170 fail-mode=secure -- \
171 add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
172 add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
173])
174AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
175])
176
f12bfd04
AW
177# Waits for all ifaces enabled.
178OVS_WAIT_UNTIL([test `ovs-appctl bond/show | grep -- "may_enable: true" | wc -l` -ge 4])
179
f9038ef6
AW
180# The dl_vlan flow should not be ever matched,
181# since recirculation should not change the flow handling.
182AT_DATA([flows.txt], [dnl
183table=0 priority=1 in_port=5 actions=mod_vlan_vid:1,output(101)
184table=0 priority=2 in_port=5 dl_vlan=1 actions=drop
185])
186AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
187
188# Sends a packet to trigger recirculation.
e672ff9b 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
e672ff9b 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)
78c9486d 728ip,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1
f0fd1a17
PS
729])
730OVS_VSWITCHD_STOP
731AT_CLEANUP
732
65bfce4a
SH
733dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
734dnl buffer to be resized just before pushing the id of the dec_ttl action.
735dnl Thus the implementation must account for this by using the
736dnl reallocated buffer rather than the original buffer.
737dnl
738dnl A number of similar rules are added to try and exercise
739dnl xrealloc sufficiently that it returns a different base pointer
740AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
741OVS_VSWITCHD_START
742ADD_OF_PORTS([br0], [1])
743(for i in `seq 0 255`; do
744 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
745 done) > flows.txt
746AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
747OVS_VSWITCHD_STOP
748AT_CLEANUP
749
750dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
751dnl buffer to be resized just before pushing the id of the dec_ttl action.
752dnl Thus the implementation must account for this by using the
753dnl reallocated buffer rather than the original buffer.
754dnl
755dnl A number of similar rules are added to try and exercise
756dnl xrealloc sufficiently that it returns a different base pointer
757AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
758OVS_VSWITCHD_START
759ADD_OF_PORTS([br0], [1])
760(for i in `seq 0 255`; do
761 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
762 done) > flows.txt
763AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
764OVS_VSWITCHD_STOP
765AT_CLEANUP
766
767dnl A note action at offset 24 in ofpacts will cause the ofpacts
768dnl buffer to be resized just before pushing the id of the dec_ttl action.
769dnl Thus the implementation must account for this by using the
770dnl reallocated buffer rather than the original buffer.
771dnl
772dnl A number of similar rules are added to try and exercise
773dnl xrealloc sufficiently that it returns a different base pointer
774AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
775OVS_VSWITCHD_START
776ADD_OF_PORTS([br0], [1])
777(for i in `seq 0 255`; do
778 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
779 done) > flows.txt
780AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
781OVS_VSWITCHD_STOP
782AT_CLEANUP
f0fd1a17 783
77750738 784AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
e44768b7
JP
785OVS_VSWITCHD_START
786ADD_OF_PORTS([br0], [1], [2])
77750738 787
77750738
JP
788AT_CHECK([ovs-ofctl add-flow br0 action=normal])
789
790# "in_port" defaults to OFPP_NONE if it's not specified.
72d64e33 791flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,icmp_type=8,icmp_code=0"
77750738 792AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
72d64e33
EJ
793AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
7941
7952
796100
797])
77750738
JP
798
799OVS_VSWITCHD_STOP
800AT_CLEANUP
801
8b36f51e 802AT_SETUP([ofproto-dpif - DSCP])
8b36f51e 803OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
72d64e33 804ADD_OF_PORTS([br0], [9])
8b36f51e 805AT_DATA([flows.txt], [dnl
bdda5aca 806actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL
8b36f51e
EJ
807])
808AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
809AT_CHECK([ovs-vsctl -- \
810 set Port p1 qos=@newqos --\
811 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
812 --id=@q1 create Queue dscp=1 --\
813 --id=@q2 create Queue dscp=2], [0], [ignore])
50aa28fd 814AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
ce58df5b 815AT_CHECK([tail -2 stdout], [0],
d23df9a8 816 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no
ce58df5b 817Datapath actions: dnl
e44768b7 818100,dnl
d23df9a8
JR
819set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
820set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
8b36f51e 8211,dnl
d23df9a8
JR
822set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
823set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
824set(ipv4(tos=0/0xfc)),1,100
8b36f51e
EJ
825])
826OVS_VSWITCHD_STOP
827AT_CLEANUP
828
fd19297b 829AT_SETUP([ofproto-dpif - output/flood flags])
f7b8e494
JP
830OVS_VSWITCHD_START
831ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
fd19297b
EJ
832
833AT_DATA([flows.txt], [dnl
a0fbe94a 834in_port=local actions=local,flood
fd19297b
EJ
835in_port=1 actions=flood
836in_port=2 actions=all
bdda5aca
BP
837in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
838in_port=4 actions=enqueue:LOCAL:1,enqueue:1:1,enqueue:2:1,enqueue:3:2,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1
fd19297b
EJ
839])
840AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
841AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
842AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
843
50aa28fd 844AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
a0fbe94a
AR
845AT_CHECK([tail -1 stdout \
846| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
8471
8482
8493
8504
8517
852])
853
50aa28fd 854AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b
EJ
855AT_CHECK([tail -1 stdout \
856| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
e44768b7 857100
fd19297b
EJ
8582
8593
8604
8617
862])
863
50aa28fd 864AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b
EJ
865AT_CHECK([tail -1 stdout \
866| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
fd19297b 8671
e44768b7 868100
fd19297b
EJ
8693
8704
8716
8727
873])
874
50aa28fd 875AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b 876AT_CHECK([tail -1 stdout], [0],
e44768b7 877 [Datapath actions: 100,1,2,4,6,7
fd19297b
EJ
878])
879
50aa28fd 880AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
fd19297b 881AT_CHECK([tail -1 stdout], [0],
1b567fb9 882 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
fd19297b
EJ
883])
884OVS_VSWITCHD_STOP
885AT_CLEANUP
886
6b83a3c5 887AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
6d328fa2
SH
888OVS_VSWITCHD_START([dnl
889 add-port br0 p1 -- set Interface p1 type=dummy
890])
891ON_EXIT([kill `cat ovs-ofctl.pid`])
892
893AT_CAPTURE_FILE([ofctl_monitor.log])
894
895AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
896
897for i in 1 2 3 ; do
ea2735d3 898 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(syn)'
6d328fa2 899done
8bd16974 900OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
901OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
902AT_CHECK([cat ofctl_monitor.log], [0], [dnl
903NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 904tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
6d328fa2
SH
905dnl
906NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 907tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
6d328fa2
SH
908dnl
909NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 910tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
6d328fa2
SH
911])
912
913AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
914AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
915NXST_FLOW reply:
916])
917
918OVS_VSWITCHD_STOP
919AT_CLEANUP
920
6b83a3c5
SH
921AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
922OVS_VSWITCHD_START([dnl
923 add-port br0 p1 -- set Interface p1 type=dummy
924])
925ON_EXIT([kill `cat ovs-ofctl.pid`])
926
927AT_CAPTURE_FILE([ofctl_monitor.log])
928AT_CHECK([ovs-ofctl del-flows br0])
929
930AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
931
932dnl Test that missed packets are droped
933for i in 1 2 3 ; do
ea2735d3 934 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack,syn)'
6b83a3c5
SH
935done
936OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
937
938AT_CHECK([cat ofctl_monitor.log], [0], [dnl
939])
940
941AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
942AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
943OFPST_FLOW reply (OF1.3):
944])
945
946OVS_VSWITCHD_STOP
947AT_CLEANUP
948
6d328fa2
SH
949AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
950OVS_VSWITCHD_START([dnl
951 add-port br0 p1 -- set Interface p1 type=dummy
952])
953ON_EXIT([kill `cat ovs-ofctl.pid`])
954
955AT_CAPTURE_FILE([ofctl_monitor.log])
956AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
957
958AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
959
960for i in 1 2 3 ; do
ea2735d3 961 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(urg,rst)'
6d328fa2 962done
8bd16974 963OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
964OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
965AT_CHECK([cat ofctl_monitor.log], [0], [dnl
966OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 967tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
6d328fa2
SH
968dnl
969OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 970tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
6d328fa2
SH
971dnl
972OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 973tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
6d328fa2
SH
974])
975
cea4a6d7 976AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
977AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
978 n_packets=3, n_bytes=180, actions=goto_table:1
979OFPST_FLOW reply (OF1.2):
980])
981
982OVS_VSWITCHD_STOP
983AT_CLEANUP
984
985AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
986OVS_VSWITCHD_START([dnl
987 add-port br0 p1 -- set Interface p1 type=dummy
988])
989ON_EXIT([kill `cat ovs-ofctl.pid`])
990
991AT_CAPTURE_FILE([ofctl_monitor.log])
992AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
993
994AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
995
996for i in 1 2 3 ; do
997 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
998done
999
1000OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1001AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1002])
1003
cea4a6d7 1004AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1005AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1006 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1007OFPST_FLOW reply (OF1.2):
1008])
1009
1010OVS_VSWITCHD_STOP
1011AT_CLEANUP
1012
1013AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
1014OVS_VSWITCHD_START([dnl
1015 add-port br0 p1 -- set Interface p1 type=dummy
1016])
1017ON_EXIT([kill `cat ovs-ofctl.pid`])
1018
1019AT_CAPTURE_FILE([ofctl_monitor.log])
1020AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
1021AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1022
1023dnl Miss table 0, Hit table 1
1024AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1025
1026for i in 1 2 3 ; do
1027 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1028done
8bd16974 1029OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
1030OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1031
1032AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1033NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1034tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1035dnl
1036NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1037tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1038dnl
1039NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1040tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1041])
1042
1043dnl Hit table 0, Miss all other tables, sent to controller
1044AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1045
1046for i in 1 2 3 ; do
1047 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1048done
8bd16974 1049OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
1050OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1051
1052AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1053NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1054tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1055dnl
1056NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1057tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1058dnl
1059NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1060tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1061])
1062
cea4a6d7 1063AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1064AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1065 table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1066OFPST_FLOW reply (OF1.2):
1067])
1068
1069OVS_VSWITCHD_STOP
1070AT_CLEANUP
1071
1072AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
1073OVS_VSWITCHD_START([dnl
1074 add-port br0 p1 -- set Interface p1 type=dummy
1075])
1076ON_EXIT([kill `cat ovs-ofctl.pid`])
1077
1078AT_CAPTURE_FILE([ofctl_monitor.log])
1079AT_DATA([flows.txt], [dnl
1080table=0 actions=goto_table(1)
1081table=2 dl_src=10:11:11:11:11:11 actions=controller
1082])
1083AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1084AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1085
1086dnl Hit table 0, Miss table 1, Hit table 2
1087AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1088
1089for i in 1 2 3 ; do
1090 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1091done
8bd16974 1092OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1093OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
6d328fa2
SH
1094
1095AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1096NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1097tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1098dnl
1099NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1100tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1101dnl
1102NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1103tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1104])
1105
1106dnl Hit table 1, Miss all other tables, sent to controller
1107AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1108
1109for i in 1 2 3 ; do
1110 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1111done
8bd16974 1112OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
1113OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1114
1115AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1116NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1117tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1118dnl
1119NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1120tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1121dnl
1122NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1123tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
6d328fa2
SH
1124])
1125
cea4a6d7 1126AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1127AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1128 n_packets=6, n_bytes=360, actions=goto_table:1
1129 table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1130OFPST_FLOW reply (OF1.2):
1131])
1132
1133OVS_VSWITCHD_STOP
1134AT_CLEANUP
1135
1136AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1137OVS_VSWITCHD_START([dnl
1138 add-port br0 p1 -- set Interface p1 type=dummy
1139])
1140ON_EXIT([kill `cat ovs-ofctl.pid`])
1141
1142AT_CAPTURE_FILE([ofctl_monitor.log])
1143AT_DATA([flows.txt], [dnl
1144table=0 actions=resubmit(1,1)
1145table=2 dl_src=10:11:11:11:11:11 actions=controller
1146])
1147AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1148AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1149
1150dnl Hit table 0, Miss table 1, Dropped
1151AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1152
1153for i in 1 2 3 ; do
1154 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1155done
0c473314 1156OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
6d328fa2
SH
1157
1158AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1159])
1160
1161dnl Hit table 1, Dropped
1162AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1163
1164for i in 1 2 3 ; do
1165 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1166done
1167OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1168
1169AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1170])
1171
cea4a6d7 1172AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1173AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1174 n_packets=6, n_bytes=360, actions=resubmit(1,1)
1175 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1176OFPST_FLOW reply (OF1.2):
1177])
1178
1179OVS_VSWITCHD_STOP
1180AT_CLEANUP
1181
1182AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1183OVS_VSWITCHD_START([dnl
1184 add-port br0 p1 -- set Interface p1 type=dummy
1185])
1186ON_EXIT([kill `cat ovs-ofctl.pid`])
1187
1188AT_CAPTURE_FILE([ofctl_monitor.log])
1189AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1190
1191AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1192
1193dnl Test that missed packets are droped
1194for i in 1 2 3 ; do
1195 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1196done
1197OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1198
1199AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1200])
1201
1202AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1203AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1204NXST_FLOW reply:
1205])
1206
1207OVS_VSWITCHD_STOP
1208AT_CLEANUP
1209
1210AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1211OVS_VSWITCHD_START([dnl
1212 add-port br0 p1 -- set Interface p1 type=dummy
1213])
1214ON_EXIT([kill `cat ovs-ofctl.pid`])
1215
1216AT_CAPTURE_FILE([ofctl_monitor.log])
1217AT_CHECK([ovs-ofctl del-flows br0])
1218AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1219AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1220
1221AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1222
1223dnl Test that missed packets are droped
1224for i in 1 2 3 ; do
1225 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1226done
1227OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1228
1229AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1230])
1231
cea4a6d7 1232AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1233AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1234 n_packets=3, n_bytes=180, actions=goto_table:1
1235OFPST_FLOW reply (OF1.2):
1236])
1237
1238OVS_VSWITCHD_STOP
1239AT_CLEANUP
1240
1241AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1242OVS_VSWITCHD_START([dnl
1243 add-port br0 p1 -- set Interface p1 type=dummy
1244])
1245ON_EXIT([kill `cat ovs-ofctl.pid`])
1246
1247AT_CAPTURE_FILE([ofctl_monitor.log])
1248AT_CHECK([ovs-ofctl del-flows br0])
1249AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1250AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1251
1252AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1253
1254dnl Test that missed packets are droped
1255for i in 1 2 3 ; do
1256 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1257done
1258OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1259
1260AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1261])
1262
cea4a6d7 1263AT_CHECK([ovs-appctl revalidator/purge], [0])
6d328fa2
SH
1264AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1265 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1266OFPST_FLOW reply (OF1.2):
1267])
1268
1269OVS_VSWITCHD_STOP
1270AT_CLEANUP
1271
15056dc8
EJ
1272AT_SETUP([ofproto-dpif - controller])
1273OVS_VSWITCHD_START([dnl
1274 add-port br0 p1 -- set Interface p1 type=dummy
1275])
57c94f35 1276ON_EXIT([kill `cat ovs-ofctl.pid`])
15056dc8
EJ
1277
1278AT_CAPTURE_FILE([ofctl_monitor.log])
1279AT_DATA([flows.txt], [dnl
1280cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
54834960 1281cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
15056dc8
EJ
1282cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1283
54834960
EJ
1284cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1285cookie=0x4 table=2 in_port=81 actions=load:2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,controller,resubmit(82,3)
1286cookie=0x5 table=3 in_port=82 actions=load:3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,controller,resubmit(83,4)
1287cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1288cookie=0x7 table=5 in_port=84 actions=load:5->NXM_NX_REG4[[]],load:6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,controller,resubmit(85,6)
1289cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1290cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
78cef7fd 1291cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
56d72f37 1292cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[[]],controller,load:0xc0a88001->OXM_OF_ARP_SPA[[]],controller,load:0x404444444441->OXM_OF_ARP_THA[[]],load:0x01010101->OXM_OF_ARP_SPA[[]],load:0x02020202->OXM_OF_ARP_TPA[[]],controller
15056dc8
EJ
1293])
1294AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1295
1296dnl Flow miss.
77a922c7 1297AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1298
1299for i in 1 2 3 ; do
dc235f7f 1300 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
15056dc8 1301done
57c94f35 1302OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1303OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1304
15056dc8 1305AT_CHECK([cat ofctl_monitor.log], [0], [dnl
f0fd1a17 1306OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1307tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
15056dc8 1308dnl
f0fd1a17 1309OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1310tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
15056dc8 1311dnl
f0fd1a17 1312OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 1313tcp,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
15056dc8
EJ
1314])
1315
1316dnl Singleton controller action.
77a922c7 1317AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1318
1319for i in 1 2 3 ; do
dc235f7f 1320 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
15056dc8 1321done
57c94f35 1322OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1323OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1324
15056dc8
EJ
1325AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1326OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1327tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
15056dc8
EJ
1328dnl
1329OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1330tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
15056dc8
EJ
1331dnl
1332OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1333tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
15056dc8
EJ
1334])
1335
1336dnl Modified controller action.
77a922c7 1337AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1338
1339for i in 1 2 3 ; do
dc235f7f 1340 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=30:33:33:33:33:33,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x001)'
15056dc8 1341done
57c94f35 1342OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1343OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1344
15056dc8
EJ
1345AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1346OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1347tcp,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
15056dc8
EJ
1348dnl
1349OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1350tcp,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
15056dc8
EJ
1351dnl
1352OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1353tcp,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
15056dc8
EJ
1354])
1355
363dd1d9
JS
1356dnl Modified VLAN controller action.
1357AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1358
1359for i in 1 2 3; do
8249a1fe 1360 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:41,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
363dd1d9 1361done
57c94f35 1362OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1363OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
363dd1d9 1364
363dd1d9
JS
1365AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1366NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1367ip,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
363dd1d9
JS
1368dnl
1369NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1370ip,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
363dd1d9
JS
1371dnl
1372NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1373ip,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
363dd1d9
JS
1374])
1375
349fbdc2
SH
1376dnl Checksum TCP.
1377AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1378
1379for i in 1 ; do
1380 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)'
1381done
1382OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1383ovs-appctl -t ovs-ofctl exit
1384
1385AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1386NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1387tcp,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1388dnl
1389NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
78c9486d 1390tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1391dnl
1392NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
78c9486d 1393tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1394dnl
1395NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
78c9486d 1396tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
349fbdc2
SH
1397dnl
1398NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
78c9486d 1399tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:1a03
349fbdc2
SH
1400dnl
1401NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1402tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:3205
349fbdc2
SH
1403dnl
1404NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1405tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=fin tcp_csum:31b8
349fbdc2
SH
1406dnl
1407NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1408tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
349fbdc2
SH
1409dnl
1410NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1411tcp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
349fbdc2
SH
1412])
1413
1414dnl Checksum UDP.
1415AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1416
1417for i in 1 ; do
1418 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
1419done
1420OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1421ovs-appctl -t ovs-ofctl exit
1422
1423AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1424NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1425udp,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1426dnl
1427NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
78c9486d 1428udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1429dnl
1430NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
78c9486d 1431udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1432dnl
1433NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
78c9486d 1434udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
349fbdc2
SH
1435dnl
1436NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
78c9486d 1437udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37
349fbdc2
SH
1438dnl
1439NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1440udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439
349fbdc2
SH
1441dnl
1442NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1443udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec
349fbdc2
SH
1444dnl
1445NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1446udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
349fbdc2
SH
1447dnl
1448NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
78c9486d 1449udp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
349fbdc2
SH
1450])
1451
1452dnl Modified ARP controller action.
1453AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1454
1455for i in 1 2 3; do
1456 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
1457done
1458
368a198a 1459OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
349fbdc2
SH
1460OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1461AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1462NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1463arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1464NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1465arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1466NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1467arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
349fbdc2 1468NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1469arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1470NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1471arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1472NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1473arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
349fbdc2 1474NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1475arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1476NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1477arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
349fbdc2 1478NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1479arp,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
349fbdc2
SH
1480])
1481
1482AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1483
1484dnl Checksum SCTP.
1485AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1486
1487for i in 1 ; do
1488 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04'
1489done
1490
f7a22c7e 1491AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
349fbdc2
SH
1492OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1493OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1494AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1495NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
78c9486d 1496sctp,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1497dnl
1498NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered)
78c9486d 1499sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1500dnl
1501NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=102 (unbuffered)
78c9486d 1502sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1503dnl
1504NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=102 (unbuffered)
78c9486d 1505sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1506dnl
1507NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=102 (unbuffered)
78c9486d 1508sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1509dnl
1510NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
78c9486d 1511sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
349fbdc2
SH
1512dnl
1513NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
cf62fa4c 1514sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:dd778f5f
349fbdc2
SH
1515dnl
1516NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
cf62fa4c 1517sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
349fbdc2
SH
1518dnl
1519NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
cf62fa4c 1520sctp,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
349fbdc2
SH
1521])
1522
1523AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1524 cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1525 cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1526 cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1527 cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1528 cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1529 cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1530 cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6)
1531 cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1532 cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1533 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1534 cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535
1535 n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1536NXST_FLOW reply:
1537])
1538
1539OVS_VSWITCHD_STOP
1540AT_CLEANUP
1541
1542AT_SETUP([ofproto-dpif - MPLS handling])
1543OVS_VSWITCHD_START([dnl
1544 add-port br0 p1 -- set Interface p1 type=dummy
1545])
1546ON_EXIT([kill `cat ovs-ofctl.pid`])
1547
1548AT_CAPTURE_FILE([ofctl_monitor.log])
1549AT_DATA([flows.txt], [dnl
1550cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1551cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller
1552cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1553cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1554cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller
1555cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller
1556cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller
1557cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller
1ffd16af 1558cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
349fbdc2
SH
1559cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1560cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1561cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller
1ffd16af
SH
1562
1563cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1564cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1565cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1566cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller
1567cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,OXM_OF_IPV4_SRC[[0..7]]),controller
1568cookie=0xd dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,OXM_OF_IPV4_SRC[[0..15]],slaves:1,2),controller
1569cookie=0xd dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,OXM_OF_IPV4_SRC[[]]=OXM_OF_IPV4_DST[[]]),controller
1570
1571cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1572cookie=0xd table=1 arp actions=controller
1573
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)
78c9486d 1612mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1613dnl
1614NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1615mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1616dnl
1617NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1618mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
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)
78c9486d 1632ip,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
b0a17866
SH
1633dnl
1634NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1635ip,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
b0a17866
SH
1636dnl
1637NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1638ip,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
b0a17866
SH
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)
78c9486d 1654mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
b02475c5
SH
1655dnl
1656NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1657mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
b02475c5
SH
1658dnl
1659NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1660mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
b02475c5
SH
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)
78c9486d 1674mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1675dnl
1676NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1677mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1678dnl
1679NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1680mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
b02475c5
SH
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)
78c9486d 1694mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
b676167a
SH
1695dnl
1696NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1697mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
b676167a
SH
1698dnl
1699NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1700mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
b676167a
SH
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)
78c9486d 1714mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1715dnl
1716NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1717mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1718dnl
1719NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1720mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
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)
78c9486d 1734mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1735dnl
1736NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1737mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
1738dnl
1739NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1740mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
0f3f3c3d
SH
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)
78c9486d 1756mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1ffd16af
SH
1757dnl
1758NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1759mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1ffd16af
SH
1760dnl
1761NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1762mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1ffd16af
SH
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)
78c9486d 1778mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
0f3f3c3d
SH
1779dnl
1780NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1781mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
0f3f3c3d
SH
1782dnl
1783NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1784mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
0f3f3c3d
SH
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)
78c9486d 1798mpls,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1799dnl
1800NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1801mpls,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
b02475c5
SH
1802dnl
1803NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 1804mpls,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
b02475c5
SH
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)
78c9486d 1818mplsm,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
b02475c5
SH
1819dnl
1820NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1821mplsm,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
b02475c5
SH
1822dnl
1823NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
78c9486d 1824mplsm,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
b02475c5
SH
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)
78c9486d 1846tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
b02475c5 1847dnl
cff78c88 1848NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1849tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
b02475c5 1850dnl
cff78c88 1851NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1852tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
b02475c5
SH
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)
78c9486d 1872tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 1873dnl
e672ff9b 1874NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1875tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 1876dnl
e672ff9b 1877NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1878tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 1898tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af 1899dnl
e672ff9b 1900NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1901tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af 1902dnl
e672ff9b 1903NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1904tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
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)
78c9486d 1924tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af 1925dnl
e672ff9b 1926NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1927tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af 1928dnl
e672ff9b 1929NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1930tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
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)
78c9486d 1950tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af 1951dnl
e672ff9b 1952NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1953tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af 1954dnl
e672ff9b 1955NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1956tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1ffd16af
SH
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)
78c9486d 1976tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1ffd16af 1977dnl
e672ff9b 1978NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1979tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1ffd16af 1980dnl
e672ff9b 1981NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 1982tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db
1ffd16af
SH
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)
78c9486d 2002tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1ffd16af 2003dnl
e672ff9b 2004NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2005tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1ffd16af 2006dnl
e672ff9b 2007NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2008tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1ffd16af
SH
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)
78c9486d 2028tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2029dnl
e672ff9b 2030NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2031tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2032dnl
e672ff9b 2033NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2034tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 2052arp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
1ffd16af
SH
2053dnl
2054NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
78c9486d 2055arp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
1ffd16af
SH
2056dnl
2057NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
78c9486d 2058arp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
1ffd16af
SH
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)
78c9486d 2078tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2079dnl
e672ff9b 2080NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2081tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2082dnl
e672ff9b 2083NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2084tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 2104tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af 2105dnl
e672ff9b 2106NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2107tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af 2108dnl
e672ff9b 2109NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2110tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1ffd16af
SH
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)
78c9486d 2130tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
1ffd16af 2131dnl
e672ff9b 2132NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2133tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
1ffd16af 2134dnl
e672ff9b 2135NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2136tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
1ffd16af
SH
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)
78c9486d 2157mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2158dnl
2159NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2160mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2161dnl
2162NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2163mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2184mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2185dnl
e672ff9b 2186NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2187mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2188dnl
e672ff9b 2189NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2190mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2211mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2212dnl
2213NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2214mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
2215dnl
2216NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2217mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2238tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2239dnl
e672ff9b 2240NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2241tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2242dnl
e672ff9b 2243NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2244tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 2266tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2267dnl
e672ff9b 2268NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2269tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2270dnl
e672ff9b 2271NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2272tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 2293tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2294dnl
e672ff9b 2295NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2296tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2297dnl
e672ff9b 2298NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2299tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 2321mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2322dnl
e672ff9b 2323NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2324mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af 2325dnl
e672ff9b 2326NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2327mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2349mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af 2350dnl
e672ff9b 2351NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2352mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af 2353dnl
e672ff9b 2354NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2355mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2377mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af 2378dnl
e672ff9b 2379NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2380mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66: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)
78c9486d 2383mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2403mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
1ffd16af 2404dnl
e672ff9b 2405NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2406mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66: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)
78c9486d 2409mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2429mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
1ffd16af 2430dnl
e672ff9b 2431NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2432mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
1ffd16af 2433dnl
e672ff9b 2434NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2435mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2455mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
1ffd16af 2456dnl
e672ff9b 2457NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2458mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
1ffd16af 2459dnl
e672ff9b 2460NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2461mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2482mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
1ffd16af 2483dnl
e672ff9b 2484NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2485mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
1ffd16af 2486dnl
e672ff9b 2487NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2488mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2508mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2509dnl
e672ff9b 2510NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2511mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2512dnl
e672ff9b 2513NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2514mplsm,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2535mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2536dnl
e672ff9b 2537NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2538mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af 2539dnl
e672ff9b 2540NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
78c9486d 2541mpls,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
1ffd16af
SH
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)
78c9486d 2621tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2622dnl
2623OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2624tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
2625dnl
2626OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2627tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 2670tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2671dnl
e672ff9b 2672OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2673tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af 2674dnl
e672ff9b 2675OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
78c9486d 2676tcp,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1ffd16af
SH
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)
78c9486d 2709tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2710dnl
2711OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 2712tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2713dnl
2714OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 2715tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
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)
78c9486d 2751tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2752dnl
2753OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 2754tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
2755dnl
2756OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
78c9486d 2757tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
ba96552a
SS
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)
2817tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2818dnl
2819OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2820tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2821dnl
2822OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2823tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
527ae97e
SH
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)
2859tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2860dnl
2861OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2862tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2863dnl
2864OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2865tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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
SS
2906OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2907tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
2910tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2911dnl
3a11fd5b
SS
2912OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2913tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2914dnl
029ca940
SS
2915OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2916tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
2919tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2920dnl
3a11fd5b
SS
2921OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2922tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2923dnl
029ca940
SS
2924OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2925tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
2928tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2929dnl
3a11fd5b
SS
2930OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2931tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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
SS
2974OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2975tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
2978tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2979dnl
2980OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
2981tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
2984tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
2987tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2988dnl
2989OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
2990tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
3a11fd5b
SS
2993tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
3a11fd5b
SS
2996tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2997dnl
029ca940 2998OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
3a11fd5b
SS
2999tcp,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
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)
78c9486d 3203mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
56879058
JS
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)
78c9486d 3210mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
56879058
JS
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)
78c9486d 3217mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
56879058
JS
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)
78c9486d 3236mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
63636ee8
JS
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)
78c9486d 3243mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
63636ee8
JS
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)
78c9486d 3250mpls,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
63636ee8
JS
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)
78c9486d 3271mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
0c1625e8
SH
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)
78c9486d 3278mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
0c1625e8
SH
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)
78c9486d 3285mplsm,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
0c1625e8
SH
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)
78c9486d 3329mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3337mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3345mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3366mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3373mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3380mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3400mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3408mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3416mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3437mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3444mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3451mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3471mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3479mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3487mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3508mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3515mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3522mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3542mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3550mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3558mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3579mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3586mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3593mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3613mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3620mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3627mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3647mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3654mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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)
78c9486d 3661mpls,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
846e159a
SH
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
c2a77f33 4158odp_flow="in_port(1)"
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
aee0979b
BP
4405AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
4406OVS_VSWITCHD_START
4407ADD_OF_PORTS([br0], 1, 2, 3)
4408
4409AT_DATA([flows.txt], [dnl
4410in_port=1 actions=output:2
4411in_port=2 actions=output:1
4412])
4413AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4414
4415AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
4416AT_CHECK([tail -1 stdout], [0], [dnl
4417Datapath actions: push_vlan(vid=123,pcp=0),2
4418])
4419
4420OVS_VSWITCHD_STOP
4421AT_CLEANUP
4422
4423
b44a10b7
BP
4424m4_define([OFPROTO_TRACE],
4425 [flow="$2"
4426 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
4427 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4428 expected="$4"
4429 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
4430 [0], [stdout])
4431 mv stdout expout
4432 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
4433 [0], [expout])])
4434
4435AT_SETUP([ofproto-dpif - MAC learning])
432fca23
BP
4436OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4437ADD_OF_PORTS([br0], 1, 2, 3)
b44a10b7 4438
b44a10b7
BP
4439arp='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)'
4440
4441# Trace an ARP packet arriving on p3, to create a MAC learning entry.
4442OFPROTO_TRACE(
50aa28fd 4443 [ovs-dummy],
247527db 4444 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4445 [-generate],
e44768b7 4446 [1,2,100])
b44a10b7
BP
4447
4448# Check for the MAC learning entry.
83664f72 4449AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4450 port VLAN MAC Age
247527db 4451 3 0 50:54:00:00:00:05 ?
b44a10b7
BP
4452])
4453
4454# Trace a packet arrival destined for the learned MAC.
4455# (This will also learn a MAC.)
4456OFPROTO_TRACE(
50aa28fd 4457 [ovs-dummy],
247527db 4458 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
b44a10b7 4459 [-generate],
247527db 4460 [3])
b44a10b7
BP
4461
4462# Check for both MAC learning entries.
83664f72 4463AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4464 port VLAN MAC Age
247527db
BP
4465 3 0 50:54:00:00:00:05 ?
4466 1 0 50:54:00:00:00:06 ?
b44a10b7
BP
4467])
4468
4469# Trace a packet arrival that updates the first learned MAC entry.
4470OFPROTO_TRACE(
50aa28fd 4471 [ovs-dummy],
247527db 4472 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4473 [-generate],
e44768b7 4474 [1,3,100])
b44a10b7
BP
4475
4476# Check that the MAC learning entry was updated.
83664f72 4477AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4478 port VLAN MAC Age
247527db
BP
4479 1 0 50:54:00:00:00:06 ?
4480 2 0 50:54:00:00:00:05 ?
b44a10b7
BP
4481])
4482
4483# Add another bridge.
4484AT_CHECK(
4485 [ovs-vsctl \
4486 -- add-br br1 \
ad28062f
BP
4487 -- set bridge br1 datapath-type=dummy])
4488ADD_OF_PORTS([br1], 4, 5)
b44a10b7
BP
4489
4490# Trace some packet arrivals in br1 to create MAC learning entries there too.
4491OFPROTO_TRACE(
50aa28fd 4492 [ovs-dummy],
247527db 4493 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4494 [-generate],
e44768b7 4495 [5,101])
b44a10b7 4496OFPROTO_TRACE(
50aa28fd 4497 [ovs-dummy],
247527db 4498 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 4499 [-generate],
e44768b7 4500 [4,101])
b44a10b7
BP
4501
4502# Check that the MAC learning entries were added.
83664f72 4503AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4504 port VLAN MAC Age
247527db
BP
4505 4 0 50:54:00:00:00:06 ?
4506 5 0 50:54:00:00:00:07 ?
b44a10b7
BP
4507])
4508
4509# Delete port p1 and see that its MAC learning entry disappeared, and
4510# that the MAC learning entry for the same MAC was also deleted from br1.
4511AT_CHECK([ovs-vsctl del-port p1])
83664f72 4512AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4513 port VLAN MAC Age
247527db 4514 2 0 50:54:00:00:00:05 ?
b44a10b7 4515])
83664f72 4516AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 4517 port VLAN MAC Age
247527db 4518 5 0 50:54:00:00:00:07 ?
b44a10b7
BP
4519])
4520
4521OVS_VSWITCHD_STOP
4522AT_CLEANUP
17f7f7e0 4523
c4069512
BP
4524AT_SETUP([ofproto-dpif - MAC table overflow])
4525OVS_VSWITCHD_START(
ad28062f
BP
4526 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
4527ADD_OF_PORTS([br0], 1, 2, 3)
c4069512
BP
4528
4529arp='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)'
4530
4531AT_CHECK([ovs-appctl time/stop])
4532
4533# Trace 10 ARP packets arriving on p3, to create MAC learning entries.
4534for i in 0 1 2 3 4 5 6 7 8 9; do
4535 OFPROTO_TRACE(
50aa28fd 4536 [ovs-dummy],
c4069512
BP
4537 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
4538 [-generate],
4539 [1,2,100])
4540 ovs-appctl time/warp 1000
4541done
4542
4543# Check for the MAC learning entries.
4544AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4545 [0], [dnl
4546 3 0 50:54:00:00:00:00
4547 3 0 50:54:00:00:00:01
4548 3 0 50:54:00:00:00:02
4549 3 0 50:54:00:00:00:03
4550 3 0 50:54:00:00:00:04
4551 3 0 50:54:00:00:00:05
4552 3 0 50:54:00:00:00:06
4553 3 0 50:54:00:00:00:07
4554 3 0 50:54:00:00:00:08
4555 3 0 50:54:00:00:00:09
4556 port VLAN MAC Age
4557])
4558
4559# Trace another ARP packet on another MAC.
4560OFPROTO_TRACE(
50aa28fd 4561 [ovs-dummy],
c4069512
BP
4562 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
4563 [-generate],
4564 [1,2,100])
4565
4566# Check that the new one chased the oldest one out of the table.
4567AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
4568 [0], [dnl
4569 3 0 50:54:00:00:00:01 ?
4570 3 0 50:54:00:00:00:02 ?
4571 3 0 50:54:00:00:00:03 ?
4572 3 0 50:54:00:00:00:04 ?
4573 3 0 50:54:00:00:00:05 ?
4574 3 0 50:54:00:00:00:06 ?
4575 3 0 50:54:00:00:00:07 ?
4576 3 0 50:54:00:00:00:08 ?
4577 3 0 50:54:00:00:00:09 ?
4578 3 0 50:54:00:00:00:10 ?
4579 port VLAN MAC Age
4580])
4581OVS_VSWITCHD_STOP
4582AT_CLEANUP
4583
9d078ec2
BP
4584AT_SETUP([ofproto-dpif - MAC table overflow fairness])
4585OVS_VSWITCHD_START(
4586 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
4587ADD_OF_PORTS([br0], 1, 2, 3, 4, 5, 6)
4588
4589arp='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)'
4590
4591AT_CHECK([ovs-appctl time/stop])
4592
4593# Trace packets with 2 different source MACs arriving on each of the 5
4594# ports, filling up the 10-entry learning table.
4595for i in 0 1 2 3 4 5 6 7 8 9; do
4596 p=`expr $i / 2 + 1`
4597 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
4598 ovs-appctl time/warp 1000
4599done
4600
4601# Check for the MAC learning entries.
4602AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4603 [0], [dnl
4604 1 0 50:54:00:00:00:00
4605 1 0 50:54:00:00:00:01
4606 2 0 50:54:00:00:00:02
4607 2 0 50:54:00:00:00:03
4608 3 0 50:54:00:00:00:04
4609 3 0 50:54:00:00:00:05
4610 4 0 50:54:00:00:00:06
4611 4 0 50:54:00:00:00:07
4612 5 0 50:54:00:00:00:08
4613 5 0 50:54:00:00:00:09
4614 port VLAN MAC Age
4615])
4616
4617# Now trace 16 new MACs on another port.
4618for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
4619 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
4620 ovs-appctl time/warp 1000
4621done
4622
4623# Check the results.
4624#
4625# Our eviction algorithm on overflow is that an arbitrary (but deterministic)
4626# one of the ports with the most learned MACs loses the least recently used
4627# one. Thus, the new port will end up with 3 MACs, 3 of the old ports with 1
4628# MAC each, and the other 2 of the old ports with 2 MACs each.
4629#
4630# (If someone changes lib/heap.c to do something different with equal-priority
4631# nodes, then the output below could change, but it would still follow the
4632# rules explained above.)
4633AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
4634 [0], [dnl
4635 1 0 50:54:00:00:00:01
4636 2 0 50:54:00:00:00:03
4637 3 0 50:54:00:00:00:04
4638 3 0 50:54:00:00:00:05
4639 4 0 50:54:00:00:00:07
4640 5 0 50:54:00:00:00:08
4641 5 0 50:54:00:00:00:09
4642 6 0 50:54:00:00:0d:ff
4643 6 0 50:54:00:00:0e:ff
4644 6 0 50:54:00:00:0f:ff
4645 port VLAN MAC Age
4646])
4647OVS_VSWITCHD_STOP
4648AT_CLEANUP
4649
e731d71b
AS
4650# CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS)
4651#
4652# Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
4653#
4654# IP_VERSION_TYPE is used in AT_SETUP
4655m4_define([CHECK_SFLOW_SAMPLING_PACKET],
4656 [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector])
0af89118 4657 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
e731d71b
AS
4658 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4659
4660 ON_EXIT([kill `cat test-sflow.pid`])
eadd1644 4661 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
e731d71b 4662 AT_CAPTURE_FILE([sflow.log])
b52ecd96 4663 SFLOW_PORT=`parse_listening_port < test-sflow.log`
e731d71b
AS
4664 ovs-appctl time/stop
4665
4666 ADD_OF_PORTS([br0], 1, 2)
4667 ovs-vsctl \
4668 set Interface br0 options:ifindex=1002 -- \
4669 set Interface p1 options:ifindex=1004 -- \
4670 set Interface p2 options:ifindex=1003 -- \
4671 set Bridge br0 sflow=@sf -- \
4672 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
9a9808d7 4673 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
e731d71b
AS
4674
4675 dnl open with ARP packets to seed the bridge-learning. The output
4676 dnl ifIndex numbers should be reported predictably after that.
4677 dnl Since we set sampling=1 we should see all of these packets
4678 dnl reported. Sorting the output by data-source and seqNo makes
4679 dnl it deterministic. Ensuring that we send at least two packets
4680 dnl into each port means we get to check the seq nos are
4681 dnl incrementing correctly.
4682 dnl because packets from different ports can be handled by separate
4683 dnl threads, put some sleeps
4684
4685 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)'
4686 sleep 1
4687 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)'
4688 sleep 1
4689 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)'
4690 sleep 1
4691 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)'
4692 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)'
4693
4694 dnl sleep long enough to get more than one counter sample
4695 dnl from each datasource so we can check sequence numbers
bdba1947 4696 ovs-appctl time/warp 3000 100
e731d71b
AS
4697 OVS_VSWITCHD_STOP
4698 ovs-appctl -t test-sflow exit
8073dd31 4699
e731d71b 4700 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
8073dd31
NM
4701 /g']], [0], [dnl
4702HEADER
4703 dgramSeqNo=1
743cea45 4704 ds=127.0.0.1>2:1000
8073dd31
NM
4705 fsSeqNo=1
4706 in_vlan=0
4707 in_priority=0
4708 out_vlan=0
4709 out_priority=0
4710 meanSkip=1
4711 samplePool=1
4712 dropEvents=0
743cea45 4713 in_ifindex=1004
8073dd31
NM
4714 in_format=0
4715 out_ifindex=2
4716 out_format=2
4717 hdr_prot=1
4718 pkt_len=64
4719 stripped=4
4720 hdr_len=60
743cea45 4721 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
4722HEADER
4723 dgramSeqNo=1
743cea45 4724 ds=127.0.0.1>2:1000
8073dd31
NM
4725 fsSeqNo=2
4726 in_vlan=0
4727 in_priority=0
4728 out_vlan=0
4729 out_priority=0
4730 meanSkip=1
4731 samplePool=2
4732 dropEvents=0
4733 in_ifindex=1003
4734 in_format=0
743cea45
NM
4735 out_ifindex=2
4736 out_format=2
8073dd31
NM
4737 hdr_prot=1
4738 pkt_len=64
4739 stripped=4
4740 hdr_len=60
743cea45 4741 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
4742HEADER
4743 dgramSeqNo=1
743cea45 4744 ds=127.0.0.1>2:1000
8073dd31
NM
4745 fsSeqNo=3
4746 in_vlan=0
4747 in_priority=0
4748 out_vlan=0
4749 out_priority=0
4750 meanSkip=1
4751 samplePool=3
4752 dropEvents=0
743cea45 4753 in_ifindex=1004
8073dd31 4754 in_format=0
743cea45 4755 out_ifindex=1003
8073dd31
NM
4756 out_format=0
4757 hdr_prot=1
4758 pkt_len=64
4759 stripped=4
4760 hdr_len=60
743cea45 4761 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
4762HEADER
4763 dgramSeqNo=1
743cea45
NM
4764 ds=127.0.0.1>2:1000
4765 fsSeqNo=4
8073dd31
NM
4766 in_vlan=0
4767 in_priority=0
4768 out_vlan=0
4769 out_priority=0
4770 meanSkip=1
743cea45 4771 samplePool=4
8073dd31 4772 dropEvents=0
743cea45 4773 in_ifindex=1003
8073dd31 4774 in_format=0
743cea45
NM
4775 out_ifindex=1004
4776 out_format=0
8073dd31
NM
4777 hdr_prot=1
4778 pkt_len=64
4779 stripped=4
4780 hdr_len=60
743cea45 4781 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
4782HEADER
4783 dgramSeqNo=1
743cea45
NM
4784 ds=127.0.0.1>2:1000
4785 fsSeqNo=5
8073dd31
NM
4786 in_vlan=0
4787 in_priority=0
4788 out_vlan=0
4789 out_priority=0
4790 meanSkip=1
743cea45 4791 samplePool=5
8073dd31 4792 dropEvents=0
743cea45 4793 in_ifindex=1003
8073dd31 4794 in_format=0
743cea45 4795 out_ifindex=1004
8073dd31
NM
4796 out_format=0
4797 hdr_prot=1
4798 pkt_len=64
4799 stripped=4
4800 hdr_len=60
52105b67 4801 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
4802])
4803
50b9699f 4804 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -18 | sed 's/ /\
8073dd31
NM
4805 /g']], [0], [dnl
4806IFCOUNTERS
4807 dgramSeqNo=2
4808 ds=127.0.0.1>0:1002
4809 csSeqNo=1
4810 ifindex=1002
4811 type=6
4812 ifspeed=100000000
4813 direction=0
1839c356 4814 status=0
8073dd31
NM
4815 in_octets=0
4816 in_unicasts=0
4817 in_multicasts=0
4818 in_broadcasts=4294967295
4819 in_discards=0
4820 in_errors=0
4821 in_unknownprotos=4294967295
4822 out_octets=120
4823 out_unicasts=2
4824 out_multicasts=4294967295
4825 out_broadcasts=4294967295
4826 out_discards=0
4827 out_errors=0
4828 promiscuous=0
4829IFCOUNTERS
4830 dgramSeqNo=2
4831 ds=127.0.0.1>0:1003
4832 csSeqNo=1
4833 ifindex=1003
4834 type=6
4835 ifspeed=100000000
4836 direction=0
4837 status=0
52105b67 4838 in_octets=138
8073dd31
NM
4839 in_unicasts=3
4840 in_multicasts=0
4841 in_broadcasts=4294967295
4842 in_discards=0
4843 in_errors=0
4844 in_unknownprotos=4294967295
4845 out_octets=120
4846 out_unicasts=2
4847 out_multicasts=4294967295
4848 out_broadcasts=4294967295
4849 out_discards=0
4850 out_errors=0
4851 promiscuous=0
4852IFCOUNTERS
4853 dgramSeqNo=2
4854 ds=127.0.0.1>0:1004
4855 csSeqNo=1
4856 ifindex=1004
4857 type=6
4858 ifspeed=100000000
4859 direction=0
4860 status=0
4861 in_octets=84
4862 in_unicasts=2
4863 in_multicasts=0
4864 in_broadcasts=4294967295
4865 in_discards=0
4866 in_errors=0
4867 in_unknownprotos=4294967295
4868 out_octets=180
4869 out_unicasts=3
4870 out_multicasts=4294967295
4871 out_broadcasts=4294967295
4872 out_discards=0
4873 out_errors=0
4874 promiscuous=0
4875IFCOUNTERS
4876 dgramSeqNo=3
4877 ds=127.0.0.1>0:1002
4878 csSeqNo=2
4879 ifindex=1002
4880 type=6
4881 ifspeed=100000000
4882 direction=0
1839c356 4883 status=0
8073dd31
NM
4884 in_octets=0
4885 in_unicasts=0
4886 in_multicasts=0
4887 in_broadcasts=4294967295
4888 in_discards=0
4889 in_errors=0
4890 in_unknownprotos=4294967295
4891 out_octets=120
4892 out_unicasts=2
4893 out_multicasts=4294967295
4894 out_broadcasts=4294967295
4895 out_discards=0
4896 out_errors=0
4897 promiscuous=0
4898IFCOUNTERS
4899 dgramSeqNo=3
4900 ds=127.0.0.1>0:1003
4901 csSeqNo=2
4902 ifindex=1003
4903 type=6
4904 ifspeed=100000000
4905 direction=0
4906 status=0
52105b67 4907 in_octets=138
8073dd31
NM
4908 in_unicasts=3
4909 in_multicasts=0
4910 in_broadcasts=4294967295
4911 in_discards=0
4912 in_errors=0
4913 in_unknownprotos=4294967295
4914 out_octets=120
4915 out_unicasts=2
4916 out_multicasts=4294967295
4917 out_broadcasts=4294967295
4918 out_discards=0
4919 out_errors=0
4920 promiscuous=0
4921IFCOUNTERS
4922 dgramSeqNo=3
4923 ds=127.0.0.1>0:1004
4924 csSeqNo=2
4925 ifindex=1004
4926 type=6
4927 ifspeed=100000000
4928 direction=0
4929 status=0
4930 in_octets=84
4931 in_unicasts=2
4932 in_multicasts=0
4933 in_broadcasts=4294967295
4934 in_discards=0
4935 in_errors=0
4936 in_unknownprotos=4294967295
4937 out_octets=180
4938 out_unicasts=3
4939 out_multicasts=4294967295
4940 out_broadcasts=4294967295
4941 out_discards=0
4942 out_errors=0
4943 promiscuous=0
50b9699f
NM
4944OPENFLOWPORT
4945 datapath_id=18364758544493064720
4946 port_no=1
4947OPENFLOWPORT
4948 datapath_id=18364758544493064720
4949 port_no=1
4950OPENFLOWPORT
4951 datapath_id=18364758544493064720
4952 port_no=2
4953OPENFLOWPORT
4954 datapath_id=18364758544493064720
4955 port_no=2
4956OPENFLOWPORT
4957 datapath_id=18364758544493064720
4958 port_no=65534
4959OPENFLOWPORT
4960 datapath_id=18364758544493064720
4961 port_no=65534
4962PORTNAME
4963 portName=br0
4964PORTNAME
4965 portName=br0
4966PORTNAME
4967 portName=p1
4968PORTNAME
4969 portName=p1
4970PORTNAME
4971 portName=p2
4972PORTNAME
4973 portName=p2
8073dd31 4974])
e731d71b 4975 AT_CLEANUP])
17f7f7e0 4976
e731d71b
AS
4977CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4])
4978CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6])
1e04fcc8 4979
50b9699f
NM
4980dnl Test sFlow LAG structures
4981AT_SETUP([ofproto-dpif - sFlow LACP structures])
80ee73d3 4982AT_SKIP_IF([test "$IS_WIN32" = "yes"])
50b9699f
NM
4983OVS_VSWITCHD_START([dnl
4984 add-bond br0 bond p1 p2 -- \
4985 set Port bond lacp=active bond-mode=active-backup \
4986 other_config:lacp-time="fast" \
4987 other_config:lacp-system-id=11:22:33:44:55:66 \
4988 other_config:lacp-system-priority=54321 -- \
4989 set Interface p1 type=dummy \
4990 other_config:lacp-port-id=11 \
4991 other_config:lacp-port-priority=111 \
4992 other_config:lacp-aggregation-key=3333 -- \
4993 set Interface p2 type=dummy \
4994 other_config:lacp-port-id=22 \
4995 other_config:lacp-port-priority=222 \
4996 other_config:lacp-aggregation-key=3333 ])
4997
4998ON_EXIT([kill `cat test-sflow.pid`])
4999AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5000AT_CAPTURE_FILE([sflow.log])
5001SFLOW_PORT=`parse_listening_port < test-sflow.log`
5002
5003ovs-appctl time/stop
5004
5005ovs-vsctl \
5006 set Interface p1 options:ifindex=1003 -- \
5007 set Bridge br0 sflow=@sf -- \
5008 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5009 header=128 sampling=1 polling=1
5010
5011dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
cea4a6d7
JS
5012AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
5013AT_CHECK([ovs-appctl revalidator/purge], [0])
50b9699f
NM
5014OVS_VSWITCHD_STOP
5015ovs-appctl -t test-sflow exit
5016AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
5017 /g']], [0], [dnl
5018LACPCOUNTERS
5019 sysID=11:22:33:44:55:66
5020 partnerID=00:00:00:00:00:00
5021 aggID=3333
5022 actorAdmin=0x7
5023 actorOper=0xbf
5024 partnerAdmin=0x0
5025 partnerOper=0x2
5026 LACPUDsRx=0
5027 markerPDUsRx=4294967295
5028 markerRespPDUsRx=4294967295
5029 unknownRx=4294967295
5030 illegalRx=0
5031 LACPUDsTx=1
5032 markerPDUsTx=4294967295
5033 markerRespPDUsTx=4294967295
5034])
5035
5036AT_CLEANUP
5037
e731d71b
AS
5038# CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
5039#
5040# Test that basic NetFlow reports flow statistics correctly:
5041# The initial packet of a flow are correctly accounted.
5042# Later packets within a flow are correctly accounted.
5043# Flow actions changing (in this case, due to MAC learning)
5044# cause a record to be sent.
5045#
5046# IP_VERSION_TYPE is used in AT_SETUP
5047m4_define([CHECK_NETFLOW_EXPIRATION],
5048 [AT_SETUP([ofproto-dpif - NetFlow flow expiration - $2 collector])
5049 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5050 ADD_OF_PORTS([br0], 1, 2)
5051
5052 ovs-appctl time/stop
5053 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 5054 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 5055 AT_CAPTURE_FILE([netflow.log])
b52ecd96 5056 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
e731d71b
AS
5057
5058 ovs-vsctl \
5059 set Bridge br0 netflow=@nf -- \
5060 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5061 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
5062
5063 for delay in 1000 30000; do
5064 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 5065 sleep 1 # ensure the order in which these two packets are processed
e731d71b
AS
5066 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)'
5067
5068 ovs-appctl time/warp $delay
5069 done
17f7f7e0 5070
e731d71b 5071 ovs-appctl time/warp 6000
27f57736 5072 ovs-appctl revalidator/wait
e731d71b
AS
5073 OVS_VSWITCHD_STOP
5074 ovs-appctl -t test-netflow exit
e79a6c83 5075
e731d71b 5076 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 5077
e731d71b 5078 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 5079
e731d71b
AS
5080 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
5081 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
5082 AT_CHECK([test $separate = 2 || test $combined = 1], [0])
17f7f7e0 5083
e731d71b 5084 AT_CLEANUP])
17f7f7e0 5085
e731d71b
AS
5086CHECK_NETFLOW_EXPIRATION([127.0.0.1], [IPv4])
5087CHECK_NETFLOW_EXPIRATION([[[::1]]], [IPv6])
1e04fcc8 5088
e731d71b
AS
5089# CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
5090#
5091# Test that basic NetFlow reports active expirations correctly.
5092#
5093# IP_VERSION_TYPE is used in AT_SETUP
5094m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
5095 [AT_SETUP([ofproto-dpif - NetFlow active expiration - $2 collector])
1e04fcc8 5096
e731d71b
AS
5097 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5098 ADD_OF_PORTS([br0], 1, 2)
17f7f7e0 5099
e731d71b 5100 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 5101 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 5102 AT_CAPTURE_FILE([netflow.log])
b52ecd96 5103 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
17f7f7e0 5104
e731d71b
AS
5105 ovs-vsctl \
5106 set Bridge br0 netflow=@nf -- \
5107 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5108 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
17f7f7e0 5109
e731d71b
AS
5110 AT_CHECK([ovs-appctl time/stop])
5111 n=1
5112 while test $n -le 60; do
5113 n=`expr $n + 1`
17f7f7e0 5114
e731d71b
AS
5115 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)'
5116 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 5117
e731d71b
AS
5118 ovs-appctl time/warp 1000
5119 done
17f7f7e0 5120
e731d71b
AS
5121 ovs-appctl time/warp 10000
5122
27f57736 5123 ovs-appctl revalidator/wait
e731d71b
AS
5124 OVS_VSWITCHD_STOP
5125 ovs-appctl -t test-netflow exit
5126
5127 # Count the number of reported packets:
5128 # - From source to destination before MAC learning kicks in (just one).
5129 # - From source to destination after that.
5130 # - From destination to source.
5131 n_learn=0
5132 n_in=0
5133 n_out=0
5134 n_other=0
5135 n_recs=0
5136 none=0
5137 while read line; do
5138 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
5139 case $pkts in
5140 [[0-9]]*) ;;
5141 *) continue ;;
5142 esac
5143
5144 case $line in
5145 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
5146 counter=n_learn
5147 ;;
5148 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
5149 counter=n_in
5150 ;;
5151 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
5152 counter=n_out
5153 ;;
5154 *)
5155 counter=n_other
5156 ;;
5157 esac
5158 eval $counter=\`expr \$$counter + \$pkts\`
5159 n_recs=`expr $n_recs + 1`
5160 done < netflow.log
5161
5162 # There should be exactly 1 MAC learning packet,
5163 # exactly 59 other packets in that direction,
5164 # and exactly 60 packets in the other direction.
5165 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
5166])
5167
5168 AT_CLEANUP])
5169
5170CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1], [IPv4])
5171CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]], [IPv6])
f27f2134 5172
23a7d252
JS
5173AT_SETUP([ofproto-dpif - flow stats])
5174OVS_VSWITCHD_START
5175AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
5176AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
5177
5178ovs-appctl time/stop
5179
5180for i in `seq 1 10`; do
5181 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)'
5182done
5183
cea4a6d7
JS
5184AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
5185AT_CHECK([ovs-appctl revalidator/purge], [0])
e96a5c24 5186AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
11f9de00 5187AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
e96a5c24 5188 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
11f9de00 5189 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
e96a5c24
JS
5190])
5191OVS_VSWITCHD_STOP
5192AT_CLEANUP
5193
5194AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
5195OVS_VSWITCHD_START
5196AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
5197AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
5198
5199ovs-appctl time/stop
5200
5201for i in `seq 1 10`; do
5202 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)'
5203done
5204
5205ovs-appctl time/warp 100
5206AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
5207ovs-appctl time/warp 1000
5208
23a7d252 5209AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
11f9de00 5210AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
23a7d252 5211 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
11f9de00 5212 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
23a7d252
JS
5213])
5214OVS_VSWITCHD_STOP
5215AT_CLEANUP
5216
f27f2134
BP
5217AT_SETUP([idle_age and hard_age increase over time])
5218OVS_VSWITCHD_START
5219
5220# get_ages DURATION HARD IDLE
5221#
5222# Fetch the flow duration, hard age, and idle age into the variables
5223# whose names are given as arguments. Rounds DURATION down to the
5224# nearest integer. If hard_age doesn't appear in the output, sets
5225# HARD to "none". If idle_age doesn't appear in the output, sets IDLE
5226# to 0.
5227get_ages () {
5228 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5229
5230 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
5231 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
5232 AS_VAR_COPY([$1], [duration])
5233
5234 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
5235 if test X"$hard" = X; then
5236 hard=none
5237 else
5238 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
5239 fi
5240 AS_VAR_COPY([$2], [hard])
5241
5242 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
5243 if test X"$idle" = X; then
5244 idle=0
5245 else
5246 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
5247 fi
5248 AS_VAR_COPY([$3], [idle])
5249}
5250
5251# Add a flow and get its initial hard and idle age.
5252AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
5253get_ages duration1 hard1 idle1
5254
31ef9f51 5255ovs-appctl time/stop
f27f2134
BP
5256# Warp time forward by 10 seconds, then modify the flow's actions.
5257ovs-appctl time/warp 10000
5258get_ages duration2 hard2 idle2
5259AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
5260
5261# Warp time forward by 10 seconds.
5262ovs-appctl time/warp 10000
5263get_ages duration3 hard3 idle3
5264
5265# Warp time forward 10 more seconds, then pass some packets through the flow,
5266# then warp forward a few more times because idle times are only updated
5267# occasionally.
5268ovs-appctl time/warp 10000
5269ovs-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 5270ovs-appctl time/warp 3000 1000
c0526804 5271sleep 1
f27f2134
BP
5272get_ages duration4 hard4 idle4
5273
5274printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
5275printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
5276printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
5277
5278# Duration should increase steadily over time.
5279AT_CHECK([test $duration1 -lt $duration2])
5280AT_CHECK([test $duration2 -lt $duration3])
5281AT_CHECK([test $duration3 -lt $duration4])
5282
5283# Hard age should be "none" initially because it's the same as flow_duration,
5284# then it should increase.
5285AT_CHECK([test $hard1 = none])
5286AT_CHECK([test $hard2 = none])
5287AT_CHECK([test $hard3 != none])
5288AT_CHECK([test $hard4 != none])
5289AT_CHECK([test $hard3 -lt $hard4])
5290
5291# Idle age should increase from 1 to 2 to 3, then decrease.
5292AT_CHECK([test $idle1 -lt $idle2])
5293AT_CHECK([test $idle2 -lt $idle3])
5294AT_CHECK([test $idle3 -gt $idle4])
5295
5296# Check some invariant relationships.
5297AT_CHECK([test $duration1 = $idle1])
5298AT_CHECK([test $duration2 = $idle2])
5299AT_CHECK([test $duration3 = $idle3])
5300AT_CHECK([test $idle3 -gt $hard3])
5301AT_CHECK([test $idle4 -lt $hard4])
5302AT_CHECK([test $hard4 -lt $duration4])
5303
5304OVS_VSWITCHD_STOP
5305AT_CLEANUP
0e553d9c
BP
5306
5307AT_SETUP([ofproto-dpif - fin_timeout])
5308OVS_VSWITCHD_START
b5c1a5df 5309ovs-appctl time/stop
0e553d9c
BP
5310AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
5311AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5312[NXST_FLOW reply:
5313 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5314])
31ef9f51 5315
0e553d9c
BP
5316# Check that a TCP SYN packet does not change the timeout. (Because
5317# flow stats updates are mainly what implements the fin_timeout
5318# feature, we warp forward a couple of times to ensure that flow stats
5319# run before re-checking the flow table.)
323cc924 5320AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
0e553d9c
BP
5321AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5322warped
5323])
cea4a6d7 5324AT_CHECK([ovs-appctl revalidator/purge], [0])
0e553d9c
BP
5325AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5326[NXST_FLOW reply:
5327 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
5328])
5329# Check that a TCP FIN packet does change the timeout.
323cc924 5330AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
0e553d9c
BP
5331AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
5332warped
5333])
5334AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
5335[NXST_FLOW reply:
5336 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
5337])
5338OVS_VSWITCHD_STOP
5339AT_CLEANUP
27022416
JP
5340
5341AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
5342OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5343ADD_OF_PORTS([br0], [1], [2])
5344ADD_OF_PORTS([br1], [3])
5345
5346AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
5347dummy@br0
5348dummy@br1
5349])
5350OVS_VSWITCHD_STOP
5351AT_CLEANUP
5352
5353AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
5354OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
5355ADD_OF_PORTS([br0], [1], [2])
5356ADD_OF_PORTS([br1], [3])
5357
5358AT_CHECK([ovs-appctl dpif/show], [0], [dnl
dc54ef36 5359dummy@ovs-dummy: hit:0 missed:0
e79a6c83 5360 br0:
dc54ef36
EJ
5361 br0 65534/100: (dummy)
5362 p1 1/1: (dummy)
5363 p2 2/2: (dummy)
e79a6c83 5364 br1:
dc54ef36
EJ
5365 br1 65534/101: (dummy)
5366 p3 3/3: (dummy)
27022416
JP
5367])
5368OVS_VSWITCHD_STOP
5369AT_CLEANUP
5370
5371AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
054e5aa6 5372# bump max-idle to avoid the flows being reclaimed behind us
27022416 5373OVS_VSWITCHD_START([add-br br1 -- \
054e5aa6
YT
5374 set bridge br1 datapath-type=dummy fail-mode=secure -- \
5375 set Open_vSwitch . other_config:max-idle=10000])
27022416
JP
5376ADD_OF_PORTS([br0], [1], [2])
5377ADD_OF_PORTS([br1], [3])
5378
323cc924
BP
5379AT_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)'])
5380AT_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)'])
5381AT_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 5382ovs-appctl revalidator/wait
70e5ed6f 5383AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd
DDP
5384recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
5385recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
27022416
JP
5386])
5387
70e5ed6f 5388AT_CHECK([ovs-appctl dpif/dump-flows br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd 5389recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
27022416
JP
5390])
5391
70e5ed6f 5392AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd
DDP
5393skb_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
5394skb_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
5395])
5396
70e5ed6f 5397AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl
16194afd 5398skb_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
5399])
5400
5401OVS_VSWITCHD_STOP
5402AT_CLEANUP
5403
5404AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow])
5405
5406OVS_VSWITCHD_START([add-br br1 -- \
5407 set bridge br1 datapath-type=dummy fail-mode=secure -- \
5408 set Open_vSwitch . other_config:max-idle=10000])
5409ADD_OF_PORTS([br0], [1], [2])
5410
5411AT_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)'])
5412ovs-appctl revalidator/wait
5413AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
5414
5415UFID=`sed -n 's/\(ufid:[[0-9a-fA-F]]*\).*/\1/p' stdout`
5416AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
5417recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
04b541df
GS
5418])
5419
27022416
JP
5420OVS_VSWITCHD_STOP
5421AT_CLEANUP
5422
50c1efc9 5423AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
8bfd0fda
BP
5424OVS_VSWITCHD_START([dnl
5425 add-port br0 p1 -- set Interface p1 type=dummy
5426])
623540e4 5427AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8bfd0fda
BP
5428ON_EXIT([kill `cat ovs-ofctl.pid`])
5429
5430AT_CAPTURE_FILE([ofctl_monitor.log])
5431AT_DATA([flows.txt], [dnl
5432dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5433dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5434])
5435AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5436
5437dnl Packet is sent to userspace because a MPLS push or pop action is applied to
47fb7f71 5438dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
8bfd0fda 5439dnl
47fb7f71 5440dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
8bfd0fda 5441dnl 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
5442dnl (label 20, exp 0, [S], ttl 32)
5443dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5444dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
5445
5446for dl_src in 00 01; do
47fb7f71 5447 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
5448done
5449sleep 1 # wait for the datapath flow installed
70e5ed6f 5450AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
22d38fca
JR
5451recirc_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))
5452recirc_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 5453])
8bfd0fda
BP
5454
5455OVS_VSWITCHD_STOP
5456AT_CLEANUP
5457
5458
50c1efc9 5459AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
8bfd0fda
BP
5460OVS_VSWITCHD_START([dnl
5461 add-port br0 p1 -- set Interface p1 type=dummy
5462])
623540e4 5463AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8bfd0fda
BP
5464ON_EXIT([kill `cat ovs-ofctl.pid`])
5465
5466AT_CAPTURE_FILE([ofctl_monitor.log])
5467AT_DATA([flows.txt], [dnl
5468dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
5469dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
5470])
5471AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5472
5473dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
5474dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
47fb7f71 5475dnl can't determine the resulting MPLS label after MPLS push/pop actions.
8bfd0fda
BP
5476dnl
5477dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
5478dnl 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)
5479dnl (label 20, exp 0, ttl 32)
5480dnl (label 20, exp 0, ttl 32)
5481dnl (label 20, exp 0, [S], ttl 32)
5482dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
5483dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
8bfd0fda 5484
47fb7f71
JS
5485for dl_src in 00 01; do
5486 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
5487done
5488sleep 1 # wait for the datapath flow installed
70e5ed6f 5489AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
22d38fca
JR
5490recirc_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))
5491recirc_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
5492])
5493
5494OVS_VSWITCHD_STOP
5495AT_CLEANUP
5496
0a740f48
EJ
5497AT_SETUP([ofproto-dpif - patch ports])
5498OVS_VSWITCHD_START([add-br br1 \
5499-- set bridge br1 datapath-type=dummy fail-mode=secure \
5500-- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
5501-- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5502
5503ADD_OF_PORTS([br0], [2])
5504ADD_OF_PORTS([br1], [3])
5505
64bb477f
JS
5506AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5507], [])
aef0491b 5508AT_CHECK([ovs-appctl time/stop])
623540e4 5509AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9fc0165a 5510
0a740f48
EJ
5511AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
5512AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
5513
5514for i in $(seq 1 10); do
5515 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
5516 if [[ $i -eq 1 ]]; then
5517 sleep 1
5518 fi
0a740f48
EJ
5519done
5520
5521for i in $(seq 1 5); do
5522 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
5523 if [[ $i -eq 1 ]]; then
5524 sleep 1
5525 fi
0a740f48
EJ
5526done
5527
0a8763fc
EJ
5528AT_CHECK([ovs-appctl time/warp 500], [0],
5529[warped
735d7efb 5530])
732207ad 5531sleep 1 # wait for log writer
735d7efb 5532
0a740f48 5533AT_CHECK([ovs-appctl dpif/show], [0], [dnl
dc54ef36 5534dummy@ovs-dummy: hit:13 missed:2
e79a6c83 5535 br0:
dc54ef36
EJ
5536 br0 65534/100: (dummy)
5537 p2 2/2: (dummy)
5538 pbr0 1/none: (patch: peer=pbr1)
e79a6c83 5539 br1:
dc54ef36
EJ
5540 br1 65534/101: (dummy)
5541 p3 3/3: (dummy)
5542 pbr1 1/none: (patch: peer=pbr0)
0a740f48
EJ
5543])
5544
70e5ed6f 5545AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
16194afd
DDP
5546recirc_id=0,ip,in_port=100,nw_frag=no, actions:101,3,2
5547recirc_id=0,ip,in_port=101,nw_frag=no, actions:100,2,3
c2a77f33
JS
5548])
5549
70e5ed6f 5550AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
16194afd 5551skb_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 5552])
70e5ed6f 5553AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl
16194afd 5554skb_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
5555])
5556
5557AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
5558OFPST_PORT reply (xid=0x4): 1 ports
5559 port 1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
5560 tx pkts=10, bytes=600, drop=0, errs=0, coll=0
5561])
5562
5563AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
5564OFPST_PORT reply (xid=0x4): 1 ports
5565 port 1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
5566 tx pkts=5, bytes=300, drop=0, errs=0, coll=0
5567])
5568
5569OVS_VSWITCHD_STOP
5570AT_CLEANUP
655ab909 5571
1774d762
JR
5572AT_SETUP([ofproto-dpif - patch ports - stack])
5573OVS_VSWITCHD_START([add-br br1 \
5574-- set bridge br1 datapath-type=dummy fail-mode=secure \
5575-- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
5576-- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5577
5578ADD_OF_PORTS([br0], [2])
5579ADD_OF_PORTS([br1], [3])
5580
5581AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
5582], [])
5583AT_CHECK([ovs-appctl time/stop])
5584AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5585
5586AT_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"])
5587# Try to pop from empty stack, and push and leave data to stack.
5588AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"])
5589
5590ovs-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)'
5591
5592AT_CHECK([ovs-appctl time/warp 500], [0],
5593[warped
5594])
5595
5596OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1])
5597
5598AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5599dummy@ovs-dummy: hit:0 missed:1
5600 br0:
5601 br0 65534/100: (dummy)
5602 p2 2/2: (dummy)
5603 pbr0 1/none: (patch: peer=pbr1)
5604 br1:
5605 br1 65534/101: (dummy)
5606 p3 3/3: (dummy)
5607 pbr1 1/none: (patch: peer=pbr0)
5608])
5609
5610AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5611recirc_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
5612])
5613
5614AT_CHECK([cat ovs-vswitchd.log | grep -e '|nx_match|WARN|' | sed "s/^.*|WARN|//"], [0], [dnl
5615Failed to pop from an empty stack. On flow
5616])
5617
5618OVS_VSWITCHD_STOP(["/Failed to pop from an empty stack/d"])
5619AT_CLEANUP
5620
65e0be10
BP
5621AT_SETUP([ofproto-dpif - port duration])
5622OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
5623ADD_OF_PORTS([br0], 1, 2)
5624
31ef9f51 5625ovs-appctl time/stop
65e0be10
BP
5626ovs-appctl time/warp 10000
5627
5628AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
125bf01d 5629AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
65e0be10 5630[dnl
65e0be10 5631 duration=?s
65e0be10 5632 duration=?s
65e0be10
BP
5633 duration=?s
5634])
5635OVS_VSWITCHD_STOP
5636AT_CLEANUP
bcd2633a
JP
5637
5638dnl ----------------------------------------------------------------------
5639AT_BANNER([ofproto-dpif -- megaflows])
5640
bcd2633a
JP
5641AT_SETUP([ofproto-dpif megaflow - port classification])
5642OVS_VSWITCHD_START
623540e4 5643AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5644ADD_OF_PORTS([br0], [1], [2])
5645AT_DATA([flows.txt], [dnl
5646table=0 in_port=1 actions=output(2)
5647])
5648AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5649AT_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 5650sleep 1
bcd2633a 5651AT_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 5652sleep 1
c2a77f33 5653AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd 5654recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
bcd2633a
JP
5655])
5656OVS_VSWITCHD_STOP
5657AT_CLEANUP
5658
5659AT_SETUP([ofproto-dpif megaflow - L2 classification])
5660OVS_VSWITCHD_START
623540e4 5661AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5662ADD_OF_PORTS([br0], [1], [2])
5663AT_DATA([flows.txt], [dnl
5664table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
5665])
5666AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5667AT_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)'])
5668AT_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 5669sleep 1
c2a77f33 5670AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5671recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5672recirc_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
5673])
5674OVS_VSWITCHD_STOP
5675AT_CLEANUP
5676
5677AT_SETUP([ofproto-dpif megaflow - L3 classification])
5678OVS_VSWITCHD_START
623540e4 5679AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a 5680ADD_OF_PORTS([br0], [1], [2])
13751fd8 5681AT_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
5682AT_DATA([flows.txt], [dnl
5683table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
5684])
5685AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5686AT_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)'])
5687AT_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 5688sleep 1
c2a77f33 5689AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5690recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
5691recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
bcd2633a
JP
5692])
5693OVS_VSWITCHD_STOP
5694AT_CLEANUP
5695
13751fd8
JR
5696AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
5697OVS_VSWITCHD_START
623540e4 5698AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
13751fd8
JR
5699ADD_OF_PORTS([br0], [1], [2])
5700AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], [])
5701AT_DATA([flows.txt], [dnl
5702table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
5703])
5704AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5705AT_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)'])
5706AT_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 5707sleep 1
c2a77f33 5708AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd 5709recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:1:2:3:4:5,nw_frag=no, actions: <del>
d70e8c28 5710recirc_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
5711])
5712OVS_VSWITCHD_STOP
5713AT_CLEANUP
5714
bcd2633a
JP
5715AT_SETUP([ofproto-dpif megaflow - L4 classification])
5716OVS_VSWITCHD_START
623540e4 5717AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5718ADD_OF_PORTS([br0], [1], [2])
5719AT_DATA([flows.txt], [dnl
5720table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
5721])
5722AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5723AT_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 5724sleep 1
bcd2633a 5725AT_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 5726sleep 1
c2a77f33 5727AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd 5728recirc_id=0,icmp,in_port=1,nw_frag=no,icmp_type=0x8/0xff, actions: <del>
bcd2633a
JP
5729])
5730OVS_VSWITCHD_STOP
5731AT_CLEANUP
5732
5733AT_SETUP([ofproto-dpif megaflow - normal])
5734OVS_VSWITCHD_START
623540e4 5735AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5736ADD_OF_PORTS([br0], [1], [2])
5737AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5738AT_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)'])
5739AT_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 5740sleep 1
c2a77f33 5741AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5742recirc_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>
5743recirc_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
5744])
5745OVS_VSWITCHD_STOP
5746AT_CLEANUP
5747
5748AT_SETUP([ofproto-dpif megaflow - mpls])
5749OVS_VSWITCHD_START
623540e4 5750AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5751ADD_OF_PORTS([br0], [1], [2])
5752AT_DATA([flows.txt], [dnl
5753table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
5754table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
5755])
5756AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5757AT_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)'])
5758AT_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 5759sleep 1
c2a77f33 5760AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
22d38fca
JR
5761recirc_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>
5762recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:0b,mpls_bos=1, actions: <del>
bcd2633a
JP
5763])
5764OVS_VSWITCHD_STOP
5765AT_CLEANUP
5766
e731d71b
AS
5767# CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR, IP_VERSION_TYPE)
5768#
5769# IP_VERSION_TYPE is used in AT_SETUP
5770m4_define([CHECK_MEGAFLOW_NETFLOW],
5771 [AT_SETUP([ofproto-dpif megaflow - netflow - $2 collector])
5772 OVS_VSWITCHD_START
623540e4 5773 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
e731d71b
AS
5774 ADD_OF_PORTS([br0], [1], [2])
5775
5776 dnl NetFlow configuration disables wildcarding relevant fields
5777 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 5778 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 5779 AT_CAPTURE_FILE([netflow.log])
b52ecd96 5780 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
e731d71b
AS
5781 ovs-vsctl \
5782 set Bridge br0 netflow=@nf -- \
5783 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
5784 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
5785
5786 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5787 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)'])
5788 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)'])
5789 sleep 1
c2a77f33 5790 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5791recirc_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>
5792recirc_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 5793])
e731d71b
AS
5794 OVS_VSWITCHD_STOP
5795 AT_CLEANUP])
5796
5797CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
5798CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
bcd2633a
JP
5799
5800AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
5801OVS_VSWITCHD_START(
5802 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
5803 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
5804 set interface p2 type=dummy ofport_request=2 -- \
5805 set interface p3 type=dummy ofport_request=3])
5806AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5807])
623540e4 5808AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5809
5810AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5811AT_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)'])
5812AT_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 5813sleep 1
c2a77f33 5814AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5815recirc_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>
5816recirc_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
5817])
5818OVS_VSWITCHD_STOP
5819AT_CLEANUP
5820
5821AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
5822OVS_VSWITCHD_START(
5823 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
5824 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
5825 set interface p2 type=dummy ofport_request=2 -- \
5826 set interface p3 type=dummy ofport_request=3])
5827AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5828])
623540e4 5829AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5830
5831AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5832AT_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)'])
5833AT_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 5834sleep 1
c2a77f33 5835AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5836recirc_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>
5837recirc_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
5838])
5839OVS_VSWITCHD_STOP
5840AT_CLEANUP
5841
5842AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
5843# Create bond0 on br0 with interfaces p0 and p1
5844# and bond1 on br1 with interfaces p2 and p3
5845# with p0 patched to p2 and p1 patched to p3.
5846OVS_VSWITCHD_START(
5847 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
5848 other-config:lacp-time=fast \
5849 other-config:bond-rebalance-interval=0 -- \
5850 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
5851 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
5852 add-br br1 -- \
5853 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
5854 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
5855 fail-mode=secure -- \
5856 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
5857 other-config:lacp-time=fast \
5858 other-config:bond-rebalance-interval=0 -- \
5859 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
5860 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
5861
5862AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5863])
623540e4 5864AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5865ADD_OF_PORTS([br0], [7])
5866AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5867AT_CHECK([ovs-ofctl add-flow br1 action=normal])
31ef9f51 5868ovs-appctl time/stop
bcd2633a
JP
5869ovs-appctl time/warp 5000
5870AT_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)'])
5871AT_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 5872sleep 1
c2a77f33 5873AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5874recirc_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>
5875recirc_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
5876])
5877OVS_VSWITCHD_STOP
5878AT_CLEANUP
5879
5880AT_SETUP([ofproto-dpif megaflow - resubmit port action])
5881OVS_VSWITCHD_START
623540e4 5882AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5883ADD_OF_PORTS([br0], [1], [2])
5884AT_DATA([flows.txt], [dnl
5885table=0 in_port=1,ip actions=resubmit(90)
5886table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
5887])
5888AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5889AT_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)'])
5890AT_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 5891sleep 1
c2a77f33 5892AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5893recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5894recirc_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
5895])
5896OVS_VSWITCHD_STOP
5897AT_CLEANUP
5898
5899AT_SETUP([ofproto-dpif megaflow - resubmit table action])
5900OVS_VSWITCHD_START
623540e4 5901AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5902ADD_OF_PORTS([br0], [1], [2])
5903AT_DATA([flows.txt], [dnl
5904table=0 in_port=1,ip actions=resubmit(,1)
5905table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5906])
5907AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5908AT_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)'])
5909AT_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=
59101,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
ae692725 5911sleep 1
c2a77f33 5912AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5913recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5914recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
bcd2633a
JP
5915])
5916OVS_VSWITCHD_STOP
5917AT_CLEANUP
5918
5919AT_SETUP([ofproto-dpif megaflow - goto_table action])
5920OVS_VSWITCHD_START
623540e4 5921AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5922ADD_OF_PORTS([br0], [1], [2])
5923AT_DATA([flows.txt], [dnl
5924table=0 in_port=1,ip actions=goto_table(1)
5925table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5926])
5927AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
5928AT_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)'])
5929AT_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 5930sleep 1
c2a77f33 5931AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5932recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5933recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
bcd2633a
JP
5934])
5935OVS_VSWITCHD_STOP
5936AT_CLEANUP
5937
5938AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
5939OVS_VSWITCHD_START
623540e4 5940AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5941ADD_OF_PORTS([br0], [1], [2], [3])
5942ovs-vsctl \
5943 set Bridge br0 mirrors=@m --\
5944 --id=@p3 get Port p3 --\
5945 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
5946
5947AT_DATA([flows.txt], [dnl
5948in_port=1 actions=output:2
5949])
5950AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5951AT_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 5952sleep 1
bcd2633a 5953AT_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 5954sleep 1
c2a77f33 5955AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd 5956recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
bcd2633a
JP
5957])
5958OVS_VSWITCHD_STOP
5959AT_CLEANUP
5960
5961AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
5962OVS_VSWITCHD_START
623540e4 5963AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5964ADD_OF_PORTS([br0], [1], [2], [3])
5965ovs-vsctl \
5966 set Bridge br0 mirrors=@m --\
5967 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
5968 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
5969
5970AT_DATA([flows.txt], [dnl
5971in_port=1 actions=output:2
5972])
5973AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5974AT_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))'])
5975AT_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 5976sleep 1
c2a77f33 5977AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5978recirc_id=0,ip,in_port=1,dl_vlan=11,nw_frag=no, actions: <del>
5979recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,nw_frag=no, actions: <del>
bcd2633a
JP
5980])
5981OVS_VSWITCHD_STOP
5982AT_CLEANUP
5983
5984AT_SETUP([ofproto-dpif megaflow - move action])
5985OVS_VSWITCHD_START
623540e4 5986AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
5987ADD_OF_PORTS([br0], [1], [2])
5988AT_DATA([flows.txt], [dnl
5989table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
5990table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
5991table=0 in_port=91 reg0=0x0a000002,actions=output(2)
5992])
5993AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5994AT_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)'])
5995AT_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 5996sleep 1
c2a77f33 5997AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
5998recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
5999recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
bcd2633a
JP
6000])
6001OVS_VSWITCHD_STOP
6002AT_CLEANUP
6003
6004AT_SETUP([ofproto-dpif megaflow - push action])
6005OVS_VSWITCHD_START
623540e4 6006AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
6007ADD_OF_PORTS([br0], [1], [2])
6008AT_DATA([flows.txt], [dnl
6009table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
6010])
6011AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6012AT_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)'])
6013AT_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 6014sleep 1
c2a77f33 6015AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
6016recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
6017recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
bcd2633a
JP
6018])
6019OVS_VSWITCHD_STOP
6020AT_CLEANUP
6021
6022AT_SETUP([ofproto-dpif megaflow - learning])
6023OVS_VSWITCHD_START
623540e4 6024AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
bcd2633a
JP
6025ADD_OF_PORTS([br0], [1], [2])
6026AT_DATA([flows.txt], [dnl
6027table=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
6028])
6029AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
31ef9f51 6030ovs-appctl time/stop
956f2bf0
BP
6031# We send each packet twice because the first packet in each flow causes the
6032# flow table to change and thus revalidations, which (depending on timing)
6033# can keep a megaflow from being installed. The revalidations are done by
6034# the second iteration, allowing the flows to be installed.
6035for i in 1 2; do
6036 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)'])
6037 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)'])
6038 ovs-appctl time/warp 100
6039done
ae692725 6040sleep 1
bcd2633a 6041dnl The original flow is missing due to a revalidation.
c2a77f33 6042AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
6043recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
6044recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
bcd2633a
JP
6045])
6046OVS_VSWITCHD_STOP
6047AT_CLEANUP
d4f4a9b2
JP
6048
6049AT_SETUP([ofproto-dpif megaflow - tunnels])
6050OVS_VSWITCHD_START(
2c0ea78f 6051 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
623540e4 6052AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
2c0ea78f
GS
6053AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
6054 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
6055AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
6056 ofport_request=3])
6057AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
6058 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
6059 ofport_request=4 options:key=flow])
d4f4a9b2
JP
6060AT_DATA([flows.txt], [dnl
6061in_port=1,actions=output(2)
6062in_port=3,actions=output(4)
6063])
6064AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6065dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
6066dnl will cause the packet to be dropped.
6067AT_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 6068sleep 1
d4f4a9b2
JP
6069AT_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)'])
6070AT_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 6071sleep 1
d4f4a9b2 6072AT_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 6073sleep 1
c2a77f33 6074AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
6075recirc_id=0,ip,in_port=1,nw_ecn=1,nw_frag=no, actions: <del>
6076recirc_id=0,ip,in_port=3,nw_tos=0,nw_ecn=1,nw_ttl=64,nw_frag=no, actions: <del>
6077recirc_id=0,ip,in_port=3,nw_tos=252,nw_ecn=1,nw_ttl=128,nw_frag=no, actions: <del>
1dd35f8a
JP
6078])
6079OVS_VSWITCHD_STOP
6080AT_CLEANUP
6081
6082AT_SETUP([ofproto-dpif megaflow - dec_ttl])
6083OVS_VSWITCHD_START
623540e4 6084AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
1dd35f8a 6085ADD_OF_PORTS([br0], [1], [2])
13751fd8 6086AT_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
6087AT_DATA([flows.txt], [dnl
6088table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
6089])
6090AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6091AT_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)'])
6092AT_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 6093sleep 1
c2a77f33 6094AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
16194afd
DDP
6095recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_ttl=64,nw_frag=no, actions: <del>
6096recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
d4f4a9b2
JP
6097])
6098OVS_VSWITCHD_STOP
6099AT_CLEANUP
74cc3969 6100
f74e7df7
JP
6101AT_SETUP([ofproto-dpif megaflow - set dl_dst])
6102OVS_VSWITCHD_START
623540e4 6103AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
f74e7df7
JP
6104ADD_OF_PORTS([br0], [1], [2])
6105AT_DATA([flows.txt], [dnl
6106table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
6107])
6108AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6109AT_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)'])
6110AT_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 6111sleep 1
d23df9a8
JR
6112dnl The first packet is essentially a no-op, as the new destination MAC is the
6113dnl same as the original. The second entry actually updates the destination
6114dnl MAC.
70e5ed6f 6115AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
16194afd
DDP
6116recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions:2
6117recirc_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
6118])
6119OVS_VSWITCHD_STOP
6120AT_CLEANUP
6121
8c301900
JR
6122AT_SETUP([ofproto-dpif megaflow - disabled])
6123OVS_VSWITCHD_START
623540e4 6124AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8c301900
JR
6125ADD_OF_PORTS([br0], [1], [2])
6126AT_DATA([flows.txt], [dnl
6127table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
6128table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
6129])
e79a6c83 6130AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
8c301900 6131], [])
64bb477f
JS
6132AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
6133], [])
8c301900
JR
6134AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
6135AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6136for i in 1 2 3 4; do
6137 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)'])
6138 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
6139 if [[ $i -eq 1 ]]; then
6140 sleep 1
6141 fi
8c301900 6142done
ae692725 6143sleep 1
70e5ed6f 6144AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
330de069
JR
6145pkt_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
6146pkt_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 6147])
70e5ed6f 6148AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_DUMP | grep 'packets:3'], [0], [dnl
7d170098 6149skb_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 6150skb_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
6151])
6152OVS_VSWITCHD_STOP
6153AT_CLEANUP
6154
74cc3969
BP
6155AT_SETUP([ofproto-dpif - datapath port number change])
6156OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6157ADD_OF_PORTS([br0], 1)
6158
6159# Trace a flow that should output to p1.
6160AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6161 [0], [stdout])
6162AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
6163])
6164
6165# Change p1's port number to 5.
6166AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
6167
6168# Trace a flow that should output to p1 in its new location.
6169AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6170 [0], [stdout])
6171AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
6172])
6173OVS_VSWITCHD_STOP
6174AT_CLEANUP
2d344ba5
AW
6175
6176# Tests the bundling with various bfd and cfm configurations.
6177AT_SETUP([ofproto - bundle with variable bfd/cfm config])
6178OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
6179 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
6180 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
6181 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
6182 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
6183 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
6184 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
6185 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
6186 set Interface p0 cfm_mpid=1 -- \
6187 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
6188
6189ovs-appctl time/stop
6190# advance the clock to stablize everything.
bdba1947 6191ovs-appctl time/warp 5000 100
2d344ba5
AW
6192# cfm/show should show 'recv' fault.
6193AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6194 fault: recv
6195])
6196# bfd/show should show 'up'.
6197AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6198 Local Session State: up
6199 Remote Session State: up
6200 Local Session State: up
6201 Remote Session State: up
6202])
6203# bond/show should show 'may-enable: true' for all slaves.
6204AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6205 may_enable: true
6206 may_enable: true
6207 may_enable: true
6208 may_enable: true
6209])
6210
6211# now disable the bfd on p1.
6212AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
6213# advance the clock to stablize everything.
bdba1947 6214ovs-appctl time/warp 5000 100
2d344ba5
AW
6215# cfm/show should show 'recv' fault.
6216AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6217 fault: recv
6218])
6219# bfd/show should show 'down'.
6220AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6221 Local Session State: down
6222 Remote Session State: down
6223])
6224# bond/show should show 'may-enable: false' for p0.
125bf01d 6225AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
2d344ba5
AW
6226 may_enable: false
6227 may_enable: true
2d344ba5
AW
6228])
6229
6230# now enable the bfd on p1 and disable bfd on p0.
6231AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
6232AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
6233# advance the clock to stablize everything.
bdba1947 6234ovs-appctl time/warp 5000 100
2d344ba5
AW
6235# cfm/show should show 'recv' fault.
6236AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
6237 fault: recv
6238])
6239# bfd/show should show 'down'.
6240AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
6241 Local Session State: down
6242 Remote Session State: down
6243])
6244# bond/show should show 'may-enable: false' for p0 and p1.
6245AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
6246 may_enable: false
6247 may_enable: true
6248 may_enable: false
6249 may_enable: true
6250])
6251
e441a806
AW
6252OVS_VSWITCHD_STOP
6253AT_CLEANUP
6254
6255AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
6256OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
6257
6258# enable bfd on p0.
6259AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
6260# check log.
1335a8d5 6261OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
6262# disable bfd on p0.
6263AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
6264# check log.
1335a8d5 6265OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
6266AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
6267
6268# enable cfm on p0.
6269AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
6270# check log.
1335a8d5 6271OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
6272# disable cfm on p0.
6273AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
6274# check log.
1335a8d5 6275OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
6276AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
6277
6278# enable both bfd and cfm on p0.
6279AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
6280# check log.
1335a8d5 6281OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
6282# disable bfd on p0.
6283AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
6284# check log, there should not be the log of thread terminated.
738cd849 6285AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
e441a806
AW
6286])
6287# reenable bfd on p0.
6288AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
6289# check log, should still be on log of thread created.
738cd849 6290AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
e441a806
AW
6291monitor thread created
6292])
6293# disable bfd and cfm together.
6294AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
6295# check log.
1335a8d5 6296OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
6297
6298OVS_VSWITCHD_STOP
6299AT_CLEANUP
6300
6301# this test helps avoid the deadlock between the main thread and monitor thread.
6302AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
6303OVS_VSWITCHD_START
6304
6305for i in `seq 1 199`
6306do
6307 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])
6308done
6309
98cf638b
AW
6310OVS_VSWITCHD_STOP
6311AT_CLEANUP
98b07853
BP
6312\f
6313AT_BANNER([ofproto-dpif - flow translation resource limits])
6314
6315AT_SETUP([ofproto-dpif - infinite resubmit])
6316OVS_VSWITCHD_START
6317AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
222820c6 6318AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
98b07853
BP
6319 [0], [stdout])
6320AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
6321])
6322AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
6323 [0], [1
6324])
6325OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
6326AT_CLEANUP
6327
6328AT_SETUP([ofproto-dpif - exponential resubmit chain])
6329OVS_VSWITCHD_START
6330ADD_OF_PORTS([br0], 1)
6331(for i in `seq 1 64`; do
6332 j=`expr $i + 1`
6333 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6334 done
6335 echo "in_port=65, actions=local") > flows
6336 AT_CHECK([ovs-ofctl add-flows br0 flows])
222820c6 6337AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
98b07853
BP
6338AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
6339])
6340OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
6341AT_CLEANUP
6342
6343AT_SETUP([ofproto-dpif - too many output actions])
6344OVS_VSWITCHD_START
6345ADD_OF_PORTS([br0], 1)
6346(for i in `seq 1 12`; do
6347 j=`expr $i + 1`
6348 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6349 done
6350 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
542024c4 6351AT_CHECK([ovs-ofctl add-flows br0 flows])
222820c6 6352AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
0f032e95
BP
6353AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
6354 [0], [1
98b07853 6355])
0f032e95 6356AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
542024c4 6357])
0f032e95 6358OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
98b07853
BP
6359AT_CLEANUP
6360
6361AT_SETUP([ofproto-dpif - stack too deep])
6362OVS_VSWITCHD_START
6363ADD_OF_PORTS([br0], 1)
6364(for i in `seq 1 12`; do
6365 j=`expr $i + 1`
6366 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
6367 done
6368 push="push:NXM_NX_REG0[[]]"
6369 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
6370 AT_CHECK([ovs-ofctl add-flows br0 flows])
222820c6 6371AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
98b07853
BP
6372AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
6373])
6374OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
6375AT_CLEANUP
d611866c
SH
6376
6377
2608616d 6378AT_SETUP([ofproto-dpif packet-out controller])
d611866c
SH
6379OVS_VSWITCHD_START
6380ADD_OF_PORTS([br0], 1, 2)
6381
6382AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
6383
6384AT_CAPTURE_FILE([ofctl_monitor.log])
6385AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6386
6387for i in 1 2 3; do
6388 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
6389done
6390
6391OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6392AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6393NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
78c9486d 6394in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6395dnl
6396NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
78c9486d 6397in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6398dnl
6399NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
78c9486d 6400in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6401])
6402
6403AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
6404 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6405NXST_FLOW reply:
6406])
6407
3c1bb396
BP
6408(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6409 table 0:
6410 active=1, lookup=0, matched=0"
d611866c
SH
6411 x=1
6412 while test $x -lt 254; do
3c1bb396
BP
6413 echo "
6414 table $x:
6415 active=0, lookup=0, matched=0"
d611866c
SH
6416 x=`expr $x + 1`
6417 done) > expout
6418AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6419
6420OVS_VSWITCHD_STOP
6421AT_CLEANUP
6422
2608616d 6423AT_SETUP([ofproto-dpif packet-out controller (patch port)])
d611866c
SH
6424OVS_VSWITCHD_START(
6425 [-- \
6426 add-port br0 p1 -- \
6427 set interface p1 type=patch options:peer=p2 -- \
6428 add-br br1 -- \
6429 set bridge br1 datapath-type=dummy -- \
6430 set bridge br1 fail-mode=secure -- \
6431 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
6432 add-port br1 p2 -- \
6433 set interface p2 type=patch options:peer=p1 --])
6434
6435AT_CAPTURE_FILE([ofctl_monitor.log])
6436AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6437
6438for i in 1 2 3; do
6439 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
6440done
6441
6442OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6443AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6444NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
78c9486d 6445in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6446dnl
6447NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
78c9486d 6448in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6449dnl
6450NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
78c9486d 6451in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6452])
6453
3c1bb396 6454(printf "OFPST_TABLE reply (OF1.3) (xid=0x2):"
d611866c
SH
6455 x=0
6456 while test $x -lt 254; do
3c1bb396
BP
6457 echo "
6458 table $x:
6459 active=0, lookup=0, matched=0"
d611866c
SH
6460 x=`expr $x + 1`
6461 done) > expout
6462AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6463
3c1bb396
BP
6464(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6465 table 0:
6466 active=0, lookup=3, matched=0"
d611866c
SH
6467 x=1
6468 while test $x -lt 254; do
3c1bb396
BP
6469 echo "
6470 table $x:
6471 active=0, lookup=0, matched=0"
d611866c
SH
6472 x=`expr $x + 1`
6473 done) > expout
6474AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
6475
6476OVS_VSWITCHD_STOP
6477AT_CLEANUP
6478
6479
2608616d 6480AT_SETUP([ofproto-dpif packet-out goto_table])
d611866c
SH
6481OVS_VSWITCHD_START
6482ADD_OF_PORTS([br0], 1, 2)
6483
6484AT_DATA([flows.txt], [dnl
6485table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
6486table=1 dl_dst=50:54:00:00:00:0a actions=controller
6487])
6488AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
6489
6490AT_CAPTURE_FILE([ofctl_monitor.log])
6491AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6492
6493for i in 1 2 3; do
6494 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)'
6495done
6496
6497OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6498OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6499AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6500NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6501in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6502dnl
6503NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6504in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6505dnl
6506NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6507in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6508])
6509
cea4a6d7 6510AT_CHECK([ovs-appctl revalidator/purge], [0])
d611866c
SH
6511AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
6512 n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
6513 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
6514OFPST_FLOW reply (OF1.3):
6515])
6516
3c1bb396
BP
6517(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6518 table 0:
6519 active=1, lookup=3, matched=3
6520
6521 table 1:
6522 active=1, lookup=3, matched=3"
d611866c
SH
6523 x=2
6524 while test $x -lt 254; do
3c1bb396
BP
6525 echo "
6526 table $x:
6527 active=0, lookup=0, matched=0"
d611866c
SH
6528 x=`expr $x + 1`
6529 done) > expout
6530AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6531
6532OVS_VSWITCHD_STOP
6533AT_CLEANUP
6534
6535
2608616d 6536AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
d611866c
SH
6537OVS_VSWITCHD_START
6538ADD_OF_PORTS([br0], 1, 2)
6539
3c1bb396
BP
6540AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
6541AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
d611866c
SH
6542
6543AT_CAPTURE_FILE([ofctl_monitor.log])
6544AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6545
6546for i in 1 2 3; do
6547 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)'
6548done
6549
6550OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6551OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6552AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6553NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6554in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6555dnl
6556NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6557in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6558dnl
6559NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
78c9486d 6560in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
d611866c
SH
6561])
6562
cea4a6d7 6563AT_CHECK([ovs-appctl revalidator/purge], [0])
3c1bb396 6564AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
d611866c 6565 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
3c1bb396 6566OFPST_FLOW reply (OF1.1):
d611866c
SH
6567])
6568
3c1bb396
BP
6569(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
6570 table 0:
6571 active=0, lookup=3, matched=0
6572
6573 table 1:
6574 active=1, lookup=3, matched=3"
d611866c
SH
6575 x=2
6576 while test $x -lt 254; do
3c1bb396
BP
6577 echo "
6578 table $x:
6579 active=0, lookup=0, matched=0"
d611866c
SH
6580 x=`expr $x + 1`
6581 done) > expout
6582AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
6583
6584OVS_VSWITCHD_STOP
6585AT_CLEANUP
b0e2ec32
JR
6586
6587AT_SETUP([ofproto-dpif - ICMPv6])
6588OVS_VSWITCHD_START
6589ADD_OF_PORTS([br0], 1)
6590
6591AT_CAPTURE_FILE([ofctl_monitor.log])
6592
6593AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6594
6595ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
6596
6597OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6598
6599AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6600NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
e60e935b 6601icmp6,in_port=0,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::260:97ff:fe07:69ea,nd_sll=00:00:86:05:80:da,nd_tll=00:00:00:00:00:00 icmp6_csum:68bd
b0e2ec32
JR
6602])
6603
6604OVS_VSWITCHD_STOP
6605AT_CLEANUP
e60e935b
SRCSA
6606
6607AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update])
6608OVS_VSWITCHD_START
6609ADD_OF_PORTS([br0], 1)
6610AT_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])
6611
6612AT_CAPTURE_FILE([ofctl_monitor.log])
6613
6614AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
6615
6616ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
6617
6618OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
6619
6620AT_CHECK([cat ofctl_monitor.log], [0], [dnl
6621NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered)
6622icmp6,in_port=0,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::1,nd_sll=32:21:14:86:11:74,nd_tll=00:00:00:00:00:00 icmp6_csum:19d3
6623])
6624
6625OVS_VSWITCHD_STOP
6626AT_CLEANUP
6627