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