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