]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ofproto-dpif.at
tests: Fix race in 'balance-tcp bonding' test.
[mirror_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])
c2a77f33 26AT_CHECK([ovs-appctl vlog/set dpif: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)'])
43ovs-appctl time/warp 100
44ovs-appctl time/warp 100
53555f51 45sleep 1
c2a77f33 46AT_CHECK([cat ovs-vswitchd.log | grep 'in_port([[348]])' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
47skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
48skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
49skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
50skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
51skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:09/00:00:00:00:00:00,tha=50:54:00:00:00:09/00:00:00:00:00:00), actions: <del>
52skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:0b,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:0b/00:00:00:00:00:00,tha=50:54:00:00:00:0b/00:00:00:00:00:00), actions: <del>
adcf00ba
AZ
53])
54OVS_VSWITCHD_STOP
55AT_CLEANUP
56
57AT_SETUP([ofproto-dpif, balance-slb bonding])
58# Create br0 with interfaces bond0(p1, p2, p3) and p7,
59# and br1 with interfaces p4, p5, p6 and p8.
60# p1 <-> p4, p2 <-> p5, p3 <-> p6
61# Send some traffic, make sure the traffic are spread based on source mac.
62OVS_VSWITCHD_START(
63 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
64 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
65 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
66 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
67 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
68 add-br br1 -- \
69 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
70 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
71 fail-mode=secure -- \
72 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
73 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
74 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
75 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
55466d72 76WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
adcf00ba
AZ
77AT_CHECK([ovs-ofctl add-flow br0 action=normal])
78AT_CHECK([ovs-ofctl add-flow br1 action=normal])
79AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
80])
adcf00ba
AZ
81ovs-appctl time/stop
82ovs-appctl time/warp 100
83(
84for i in `seq 0 100 |xargs printf '%02x\n'`;
85 do
86 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)"
87 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
88 done
89)
90ovs-appctl time/warp 100
91AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
92# Make sure there is resonable distribution to all three ports.
93# We don't want to make this check precise, in case hash function changes.
94AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
95AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
96AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
97OVS_VSWITCHD_STOP
98AT_CLEANUP
99
100AT_SETUP([ofproto-dpif, balance-tcp bonding])
101# Create br0 with interfaces bond0(p1, p2, p3) and p7,
102# and br1 with interfaces bond1(p4, p5, p6) and p8.
103# bond0 <-> bond1
104# Send some traffic, make sure the traffic are spread based on L4 headers.
105OVS_VSWITCHD_START(
106 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
107 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
108 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
109 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
110 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
111 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
112 add-br br1 -- \
113 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
114 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
115 fail-mode=secure -- \
116 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
117 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
118 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
119 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
120 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
121 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
122AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
123])
124AT_CHECK([ovs-ofctl add-flow br0 action=normal])
125AT_CHECK([ovs-ofctl add-flow br1 action=normal])
126AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
127], [])
48105e85 128OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
adcf00ba
AZ
129ovs-appctl time/stop
130ovs-appctl time/warp 100
131ovs-appctl lacp/show > lacp.txt
132ovs-appctl bond/show > bond.txt
133(
25d6a6a8 134for i in `seq 0 255` ;
adcf00ba
AZ
135 do
136 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(0x010)"
137 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
138 done
139)
140ovs-appctl time/warp 100
141ovs-appctl time/warp 100
142ovs-appctl time/warp 100
143AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
144AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
145# Make sure there is resonable distribution to all three ports.
146# We don't want to make this check precise, in case hash function changes.
fd184489
AZ
147AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
148AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
149AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
adcf00ba
AZ
150OVS_VSWITCHD_STOP()
151AT_CLEANUP
152
29901626 153AT_SETUP([ofproto-dpif - resubmit])
023e1e0a 154OVS_VSWITCHD_START
f7b8e494
JP
155ADD_OF_PORTS([br0], [1], [10], [11], [12], [13], [14], [15],
156 [16], [17], [18], [19], [20], [21])
29901626
BP
157AT_DATA([flows.txt], [dnl
158table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
159table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
160table=0 in_port=3 priority=2000 icmp actions=output(20)
161table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
162table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
163table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
164])
165AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
31a19d69 166AT_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
167AT_CHECK([tail -1 stdout], [0],
168 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
169])
023e1e0a 170OVS_VSWITCHD_STOP
29901626 171AT_CLEANUP
58a89177 172
55599423
JR
173AT_SETUP([ofproto-dpif - goto table])
174OVS_VSWITCHD_START
175ADD_OF_PORTS([br0], [1], [10], [11])
176echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
4468099e
EJ
177for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
178echo "table=64 actions=output(11)" >> flows.txt
55599423
JR
179AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
180AT_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])
181AT_CHECK([tail -1 stdout], [0],
182 [Datapath actions: 10,11
183])
184OVS_VSWITCHD_STOP
185AT_CLEANUP
186
7fdb60a7
SH
187AT_SETUP([ofproto-dpif - write actions])
188OVS_VSWITCHD_START
189ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
190AT_DATA([flows.txt], [dnl
191table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
192table=1 ip actions=write_actions(output(13)),goto_table(2)
193table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
194])
195AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
196AT_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
JR
197AT_CHECK([tail -2 stdout], [0],
198 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128
199Datapath actions: 10,set(ipv4(src=192.168.3.91,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11,set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),13
7fdb60a7
SH
200])
201OVS_VSWITCHD_STOP
202AT_CLEANUP
203
204AT_SETUP([ofproto-dpif - clear actions])
205OVS_VSWITCHD_START
206ADD_OF_PORTS([br0], [1], [10], [11], [12])
207AT_DATA([flows.txt], [dnl
208table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
ce58df5b 209table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
7fdb60a7
SH
210])
211AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
ce58df5b
JR
212AT_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])
213AT_CHECK([tail -2 stdout], [0],
214 [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_frag=no,tp_src=8,tp_dst=9
215Datapath actions: 10,set(tcp(src=91,dst=9)),11
7fdb60a7
SH
216])
217OVS_VSWITCHD_STOP
218AT_CLEANUP
219
5a070238
BP
220AT_SETUP([ofproto-dpif - group chaining not supported])
221OVS_VSWITCHD_START
222ADD_OF_PORTS([br0], [1], [10], [11])
223AT_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'],
224 [1], [], [stderr])
225AT_CHECK([STRIP_XIDS stderr | sed 1q], [0],
226 [OFPT_ERROR (OF1.2): OFPGMFC_CHAINING_UNSUPPORTED
227])
228OVS_VSWITCHD_STOP
229AT_CLEANUP
230
f4fb341b
SH
231AT_SETUP([ofproto-dpif - all group in action list])
232OVS_VSWITCHD_START
233ADD_OF_PORTS([br0], [1], [10], [11])
234AT_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'])
235AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
236AT_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
JR
237AT_CHECK([tail -2 stdout], [0],
238 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128
239Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11
f4fb341b
SH
240])
241OVS_VSWITCHD_STOP
242AT_CLEANUP
243
244AT_SETUP([ofproto-dpif - indirect group in action list])
245OVS_VSWITCHD_START
246ADD_OF_PORTS([br0], [1], [10])
247AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
248AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
249AT_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])
250AT_CHECK([tail -1 stdout], [0],
251 [Datapath actions: 10
252])
253OVS_VSWITCHD_STOP
254AT_CLEANUP
255
256AT_SETUP([ofproto-dpif - all group in action set])
257OVS_VSWITCHD_START
258ADD_OF_PORTS([br0], [1], [10], [11])
259AT_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'])
260AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
261AT_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
JR
262AT_CHECK([tail -2 stdout], [0],
263 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128
264Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11
f4fb341b
SH
265])
266OVS_VSWITCHD_STOP
267AT_CLEANUP
268
269AT_SETUP([ofproto-dpif - indirect group in action set])
270OVS_VSWITCHD_START
271ADD_OF_PORTS([br0], [1], [10])
272AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
273AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
274AT_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])
275AT_CHECK([tail -1 stdout], [0],
276 [Datapath actions: 10
277])
278OVS_VSWITCHD_STOP
279AT_CLEANUP
280
fe7e5749
SH
281AT_SETUP([ofproto-dpif - select group])
282OVS_VSWITCHD_START
283ADD_OF_PORTS([br0], [1], [10], [11])
284AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
285AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
7cb279c2
SH
286
287# Try a bunch of different flows and make sure that they get distributed
288# at least somewhat.
289for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
290 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])
291 tail -1 stdout >> results
292done
293sort results | uniq -c
294AT_CHECK([sort results | uniq], [0],
fe7e5749 295 [Datapath actions: 10
7cb279c2 296Datapath actions: 11
fe7e5749
SH
297])
298OVS_VSWITCHD_STOP
299AT_CLEANUP
300
301AT_SETUP([ofproto-dpif - select group with watch port])
302OVS_VSWITCHD_START
303ADD_OF_PORTS([br0], [1], [10], [11])
304AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
305AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
306AT_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])
307AT_CHECK([tail -1 stdout], [0],
308 [Datapath actions: 11
309])
310OVS_VSWITCHD_STOP
311AT_CLEANUP
312
7cb279c2
SH
313AT_SETUP([ofproto-dpif - select group with weight])
314OVS_VSWITCHD_START
315ADD_OF_PORTS([br0], [1], [10], [11], [12])
125bf01d 316AT_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
317AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
318AT_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])
319AT_CHECK([tail -1 stdout], [0],
320 [Datapath actions: 11
321])
322OVS_VSWITCHD_STOP
323AT_CLEANUP
324
dd8cd4b4
SH
325AT_SETUP([ofproto-dpif - fast failover group])
326OVS_VSWITCHD_START
327ADD_OF_PORTS([br0], [1], [10], [11])
328AT_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'])
329AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
330AT_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])
331AT_CHECK([tail -1 stdout], [0],
332 [Datapath actions: drop
333])
334OVS_VSWITCHD_STOP
335AT_CLEANUP
336
b2af3288
AZ
337AT_SETUP([ofproto-dpif - group stats single bucket])
338OVS_VSWITCHD_START
339ADD_OF_PORTS([br0], [1], [10], [11])
340AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
341AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
342(
343for i in `seq 0 2`;
344 do
345 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)"
346 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
347 done
348)
349ovs-appctl time/warp 100
27f57736 350ovs-appctl revalidator/wait
b2af3288
AZ
351AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
352AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
353 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
354OFPST_GROUP reply (OF1.2):
355])
356OVS_VSWITCHD_STOP
357AT_CLEANUP
358
359AT_SETUP([ofproto-dpif - group stats all buckets])
360OVS_VSWITCHD_START
361ADD_OF_PORTS([br0], [1], [10], [11])
362AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
363AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
364(
365for i in `seq 0 2`;
366 do
367 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)"
368 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
369 done
370)
371ovs-appctl time/warp 100
27f57736 372ovs-appctl revalidator/wait
b2af3288
AZ
373AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
374AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
375 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
376OFPST_GROUP reply (OF1.2):
377])
378OVS_VSWITCHD_STOP
379AT_CLEANUP
380
58a89177 381AT_SETUP([ofproto-dpif - registers])
023e1e0a 382OVS_VSWITCHD_START
f7b8e494 383ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
58a89177
EJ
384AT_DATA([flows.txt], [dnl
385in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
386in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
e9358af6
EJ
387in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
388in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
389
58a89177
EJ
390in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
391in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
392in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
393in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
394in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
395in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
396in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
397in_port=9,reg0=0xdeadbeef actions=output:20
398in_port=10,reg1=0xdeadbeef actions=output:21
399in_port=11,reg2=0xeef22dea actions=output:22
e9358af6
EJ
400
401dnl Sanilty check all registers
402in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
403in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
404in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
405in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
bd85dac1 406
58a89177
EJ
407])
408AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 409AT_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 410AT_CHECK([tail -1 stdout], [0],
e9358af6 411 [Datapath actions: 20,21,22,33
58a89177 412])
023e1e0a 413OVS_VSWITCHD_STOP
58a89177 414AT_CLEANUP
f694937d 415
bd85dac1
AZ
416AT_SETUP([ofproto-dpif - push-pop])
417OVS_VSWITCHD_START
418ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
419AT_DATA([flows.txt], [dnl
420in_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
421in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
422in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
423in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
424in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
425
426])
427AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 428AT_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
429AT_CHECK([tail -1 stdout], [0],
430 [Datapath actions: 33,22,21,20
431])
432OVS_VSWITCHD_STOP
433AT_CLEANUP
434
f694937d 435AT_SETUP([ofproto-dpif - output])
023e1e0a 436OVS_VSWITCHD_START
f7b8e494 437ADD_OF_PORTS([br0], [1], [9], [10], [11], [55], [66], [77], [88])
f694937d 438AT_DATA([flows.txt], [dnl
557323cd 439in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
f694937d
EJ
440in_port=2 actions=output:9
441in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
442in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
443in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
444in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
445in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
557323cd 446in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
f694937d
EJ
447])
448AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 449AT_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 450AT_CHECK([tail -1 stdout], [0],
557323cd 451 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
f694937d 452])
023e1e0a 453OVS_VSWITCHD_STOP
f694937d 454AT_CLEANUP
8e9ce036 455
f0fd1a17
PS
456AT_SETUP([ofproto-dpif - dec_ttl])
457OVS_VSWITCHD_START
f7b8e494 458ADD_OF_PORTS([br0], [1], [2], [3], [4])
f0fd1a17
PS
459AT_DATA([flows.txt], [dnl
460table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
461table=1 in_port=1 action=dec_ttl,output:3
462])
463AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8249a1fe 464AT_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
JR
465AT_CHECK([tail -4 stdout], [0],
466 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=2
467Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),2,4
6a7e895f
BP
468This flow is handled by the userspace slow path because it:
469 - Sends "packet-in" messages to the OpenFlow controller.
f0fd1a17 470])
8249a1fe 471AT_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
JR
472AT_CHECK([tail -2 stdout], [0],
473 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=3
474Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)),2,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),3,4
f0fd1a17 475])
50aa28fd 476AT_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
JR
477AT_CHECK([tail -2 stdout], [0],
478 [Megaflow: recirc_id=0,skb_priority=0,ipv6,in_port=1,ipv6_src=::1,ipv6_dst=::2,ipv6_label=0x00000,nw_proto=10,nw_tos=112,nw_ecn=0,nw_ttl=128
479Datapath actions: set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=127,frag=no)),2,set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=126,frag=no)),3,4
f0fd1a17
PS
480])
481
982697a4 482AT_CAPTURE_FILE([ofctl_monitor.log])
77a922c7 483AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8249a1fe 484AT_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
485OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
486AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8249a1fe
JR
487NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
488ip,metadata=0,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
489])
490OVS_VSWITCHD_STOP
491AT_CLEANUP
492
65bfce4a
SH
493dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
494dnl buffer to be resized just before pushing the id of the dec_ttl action.
495dnl Thus the implementation must account for this by using the
496dnl reallocated buffer rather than the original buffer.
497dnl
498dnl A number of similar rules are added to try and exercise
499dnl xrealloc sufficiently that it returns a different base pointer
500AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
501OVS_VSWITCHD_START
502ADD_OF_PORTS([br0], [1])
503(for i in `seq 0 255`; do
504 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
505 done) > flows.txt
506AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
507OVS_VSWITCHD_STOP
508AT_CLEANUP
509
510dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
511dnl buffer to be resized just before pushing the id of the dec_ttl action.
512dnl Thus the implementation must account for this by using the
513dnl reallocated buffer rather than the original buffer.
514dnl
515dnl A number of similar rules are added to try and exercise
516dnl xrealloc sufficiently that it returns a different base pointer
517AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
518OVS_VSWITCHD_START
519ADD_OF_PORTS([br0], [1])
520(for i in `seq 0 255`; do
521 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
522 done) > flows.txt
523AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
524OVS_VSWITCHD_STOP
525AT_CLEANUP
526
527dnl A note action at offset 24 in ofpacts will cause the ofpacts
528dnl buffer to be resized just before pushing the id of the dec_ttl action.
529dnl Thus the implementation must account for this by using the
530dnl reallocated buffer rather than the original buffer.
531dnl
532dnl A number of similar rules are added to try and exercise
533dnl xrealloc sufficiently that it returns a different base pointer
534AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
535OVS_VSWITCHD_START
536ADD_OF_PORTS([br0], [1])
537(for i in `seq 0 255`; do
538 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
539 done) > flows.txt
540AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
541OVS_VSWITCHD_STOP
542AT_CLEANUP
f0fd1a17 543
77750738 544AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
e44768b7
JP
545OVS_VSWITCHD_START
546ADD_OF_PORTS([br0], [1], [2])
77750738 547
77750738
JP
548AT_CHECK([ovs-ofctl add-flow br0 action=normal])
549
550# "in_port" defaults to OFPP_NONE if it's not specified.
72d64e33 551flow="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 552AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
72d64e33
EJ
553AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
5541
5552
556100
557])
77750738
JP
558
559OVS_VSWITCHD_STOP
560AT_CLEANUP
561
8b36f51e 562AT_SETUP([ofproto-dpif - DSCP])
8b36f51e 563OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
72d64e33 564ADD_OF_PORTS([br0], [9])
8b36f51e 565AT_DATA([flows.txt], [dnl
bdda5aca 566actions=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
567])
568AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
569AT_CHECK([ovs-vsctl -- \
570 set Port p1 qos=@newqos --\
571 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
572 --id=@q1 create Queue dscp=1 --\
573 --id=@q2 create Queue dscp=2], [0], [ignore])
50aa28fd 574AT_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
JR
575AT_CHECK([tail -2 stdout], [0],
576 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=9,nw_src=1.1.1.1,nw_dst=2.2.2.2,nw_tos=252,nw_ecn=3,nw_ttl=128
577Datapath actions: dnl
e44768b7 578100,dnl
1b567fb9
AA
579set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,dnl
580set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xb,ttl=128,frag=no)),set(skb_priority(0x2)),1,dnl
8b36f51e 5811,dnl
1b567fb9
AA
582set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,dnl
583set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no)),set(skb_priority(0)),1,dnl
8b36f51e 584set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x3,ttl=128,frag=no)),1,dnl
e44768b7 585100
8b36f51e
EJ
586])
587OVS_VSWITCHD_STOP
588AT_CLEANUP
589
fd19297b 590AT_SETUP([ofproto-dpif - output/flood flags])
f7b8e494
JP
591OVS_VSWITCHD_START
592ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
fd19297b
EJ
593
594AT_DATA([flows.txt], [dnl
a0fbe94a 595in_port=local actions=local,flood
fd19297b
EJ
596in_port=1 actions=flood
597in_port=2 actions=all
bdda5aca
BP
598in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
599in_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
600])
601AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
602AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
603AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
604
50aa28fd 605AT_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
606AT_CHECK([tail -1 stdout \
607| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
6081
6092
6103
6114
6127
613])
614
50aa28fd 615AT_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
616AT_CHECK([tail -1 stdout \
617| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
e44768b7 618100
fd19297b
EJ
6192
6203
6214
6227
623])
624
50aa28fd 625AT_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
626AT_CHECK([tail -1 stdout \
627| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
fd19297b 6281
e44768b7 629100
fd19297b
EJ
6303
6314
6326
6337
634])
635
50aa28fd 636AT_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 637AT_CHECK([tail -1 stdout], [0],
e44768b7 638 [Datapath actions: 100,1,2,4,6,7
fd19297b
EJ
639])
640
50aa28fd 641AT_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 642AT_CHECK([tail -1 stdout], [0],
1b567fb9 643 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
fd19297b
EJ
644])
645OVS_VSWITCHD_STOP
646AT_CLEANUP
647
6b83a3c5 648AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
6d328fa2
SH
649OVS_VSWITCHD_START([dnl
650 add-port br0 p1 -- set Interface p1 type=dummy
651])
652ON_EXIT([kill `cat ovs-ofctl.pid`])
653
654AT_CAPTURE_FILE([ofctl_monitor.log])
655
656AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
657
658for i in 1 2 3 ; do
659 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)'
660done
8bd16974 661OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
662OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
663AT_CHECK([cat ofctl_monitor.log], [0], [dnl
664NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
665tcp,metadata=0,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=0x010 tcp_csum:0
666dnl
667NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
668tcp,metadata=0,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=0x010 tcp_csum:0
669dnl
670NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
671tcp,metadata=0,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=0x010 tcp_csum:0
672])
673
674AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
675AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
676NXST_FLOW reply:
677])
678
679OVS_VSWITCHD_STOP
680AT_CLEANUP
681
6b83a3c5
SH
682AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
683OVS_VSWITCHD_START([dnl
684 add-port br0 p1 -- set Interface p1 type=dummy
685])
686ON_EXIT([kill `cat ovs-ofctl.pid`])
687
688AT_CAPTURE_FILE([ofctl_monitor.log])
689AT_CHECK([ovs-ofctl del-flows br0])
690
691AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
692
693dnl Test that missed packets are droped
694for i in 1 2 3 ; do
695 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)'
696done
697OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
698
699AT_CHECK([cat ofctl_monitor.log], [0], [dnl
700])
701
702AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
703AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
704OFPST_FLOW reply (OF1.3):
705])
706
707OVS_VSWITCHD_STOP
708AT_CLEANUP
709
6d328fa2
SH
710AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
711OVS_VSWITCHD_START([dnl
712 add-port br0 p1 -- set Interface p1 type=dummy
713])
714ON_EXIT([kill `cat ovs-ofctl.pid`])
715
716AT_CAPTURE_FILE([ofctl_monitor.log])
717AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
718
719AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
720
721for i in 1 2 3 ; do
722 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)'
723done
8bd16974 724OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
725OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
726AT_CHECK([cat ofctl_monitor.log], [0], [dnl
727OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
728tcp,metadata=0,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=0x010 tcp_csum:0
729dnl
730OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
731tcp,metadata=0,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=0x010 tcp_csum:0
732dnl
733OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
734tcp,metadata=0,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=0x010 tcp_csum:0
735])
736
737AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
27f57736 738ovs-appctl revalidator/wait
6d328fa2
SH
739AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
740 n_packets=3, n_bytes=180, actions=goto_table:1
741OFPST_FLOW reply (OF1.2):
742])
743
744OVS_VSWITCHD_STOP
745AT_CLEANUP
746
747AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
748OVS_VSWITCHD_START([dnl
749 add-port br0 p1 -- set Interface p1 type=dummy
750])
751ON_EXIT([kill `cat ovs-ofctl.pid`])
752
753AT_CAPTURE_FILE([ofctl_monitor.log])
754AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
755
756AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
757
758for i in 1 2 3 ; do
759 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)'
760done
761
762OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
763AT_CHECK([cat ofctl_monitor.log], [0], [dnl
764])
765
766AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
27f57736 767ovs-appctl revalidator/wait
6d328fa2
SH
768AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
769 n_packets=3, n_bytes=180, actions=resubmit(1,1)
770OFPST_FLOW reply (OF1.2):
771])
772
773OVS_VSWITCHD_STOP
774AT_CLEANUP
775
776AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
777OVS_VSWITCHD_START([dnl
778 add-port br0 p1 -- set Interface p1 type=dummy
779])
780ON_EXIT([kill `cat ovs-ofctl.pid`])
781
782AT_CAPTURE_FILE([ofctl_monitor.log])
783AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
784AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
785
786dnl Miss table 0, Hit table 1
787AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
788
789for i in 1 2 3 ; do
790 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)'
791done
8bd16974 792OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
793OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
794
795AT_CHECK([cat ofctl_monitor.log], [0], [dnl
796NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
797tcp,metadata=0,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=0x010 tcp_csum:0
798dnl
799NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
800tcp,metadata=0,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=0x010 tcp_csum:0
801dnl
802NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
803tcp,metadata=0,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=0x010 tcp_csum:0
804])
805
806dnl Hit table 0, Miss all other tables, sent to controller
807AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
808
809for i in 1 2 3 ; do
810 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)'
811done
8bd16974 812OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
813OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
814
815AT_CHECK([cat ofctl_monitor.log], [0], [dnl
816NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
817tcp,metadata=0,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=0x010 tcp_csum:0
818dnl
819NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
820tcp,metadata=0,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=0x010 tcp_csum:0
821dnl
822NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
823tcp,metadata=0,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=0x010 tcp_csum:0
824])
825
826AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
27f57736 827ovs-appctl revalidator/wait
6d328fa2
SH
828AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
829 table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
830OFPST_FLOW reply (OF1.2):
831])
832
833OVS_VSWITCHD_STOP
834AT_CLEANUP
835
836AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
837OVS_VSWITCHD_START([dnl
838 add-port br0 p1 -- set Interface p1 type=dummy
839])
840ON_EXIT([kill `cat ovs-ofctl.pid`])
841
842AT_CAPTURE_FILE([ofctl_monitor.log])
843AT_DATA([flows.txt], [dnl
844table=0 actions=goto_table(1)
845table=2 dl_src=10:11:11:11:11:11 actions=controller
846])
847AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
848AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
849
850dnl Hit table 0, Miss table 1, Hit table 2
851AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
852
853for i in 1 2 3 ; do
854 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)'
855done
8bd16974 856OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 857OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
6d328fa2
SH
858
859AT_CHECK([cat ofctl_monitor.log], [0], [dnl
860NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
861tcp,metadata=0,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=0x010 tcp_csum:0
862dnl
863NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
864tcp,metadata=0,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=0x010 tcp_csum:0
865dnl
866NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
867tcp,metadata=0,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=0x010 tcp_csum:0
868])
869
870dnl Hit table 1, Miss all other tables, sent to controller
871AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
872
873for i in 1 2 3 ; do
874 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)'
875done
8bd16974 876OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
6d328fa2
SH
877OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
878
879AT_CHECK([cat ofctl_monitor.log], [0], [dnl
880NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
881tcp,metadata=0,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=0x010 tcp_csum:0
882dnl
883NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
884tcp,metadata=0,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=0x010 tcp_csum:0
885dnl
886NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
887tcp,metadata=0,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=0x010 tcp_csum:0
888])
889
890AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
27f57736 891ovs-appctl revalidator/wait
6d328fa2
SH
892AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
893 n_packets=6, n_bytes=360, actions=goto_table:1
894 table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
895OFPST_FLOW reply (OF1.2):
896])
897
898OVS_VSWITCHD_STOP
899AT_CLEANUP
900
901AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
902OVS_VSWITCHD_START([dnl
903 add-port br0 p1 -- set Interface p1 type=dummy
904])
905ON_EXIT([kill `cat ovs-ofctl.pid`])
906
907AT_CAPTURE_FILE([ofctl_monitor.log])
908AT_DATA([flows.txt], [dnl
909table=0 actions=resubmit(1,1)
910table=2 dl_src=10:11:11:11:11:11 actions=controller
911])
912AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
913AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
914
915dnl Hit table 0, Miss table 1, Dropped
916AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
917
918for i in 1 2 3 ; do
919 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)'
920done
0c473314 921OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
6d328fa2
SH
922
923AT_CHECK([cat ofctl_monitor.log], [0], [dnl
924])
925
926dnl Hit table 1, Dropped
927AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
928
929for i in 1 2 3 ; do
930 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)'
931done
932OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
933
934AT_CHECK([cat ofctl_monitor.log], [0], [dnl
935])
936
937AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
27f57736 938ovs-appctl revalidator/wait
6d328fa2
SH
939AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
940 n_packets=6, n_bytes=360, actions=resubmit(1,1)
941 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
942OFPST_FLOW reply (OF1.2):
943])
944
945OVS_VSWITCHD_STOP
946AT_CLEANUP
947
948AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
949OVS_VSWITCHD_START([dnl
950 add-port br0 p1 -- set Interface p1 type=dummy
951])
952ON_EXIT([kill `cat ovs-ofctl.pid`])
953
954AT_CAPTURE_FILE([ofctl_monitor.log])
955AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
956
957AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
958
959dnl Test that missed packets are droped
960for i in 1 2 3 ; do
961 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
962done
963OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
964
965AT_CHECK([cat ofctl_monitor.log], [0], [dnl
966])
967
968AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
969AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
970NXST_FLOW reply:
971])
972
973OVS_VSWITCHD_STOP
974AT_CLEANUP
975
976AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
977OVS_VSWITCHD_START([dnl
978 add-port br0 p1 -- set Interface p1 type=dummy
979])
980ON_EXIT([kill `cat ovs-ofctl.pid`])
981
982AT_CAPTURE_FILE([ofctl_monitor.log])
983AT_CHECK([ovs-ofctl del-flows br0])
984AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
985AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
986
987AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
988
989dnl Test that missed packets are droped
990for i in 1 2 3 ; do
991 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)'
992done
993OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
994
995AT_CHECK([cat ofctl_monitor.log], [0], [dnl
996])
997
998AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
27f57736 999ovs-appctl revalidator/wait
6d328fa2
SH
1000AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1001 n_packets=3, n_bytes=180, actions=goto_table:1
1002OFPST_FLOW reply (OF1.2):
1003])
1004
1005OVS_VSWITCHD_STOP
1006AT_CLEANUP
1007
1008AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
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_CHECK([ovs-ofctl del-flows br0])
1016AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1017AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1018
1019AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1020
1021dnl Test that missed packets are droped
1022for i in 1 2 3 ; do
1023 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)'
1024done
1025OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1026
1027AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1028])
1029
1030AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
27f57736 1031ovs-appctl revalidator/wait
6d328fa2
SH
1032AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1033 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1034OFPST_FLOW reply (OF1.2):
1035])
1036
1037OVS_VSWITCHD_STOP
1038AT_CLEANUP
1039
15056dc8
EJ
1040AT_SETUP([ofproto-dpif - controller])
1041OVS_VSWITCHD_START([dnl
1042 add-port br0 p1 -- set Interface p1 type=dummy
1043])
57c94f35 1044ON_EXIT([kill `cat ovs-ofctl.pid`])
15056dc8
EJ
1045
1046AT_CAPTURE_FILE([ofctl_monitor.log])
1047AT_DATA([flows.txt], [dnl
1048cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
54834960 1049cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
15056dc8
EJ
1050cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1051
54834960
EJ
1052cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1053cookie=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)
1054cookie=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)
1055cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1056cookie=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)
1057cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1058cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
78cef7fd 1059cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
56d72f37 1060cookie=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
1061])
1062AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1063
1064dnl Flow miss.
77a922c7 1065AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1066
1067for i in 1 2 3 ; do
dc235f7f 1068 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 1069done
57c94f35 1070OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1071OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1072
15056dc8 1073AT_CHECK([cat ofctl_monitor.log], [0], [dnl
f0fd1a17 1074OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
dc235f7f 1075tcp,metadata=0,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=0x010 tcp_csum:0
15056dc8 1076dnl
f0fd1a17 1077OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
dc235f7f 1078tcp,metadata=0,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=0x010 tcp_csum:0
15056dc8 1079dnl
f0fd1a17 1080OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
dc235f7f 1081tcp,metadata=0,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=0x010 tcp_csum:0
15056dc8
EJ
1082])
1083
1084dnl Singleton controller action.
77a922c7 1085AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1086
1087for i in 1 2 3 ; do
dc235f7f 1088 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 1089done
57c94f35 1090OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1091OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1092
15056dc8
EJ
1093AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1094OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
dc235f7f 1095tcp,metadata=0,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=0x002 tcp_csum:0
15056dc8
EJ
1096dnl
1097OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
dc235f7f 1098tcp,metadata=0,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=0x002 tcp_csum:0
15056dc8
EJ
1099dnl
1100OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
dc235f7f 1101tcp,metadata=0,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=0x002 tcp_csum:0
15056dc8
EJ
1102])
1103
1104dnl Modified controller action.
77a922c7 1105AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
15056dc8
EJ
1106
1107for i in 1 2 3 ; do
dc235f7f 1108 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 1109done
57c94f35 1110OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1111OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
15056dc8 1112
15056dc8
EJ
1113AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1114OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
dc235f7f 1115tcp,metadata=0,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=0x001 tcp_csum:0
15056dc8
EJ
1116dnl
1117OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
dc235f7f 1118tcp,metadata=0,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=0x001 tcp_csum:0
15056dc8
EJ
1119dnl
1120OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
dc235f7f 1121tcp,metadata=0,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=0x001 tcp_csum:0
15056dc8
EJ
1122])
1123
363dd1d9
JS
1124dnl Modified VLAN controller action.
1125AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1126
1127for i in 1 2 3; do
8249a1fe 1128 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 1129done
57c94f35 1130OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1131OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
363dd1d9 1132
363dd1d9
JS
1133AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1134NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
8249a1fe 1135ip,metadata=0,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
1136dnl
1137NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
8249a1fe 1138ip,metadata=0,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
1139dnl
1140NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
8249a1fe 1141ip,metadata=0,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
1142])
1143
349fbdc2
SH
1144dnl Checksum TCP.
1145AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1146
1147for i in 1 ; do
1148 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)'
1149done
1150OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1151ovs-appctl -t ovs-ofctl exit
1152
1153AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1154NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1155tcp,metadata=0,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=0x001 tcp_csum:0
1156dnl
1157NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
1158tcp,metadata=0,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=0x001 tcp_csum:0
1159dnl
1160NXT_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)
1161tcp,metadata=0,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=0x001 tcp_csum:0
1162dnl
1163NXT_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)
1164tcp,metadata=0,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=0x001 tcp_csum:0
1165dnl
1166NXT_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)
1167tcp,metadata=0,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=0x001 tcp_csum:1a03
1168dnl
1169NXT_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)
1170tcp,metadata=0,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=0x001 tcp_csum:3205
1171dnl
1172NXT_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)
1173tcp,metadata=0,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=0x001 tcp_csum:31b8
1174dnl
1175NXT_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)
1176tcp,metadata=0,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=0x001 tcp_csum:316d
1177dnl
1178NXT_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)
1179tcp,metadata=0,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=0x001 tcp_csum:316d
1180])
1181
1182dnl Checksum UDP.
1183AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1184
1185for i in 1 ; do
1186 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'
1187done
1188OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1189ovs-appctl -t ovs-ofctl exit
1190
1191AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1192NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1193udp,metadata=0,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
1194dnl
1195NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
1196udp,metadata=0,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
1197dnl
1198NXT_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)
1199udp,metadata=0,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
1200dnl
1201NXT_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)
1202udp,metadata=0,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
1203dnl
1204NXT_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)
1205udp,metadata=0,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
1206dnl
1207NXT_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)
1208udp,metadata=0,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
1209dnl
1210NXT_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)
1211udp,metadata=0,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
1212dnl
1213NXT_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)
1214udp,metadata=0,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
1215dnl
1216NXT_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)
1217udp,metadata=0,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
1218])
1219
1220dnl Modified ARP controller action.
1221AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1222
1223for i in 1 2 3; do
1224 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)'
1225done
1226
1227OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1228AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1229NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1230arp,metadata=0,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
1231NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1232arp,metadata=0,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
1233NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1234arp,metadata=0,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
1235NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1236arp,metadata=0,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
1237NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1238arp,metadata=0,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
1239NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1240arp,metadata=0,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
1241NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1242arp,metadata=0,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
1243NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1244arp,metadata=0,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
1245NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1246arp,metadata=0,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
1247])
1248
1249AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1250
1251dnl Checksum SCTP.
1252AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1253
1254for i in 1 ; do
1255 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'
1256done
1257
1258OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1259OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1260AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1261NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1262sctp,metadata=0,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
1263dnl
1264NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered)
1265sctp,metadata=0,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
1266dnl
1267NXT_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)
1268sctp,metadata=0,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
1269dnl
1270NXT_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)
1271sctp,metadata=0,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
1272dnl
1273NXT_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)
1274sctp,metadata=0,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
1275dnl
1276NXT_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)
1277sctp,metadata=0,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
1278dnl
1279NXT_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)
1280sctp,metadata=0,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
1281dnl
1282NXT_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)
1283sctp,metadata=0,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
1284dnl
1285NXT_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)
1286sctp,metadata=0,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
1287])
1288
1289AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1290 cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1291 cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1292 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)
1293 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)
1294 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)
1295 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)
1296 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)
1297 cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1298 cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1299 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
1300 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
1301 n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1302NXST_FLOW reply:
1303])
1304
1305OVS_VSWITCHD_STOP
1306AT_CLEANUP
1307
1308AT_SETUP([ofproto-dpif - MPLS handling])
1309OVS_VSWITCHD_START([dnl
1310 add-port br0 p1 -- set Interface p1 type=dummy
1311])
1312ON_EXIT([kill `cat ovs-ofctl.pid`])
1313
1314AT_CAPTURE_FILE([ofctl_monitor.log])
1315AT_DATA([flows.txt], [dnl
1316cookie=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
1317cookie=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
1318cookie=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
1319cookie=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
1320cookie=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
1321cookie=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
1322cookie=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
1323cookie=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 1324cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
349fbdc2
SH
1325cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1326cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1327cookie=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
1328
1329cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1330cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1331cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1332cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller
1333cookie=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
1334cookie=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
1335cookie=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
1336
1337cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1338cookie=0xd table=1 arp actions=controller
1339
1340cookie=0xd dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48,controller
1341cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1342cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1343
1344cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1345cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1346cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1347
1348cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1349cookie=0xd dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1350cookie=0xd dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1351
1352cookie=0xd dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1353cookie=0xd dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1354cookie=0xd dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1355
1356cookie=0xd dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1357cookie=0xd dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1358cookie=0xd dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1359
1360cookie=0xd dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1361cookie=0xd dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1362cookie=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
1363])
1364AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1365
b02475c5
SH
1366dnl Modified MPLS controller action.
1367AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1368
1369for i in 1 2 3; do
791a09be 1370 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 1371done
57c94f35 1372OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1373OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1374
b02475c5
SH
1375AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1376NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1377mpls,metadata=0,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
1378dnl
1379NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1380mpls,metadata=0,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
1381dnl
1382NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1383mpls,metadata=0,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
1384])
1385
1386dnl Modified MPLS controller action.
1387AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1388
b0a17866 1389for i in 1 2 3; do
8249a1fe 1390 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
1391done
1392OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1393OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b0a17866
SH
1394
1395AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1396NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
8249a1fe 1397ip,metadata=0,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
1398dnl
1399NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
8249a1fe 1400ip,metadata=0,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
1401dnl
1402NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
8249a1fe 1403ip,metadata=0,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
1404])
1405
1406dnl Modified MPLS controller action.
1407AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1408
b02475c5
SH
1409dnl 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)
1410
1411for i in 1 2 3; do
1412 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)'
1413done
bece9ea7 1414OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1415OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
bece9ea7 1416
b02475c5
SH
1417AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1418NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
8bfd0fda 1419mpls,metadata=0,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
1420dnl
1421NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
8bfd0fda 1422mpls,metadata=0,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
1423dnl
1424NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
8bfd0fda 1425mpls,metadata=0,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
1426])
1427
1428dnl Modified MPLS controller action.
1429AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1430
1431for i in 1 2 3; do
8249a1fe 1432 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 1433done
57c94f35 1434OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1435OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1436
b02475c5
SH
1437AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1438NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1439mpls,metadata=0,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
1440dnl
1441NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1442mpls,metadata=0,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
1443dnl
1444NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1445mpls,metadata=0,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
1446])
1447
b676167a
SH
1448dnl Modified MPLS controller action.
1449AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1450
1451for i in 1 2 3; do
8249a1fe 1452 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 1453done
57c94f35 1454OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1455OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b676167a 1456
b676167a
SH
1457AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1458NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1459mpls,metadata=0,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
1460dnl
1461NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1462mpls,metadata=0,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
1463dnl
1464NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1465mpls,metadata=0,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
1466])
1467
0f3f3c3d
SH
1468dnl Modified MPLS controller action.
1469AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1470
1471for i in 1 2 3; do
8249a1fe 1472 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 1473done
57c94f35 1474OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1475OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
0f3f3c3d 1476
0f3f3c3d
SH
1477AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1478NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1479mpls,metadata=0,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
1480dnl
1481NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1482mpls,metadata=0,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
1483dnl
1484NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1485mpls,metadata=0,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
1486])
1487
1488dnl Modified MPLS controller action.
1489AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1490
1491for i in 1 2 3; do
8249a1fe 1492 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 1493done
57c94f35 1494OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1495OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
0f3f3c3d 1496
0f3f3c3d
SH
1497AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1498NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1499mpls,metadata=0,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
1500dnl
1501NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1502mpls,metadata=0,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
1503dnl
1504NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1505mpls,metadata=0,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
1506])
1507
1ffd16af
SH
1508AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1509
1510dnl Modified MPLS controller action.
1511AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1512
1513for i in 1 2 3; do
1514 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)'
1515done
1516OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1517ovs-appctl -t ovs-ofctl exit
1518
1519AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1520NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1521mplsm,metadata=0,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
1522dnl
1523NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1524mplsm,metadata=0,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
1525dnl
1526NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1527mplsm,metadata=0,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
1528])
1529
1530AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1531
0f3f3c3d
SH
1532dnl Modified MPLS controller action.
1533AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1534
1535for i in 1 2 3; do
8249a1fe 1536 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 1537done
57c94f35 1538OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1539OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
0f3f3c3d 1540
0f3f3c3d
SH
1541AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1542NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1543mpls,metadata=0,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
1544dnl
1545NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1546mpls,metadata=0,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
1547dnl
1548NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
392c30ba 1549mpls,metadata=0,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
1550])
1551
b02475c5
SH
1552dnl Modified MPLS actions.
1553AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1554
1555for i in 1 2 3; do
02830175 1556 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 1557done
57c94f35 1558OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1559OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1560
b02475c5
SH
1561AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1562NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
392c30ba 1563mpls,metadata=0,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
1564dnl
1565NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
392c30ba 1566mpls,metadata=0,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
1567dnl
1568NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
392c30ba 1569mpls,metadata=0,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
1570])
1571
1572dnl Modified MPLS ipv6 controller action.
1573AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1574
1575for i in 1 2 3; do
1576 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)'
1577done
57c94f35 1578OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1579OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1580
b02475c5
SH
1581AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1582NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
52105b67 1583mplsm,metadata=0,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
1584dnl
1585NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
52105b67 1586mplsm,metadata=0,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
1587dnl
1588NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
52105b67 1589mplsm,metadata=0,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
1590])
1591
1592
1593dnl Modified MPLS pop action.
cff78c88
SH
1594dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1595dnl 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)
1596dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1597
b02475c5
SH
1598AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1599
1600for i in 1 2 3; do
cff78c88 1601 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 1602done
cff78c88
SH
1603#for i in 2 3; do
1604# 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)'
1605#done
57c94f35 1606OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
0c473314 1607OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
b02475c5 1608
b02475c5 1609AT_CHECK([cat ofctl_monitor.log], [0], [dnl
cff78c88 1610NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
dc235f7f 1611tcp,metadata=0,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=0x000 tcp_csum:7744
b02475c5 1612dnl
cff78c88 1613NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
dc235f7f 1614tcp,metadata=0,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=0x000 tcp_csum:7744
b02475c5 1615dnl
cff78c88 1616NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
dc235f7f 1617tcp,metadata=0,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=0x000 tcp_csum:7744
b02475c5
SH
1618])
1619
5c0243a9 1620AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
0d56eaf2 1621
1ffd16af
SH
1622dnl Modified MPLS pop action.
1623dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1624dnl 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)
1625dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1626dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1627AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1628
1629for i in 1 2 3; do
1630 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'
1631done
1632OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1633OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1634
1635AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1636NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1637tcp,metadata=0,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=0x000 tcp_csum:7744
1638dnl
1639NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1640tcp,metadata=0,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=0x000 tcp_csum:7744
1641dnl
1642NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1643tcp,metadata=0,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=0x000 tcp_csum:7744
1644])
1645
1646AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1647
1648dnl Modified MPLS pop action.
1649dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1650dnl 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)
1651dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1652dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1653AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1654
1655for i in 1 2 3; do
1656 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'
1657done
1658OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1659OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1660
1661AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1662NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1663tcp,metadata=0,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=0x000 tcp_csum:2dee
1664dnl
1665NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1666tcp,metadata=0,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=0x000 tcp_csum:2dee
1667dnl
1668NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1669tcp,metadata=0,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=0x000 tcp_csum:2dee
1670])
1671
1672AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1673
1674dnl Modified MPLS pop action.
1675dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1676dnl 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)
1677dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1678dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1679AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1680
1681for i in 1 2 3; do
1682 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'
1683done
1684OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1685OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1686
1687AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1688NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1689tcp,metadata=0,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=0x000 tcp_csum:7743
1690dnl
1691NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1692tcp,metadata=0,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=0x000 tcp_csum:7743
1693dnl
1694NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1695tcp,metadata=0,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=0x000 tcp_csum:7743
1696])
1697
1698AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1699
1700dnl Modified MPLS pop action.
1701dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1702dnl 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)
1703dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1704dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1705AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1706
1707for i in 1 2 3; do
1708 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'
1709done
1710OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1711OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1712
1713AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1714NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1715tcp,metadata=0,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=0x000 tcp_csum:7743
1716dnl
1717NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1718tcp,metadata=0,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=0x000 tcp_csum:7743
1719dnl
1720NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1721tcp,metadata=0,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=0x000 tcp_csum:7743
1722])
1723
1724AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1725
1726dnl Modified MPLS pop action.
1727dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1728dnl 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)
1729dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1730dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1731AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1732
1733for i in 1 2 3; do
1734 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'
1735done
1736OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1737OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1738
1739AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1740NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1741tcp,metadata=0,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=0x000 tcp_csum:76db
1742dnl
1743NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1744tcp,metadata=0,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=0x000 tcp_csum:76db
1745dnl
1746NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1747tcp,metadata=0,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=0x000 tcp_csum:76db
1748])
1749
1750AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1751
1752dnl Modified MPLS pop action.
1753dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1754dnl 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)
1755dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1756dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1757AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1758
1759for i in 1 2 3; do
1760 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'
1761done
1762OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1763OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1764
1765AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1766NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1767tcp,metadata=0,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=0x000 tcp_csum:7745
1768dnl
1769NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1770tcp,metadata=0,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=0x000 tcp_csum:7745
1771dnl
1772NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1773tcp,metadata=0,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=0x000 tcp_csum:7745
1774])
1775
1776AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1777
1778dnl Modified MPLS pop action.
1779dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1780dnl 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)
1781dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1782dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1783AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1784
1785for i in 1 2 3; do
1786 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'
1787done
1788OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1789OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1790
1791AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1792NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1793tcp,metadata=0,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=0x000 tcp_csum:7744
1794dnl
1795NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1796tcp,metadata=0,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=0x000 tcp_csum:7744
1797dnl
1798NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1799tcp,metadata=0,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=0x000 tcp_csum:7744
1800])
1801
1802AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1803
1804dnl Modified MPLS pop action.
1805dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
1806dnl 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)
1807AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1808
1809for i in 1 2 3; do
1810 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'
1811done
1812OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1813OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1814
1815AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1816NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
1817arp,metadata=0,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
1818dnl
1819NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
1820arp,metadata=0,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
1821dnl
1822NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
1823arp,metadata=0,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
1824])
1825
1826AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1827
1828dnl Modified MPLS pop action.
1829dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1830dnl 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)
1831dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1832dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1833AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1834
1835for i in 1 2 3; do
1836 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'
1837done
1838OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1839OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1840
1841AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1842NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1843tcp,metadata=0,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=0x000 tcp_csum:7744
1844dnl
1845NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1846tcp,metadata=0,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=0x000 tcp_csum:7744
1847dnl
1848NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1849tcp,metadata=0,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=0x000 tcp_csum:7744
1850])
1851
1852AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1853
1854dnl Modified MPLS pop action.
1855dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1856dnl 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)
1857dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1858dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1859AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1860
1861for i in 1 2 3; do
1862 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'
1863done
1864OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1865OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1866
1867AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1868NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1869tcp,metadata=0,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=0x000 tcp_csum:2dee
1870dnl
1871NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1872tcp,metadata=0,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=0x000 tcp_csum:2dee
1873dnl
1874NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1875tcp,metadata=0,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=0x000 tcp_csum:2dee
1876])
1877
1878AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1879
1880dnl Modified MPLS pop action.
1881dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1882dnl 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)
1883dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1884dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1885AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1886
1887for i in 1 2 3; do
1888 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'
1889done
1890OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1891OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1892
1893AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1894NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1895tcp,metadata=0,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=0x000 tcp_csum:2ded
1896dnl
1897NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1898tcp,metadata=0,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=0x000 tcp_csum:2ded
1899dnl
1900NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1901tcp,metadata=0,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=0x000 tcp_csum:2ded
1902])
1903
1904AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1905
1906dnl Modified MPLS pop action.
1907dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
1908dnl 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)
1909dnl (label 20, exp 0, [S], ttl 31)
1910dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
1911dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
1912AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1913
1914for i in 1 2 3; do
1915 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'
1916done
1917OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1918OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1919
1920AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1921NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1922mplsm,metadata=0,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
1923dnl
1924NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1925mplsm,metadata=0,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
1926dnl
1927NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1928mplsm,metadata=0,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
1929])
1930
1931AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1932
1933dnl Modified MPLS pop action.
1934dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
1935dnl 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)
1936dnl (label 20, exp 0, [S], ttl 31)
1937dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
1938dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
1939AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1940
1941for i in 1 2 3; do
1942 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'
1943done
1944OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1945OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1946
1947AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1948NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1949mpls,metadata=0,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
1950dnl
1951NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1952mpls,metadata=0,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
1953dnl
1954NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1955mpls,metadata=0,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
1956])
1957
1958AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1959
1960dnl Modified MPLS pop action.
1961dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
1962dnl 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)
1963dnl (label 20, exp 0, [S], ttl 31)
1964dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
1965dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
1966AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1967
1968for i in 1 2 3; do
1969 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 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'
1970done
1971OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1972OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1973
1974AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1975NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1976mplsm,metadata=0,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
1977dnl
1978NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1979mplsm,metadata=0,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
1980dnl
1981NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1982mplsm,metadata=0,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
1983])
1984
1985AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1986
1987dnl Modified MPLS pop action.
1988dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
1989dnl 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)
1990dnl (label 20, exp 0, [S], ttl 31)
1991dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
1992dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
1993AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1994
1995for i in 1 2 3; do
1996 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'
1997done
1998OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1999OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2000
2001AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2002NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2003tcp,metadata=0,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=0x000 tcp_csum:7744
2004dnl
2005NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2006tcp,metadata=0,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=0x000 tcp_csum:7744
2007dnl
2008NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2009tcp,metadata=0,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=0x000 tcp_csum:7744
2010])
2011
2012AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2013
2014dnl Modified MPLS pop action.
2015dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2016dnl 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)
2017dnl (label 20, exp 0, [S], ttl 31)
2018dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2019dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2020AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2021
2022for i in 1 2 3; do
2023 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'
2024done
2025OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2026OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2027
2028AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2029NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2030tcp,metadata=0,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=0x000 tcp_csum:7744
2031dnl
2032NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2033tcp,metadata=0,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=0x000 tcp_csum:7744
2034dnl
2035NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2036tcp,metadata=0,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=0x000 tcp_csum:7744
2037])
2038
2039AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2040
2041dnl Modified MPLS pop action.
2042dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2043dnl 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)
2044dnl (label 20, exp 0, [S], ttl 31)
2045dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2046dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2047AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2048
2049for i in 1 2 3; do
2050 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'
2051done
2052OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2053OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2054
2055AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2056NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2057tcp,metadata=0,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=0x000 tcp_csum:7744
2058dnl
2059NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2060tcp,metadata=0,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=0x000 tcp_csum:7744
2061dnl
2062NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2063tcp,metadata=0,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=0x000 tcp_csum:7744
2064])
2065
2066AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2067
2068dnl Modified MPLS pop action.
2069dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2070dnl 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)
2071dnl (label 20, exp 0, ttl 31)
2072dnl (label 20, exp 0, [S], ttl 30)
2073dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2074dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2075AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2076
2077for i in 1 2 3; do
2078 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'
2079done
2080OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2081OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2082
2083AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2084NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2085mplsm,metadata=0,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
2086dnl
2087NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2088mplsm,metadata=0,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
2089dnl
2090NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2091mplsm,metadata=0,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
2092])
2093
2094AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2095
2096dnl Modified MPLS pop action.
2097dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2098dnl 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)
2099dnl (label 20, exp 0, ttl 31)
2100dnl (label 20, exp 0, [S], ttl 30)
2101dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2102dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2103AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2104
2105for i in 1 2 3; do
2106 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'
2107done
2108OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2109OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2110
2111AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2112NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2113mpls,metadata=0,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
2114dnl
2115NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2116mpls,metadata=0,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
2117dnl
2118NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2119mpls,metadata=0,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
2120])
2121
2122AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2123
2124dnl Modified MPLS pop action.
2125dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2126dnl 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)
2127dnl (label 20, exp 0, ttl 31)
2128dnl (label 20, exp 0, [S], ttl 30)
2129dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2130dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2131AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2132
2133for i in 1 2 3; do
2134 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'
2135done
2136OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2137OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2138
2139AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2140NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2141mplsm,metadata=0,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
2142dnl
2143NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2144mplsm,metadata=0,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
2145dnl
2146NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2147mplsm,metadata=0,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
2148])
2149
2150AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2151
2152dnl Modified MPLS pop action.
2153dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2154dnl 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)
2155dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2156dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2157AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2158
2159for i in 1 2 3; do
2160 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'
2161done
2162OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2163OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2164
2165AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2166NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2167mpls,metadata=0,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
2168dnl
2169NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2170mpls,metadata=0,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
2171dnl
2172NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2173mpls,metadata=0,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
2174])
2175
2176AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2177
2178dnl Modified MPLS pop action.
2179dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2180dnl 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)
2181dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2182dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2183AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2184
2185for i in 1 2 3; do
2186 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'
2187done
2188OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2189OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2190
2191AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2192NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2193mplsm,metadata=0,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
2194dnl
2195NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2196mplsm,metadata=0,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
2197dnl
2198NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2199mplsm,metadata=0,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
2200])
2201
2202AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2203
2204dnl Modified MPLS pop action.
2205dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2206dnl 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)
2207dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2208dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2209AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2210
2211for i in 1 2 3; do
2212 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'
2213done
2214OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2215OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2216
2217AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2218NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2219mplsm,metadata=0,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
2220dnl
2221NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2222mplsm,metadata=0,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
2223dnl
2224NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2225mplsm,metadata=0,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
2226])
2227
2228AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2229
2230dnl Modified MPLS pop action.
2231dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2232dnl 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)
2233dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2234dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2235AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2236
2237for i in 1 2 3; do
2238 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'
2239done
2240OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2241OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2242
2243AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2244NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2245mpls,metadata=0,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
2246dnl
2247NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2248mpls,metadata=0,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
2249dnl
2250NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2251mpls,metadata=0,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
2252])
2253
2254AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2255
2256dnl Modified MPLS pop action.
2257dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2258dnl 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)
2259dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2260dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2261AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2262
2263for i in 1 2 3; do
2264 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'
2265done
2266OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2267OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2268
2269AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2270NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2271mplsm,metadata=0,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
2272dnl
2273NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2274mplsm,metadata=0,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
2275dnl
2276NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2277mplsm,metadata=0,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
2278])
2279
2280AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2281
2282dnl Modified MPLS pop action.
2283dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2284dnl 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)
2285dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2286dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2287AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2288
2289for i in 1 2 3; do
2290 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'
2291done
2292OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2293OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2294
2295AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2296NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2297mpls,metadata=0,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
2298dnl
2299NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2300mpls,metadata=0,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
2301dnl
2302NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2303mpls,metadata=0,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
2304])
2305
2306AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2307
ef0ce8ae 2308AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
b02475c5
SH
2309 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
2310 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
2311 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 2312 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
2313 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
2314 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
2315 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 2316 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 2317 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 2318 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 2319 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
SH
2320 cookie=0xd, n_packets=3, n_bytes=180, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2321 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl(0),CONTROLLER:65535
2322 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
2323 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
2324 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
2325 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
2326 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
2327 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
2328 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
2329 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
2330 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
2331 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
2332 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
2333 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl(0),push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2334 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
2335 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
2336 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 2337 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
1ffd16af
SH
2338 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2339 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
2340 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
2341 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
2342 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(0),CONTROLLER:65535
2343 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(0),CONTROLLER:65535
2344 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
2345 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
2346 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
2347 cookie=0xd, table=1, n_packets=3, n_bytes=168, arp actions=CONTROLLER:65535
ef0ce8ae 2348NXST_FLOW reply:
15056dc8
EJ
2349])
2350
2351OVS_VSWITCHD_STOP
8e9ce036 2352AT_CLEANUP
04c956fc 2353
1ffd16af
SH
2354AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2355OVS_VSWITCHD_START([dnl
2356 add-port br0 p1 -- set Interface p1 type=dummy
2357])
2358ON_EXIT([kill `cat ovs-ofctl.pid`])
2359
2360AT_CAPTURE_FILE([ofctl_monitor.log])
2361AT_DATA([flows.txt], [dnl
2362table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2363table=1 ip,ip_dscp=8 actions=controller
2364])
2365AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2366
2367
2368dnl Modified MPLS pop action.
2369dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2370dnl 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)
2371dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2372dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2373AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2374
2375for i in 1 2 3; do
2376 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'
2377done
2378OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2379OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2380
2381AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2382OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2383tcp,metadata=0,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=0x000 tcp_csum:7744
2384dnl
2385OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2386tcp,metadata=0,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=0x000 tcp_csum:7744
2387dnl
2388OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2389tcp,metadata=0,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=0x000 tcp_csum:7744
2390])
2391
2392AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2393
2394AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2395 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
2396 table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
2397OFPST_FLOW reply (OF1.2):
2398])
2399
2400OVS_VSWITCHD_STOP
2401AT_CLEANUP
2402
2403AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
2404OVS_VSWITCHD_START([dnl
2405 add-port br0 p1 -- set Interface p1 type=dummy
2406])
2407ON_EXIT([kill `cat ovs-ofctl.pid`])
2408
2409dnl N.B: The first (and only) action that accesses L3 data after the
2410dnl pop_mpls action is present in write_actions. This exercises recirculation
2411dnl triggered in write_actions due to a previous action not in write actions.
2412AT_CAPTURE_FILE([ofctl_monitor.log])
2413AT_DATA([flows.txt], [dnl
2414mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
2415])
2416AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2417
2418dnl Modified MPLS pop action.
2419dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2420dnl 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)
2421dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2422dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2423AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2424
2425for i in 1 2 3; do
2426 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'
2427done
2428OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2429OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2430
2431AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2432OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2433tcp,metadata=0,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=0x000 tcp_csum:7744
2434dnl
2435OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2436tcp,metadata=0,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=0x000 tcp_csum:7744
2437dnl
2438OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2439tcp,metadata=0,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=0x000 tcp_csum:7744
2440])
2441
2442AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2443
2444AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2445 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
2446OFPST_FLOW reply (OF1.2):
2447])
2448
2449OVS_VSWITCHD_STOP
2450AT_CLEANUP
527ae97e
SH
2451
2452AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
2453OVS_VSWITCHD_START([dnl
2454 add-port br0 p1 -- set Interface p1 type=dummy
2455])
2456ON_EXIT([kill `cat ovs-ofctl.pid`])
2457
2458AT_CAPTURE_FILE([ofctl_monitor.log])
2459# A table-miss flow has priority 0 and no match
2460AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2461
2462dnl Singleton controller action.
2463AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2464
2465for i in 1 2 3 ; do
2466 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)'
2467done
2468OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2469ovs-appctl -t ovs-ofctl exit
2470
2471AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2472OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2473tcp,metadata=0,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=0x002 tcp_csum:0
2474dnl
2475OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2476tcp,metadata=0,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=0x002 tcp_csum:0
2477dnl
2478OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2479tcp,metadata=0,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=0x002 tcp_csum:0
2480])
2481
2482AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2483
2484AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2485 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2486NXST_FLOW reply:
2487])
2488
2489OVS_VSWITCHD_STOP
2490AT_CLEANUP
2491
2492
2493AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
2494OVS_VSWITCHD_START([dnl
2495 add-port br0 p1 -- set Interface p1 type=dummy
2496])
2497ON_EXIT([kill `cat ovs-ofctl.pid`])
2498
2499AT_CAPTURE_FILE([ofctl_monitor.log])
2500# A table-miss flow has priority 0 and no match
2501AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2502
2503dnl Singleton controller action.
2504AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2505
2506for i in 1 2 3 ; do
2507 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)'
2508done
2509OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2510ovs-appctl -t ovs-ofctl exit
2511
2512AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2513
2514AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2515OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2516tcp,metadata=0,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=0x002 tcp_csum:0
2517dnl
2518OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2519tcp,metadata=0,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=0x002 tcp_csum:0
2520dnl
2521OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2522tcp,metadata=0,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=0x002 tcp_csum:0
2523])
2524
2525AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2526
2527AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2528 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2529OFPST_FLOW reply (OF1.3):
2530])
2531
2532OVS_VSWITCHD_STOP
2533AT_CLEANUP
2534
f6c8a6b1
BP
2535AT_SETUP([ofproto-dpif - ARP modification slow-path])
2536OVS_VSWITCHD_START
2537ADD_OF_PORTS([br0], [1], [2])
2538
2539ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
2540ovs-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'
2541
2542# Input some packets that should follow the arp modification slow-path.
2543for i in 1 2 3; do
2544 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)'
2545done
2546AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2547
2548# Check the packets that were output.
2549AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
03fbdf8d
JR
2550arp,metadata=0,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
2551arp,metadata=0,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
2552arp,metadata=0,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
2553arp,metadata=0,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
2554arp,metadata=0,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
2555arp,metadata=0,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
2556arp,metadata=0,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
2557arp,metadata=0,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
2558arp,metadata=0,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
2559])
2560
f6c8a6b1
BP
2561OVS_VSWITCHD_STOP
2562AT_CLEANUP
2563
ecac4ebf 2564AT_SETUP([ofproto-dpif - VLAN handling])
04c956fc 2565OVS_VSWITCHD_START(
023e1e0a
BP
2566 [set Bridge br0 fail-mode=standalone -- \
2567 add-port br0 p1 trunks=10,12 -- \
ecac4ebf 2568 add-port br0 p2 tag=10 -- \
5e9ceccd
BP
2569 add-port br0 p3 tag=12 \
2570 other-config:priority-tags=true -- \
ecac4ebf
BP
2571 add-port br0 p4 tag=12 -- \
2572 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
2573 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
2574 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
5e9ceccd
BP
2575 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
2576 other-config:priority-tags=true -- \
ecac4ebf
BP
2577 set Interface p1 type=dummy -- \
2578 set Interface p2 type=dummy -- \
2579 set Interface p3 type=dummy -- \
2580 set Interface p4 type=dummy -- \
2581 set Interface p5 type=dummy -- \
2582 set Interface p6 type=dummy -- \
2583 set Interface p7 type=dummy -- \
2584 set Interface p8 type=dummy --])
04c956fc 2585
247527db
BP
2586dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
2587dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
ecac4ebf 2588dnl actions.
04c956fc 2589for tuple in \
e44768b7
JP
2590 "100 none 0 drop" \
2591 "100 0 0 drop" \
2592 "100 0 1 drop" \
2593 "100 10 0 1,5,6,7,8,pop_vlan,2" \
2594 "100 10 1 1,5,6,7,8,pop_vlan,2" \
2595 "100 11 0 5,7" \
2596 "100 11 1 5,7" \
2597 "100 12 0 1,5,6,pop_vlan,3,4,7,8" \
2598 "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
247527db
BP
2599 "1 none 0 drop" \
2600 "1 0 0 drop" \
2601 "1 0 1 drop" \
e44768b7
JP
2602 "1 10 0 5,6,7,8,100,pop_vlan,2" \
2603 "1 10 1 5,6,7,8,100,pop_vlan,2" \
247527db
BP
2604 "1 11 0 drop" \
2605 "1 11 1 drop" \
e44768b7
JP
2606 "1 12 0 5,6,100,pop_vlan,3,4,7,8" \
2607 "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2608 "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
2609 "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
2610 "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
247527db
BP
2611 "2 10 0 drop" \
2612 "2 10 1 drop" \
2613 "2 11 0 drop" \
2614 "2 11 1 drop" \
2615 "2 12 0 drop" \
2616 "2 12 1 drop" \
e44768b7
JP
2617 "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2618 "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2619 "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
247527db
BP
2620 "3 10 0 drop" \
2621 "3 10 1 drop" \
2622 "3 11 0 drop" \
2623 "3 11 1 drop" \
2624 "3 12 0 drop" \
2625 "3 12 1 drop" \
e44768b7
JP
2626 "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2627 "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2628 "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
247527db
BP
2629 "4 10 0 drop" \
2630 "4 10 1 drop" \
2631 "4 11 0 drop" \
2632 "4 11 1 drop" \
2633 "4 12 0 drop" \
2634 "4 12 1 drop" \
e44768b7
JP
2635 "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
2636 "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
2637 "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
2638 "5 10 0 1,6,7,8,100,pop_vlan,2" \
2639 "5 10 1 1,6,7,8,100,pop_vlan,2" \
2640 "5 11 0 7,100" \
2641 "5 11 1 7,100" \
2642 "5 12 0 1,6,100,pop_vlan,3,4,7,8" \
2643 "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2644 "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
2645 "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
2646 "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
2647 "6 10 0 1,5,7,8,100,pop_vlan,2" \
2648 "6 10 1 1,5,7,8,100,pop_vlan,2" \
247527db
BP
2649 "6 11 0 drop" \
2650 "6 11 1 drop" \
e44768b7
JP
2651 "6 12 0 1,5,100,pop_vlan,3,4,7,8" \
2652 "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2653 "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2654 "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2655 "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
2656 "7 10 0 1,5,6,8,100,pop_vlan,2" \
2657 "7 10 1 1,5,6,8,100,pop_vlan,2" \
2658 "7 11 0 5,100" \
2659 "7 11 1 5,100" \
2660 "7 12 0 1,5,6,100,pop_vlan,3,4,8" \
2661 "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
2662 "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
2663 "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
2664 "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
2665 "8 10 0 1,5,6,7,100,pop_vlan,2" \
2666 "8 10 1 1,5,6,7,100,pop_vlan,2" \
247527db
BP
2667 "8 11 0 drop" \
2668 "8 11 1 drop" \
e44768b7
JP
2669 "8 12 0 1,5,6,100,pop_vlan,3,4,7" \
2670 "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
04c956fc
BP
2671do
2672 set $tuple
2673 in_port=$1
2674 vlan=$2
ecac4ebf
BP
2675 pcp=$3
2676 expected=$4
04c956fc
BP
2677
2678 if test $vlan = none; then
247527db 2679 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
04c956fc 2680 else
247527db 2681 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
2682 fi
2683
395e68ce
BP
2684 echo "----------------------------------------------------------------------"
2685 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
2686
50aa28fd 2687 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
ecac4ebf 2688 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
04c956fc 2689
247527db 2690 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
becffb86 2691 mv stdout expout
247527db 2692 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
04c956fc
BP
2693done
2694
2695OVS_VSWITCHD_STOP
2696AT_CLEANUP
7257b535 2697
56879058
JS
2698AT_SETUP([ofproto-dpif - MPLS handling])
2699OVS_VSWITCHD_START([dnl
2700 add-port br0 p1 -- set Interface p1 type=dummy
2701])
2702ON_EXIT([kill `cat ovs-ofctl.pid`])
2703
2704AT_CAPTURE_FILE([ofctl_monitor.log])
2705AT_DATA([flows.txt], [dnl
2706dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
63636ee8 2707dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
0c1625e8 2708dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
56879058
JS
2709])
2710AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
2711
2712dnl In this test, we push an MPLS tag to an ethernet packet.
2713AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2714
2715for i in 1 2 3; do
2716 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)'
2717done
62022172 2718OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 2719OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
56879058
JS
2720
2721AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2722OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2723mpls,metadata=0,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
272400000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
272500000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
272600000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
272700000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
2728dnl
2729OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2730mpls,metadata=0,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
273100000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
273200000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
273300000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
273400000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
2735dnl
2736OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2737mpls,metadata=0,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
273800000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
273900000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
274000000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
274100000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
2742])
2743
63636ee8
JS
2744dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
2745dnl copied exactly, except for the BOS bit.
2746AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2747
2748for i in 1 2 3; do
2749 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)'
2750done
62022172 2751OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 2752OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
63636ee8
JS
2753
2754AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2755OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2756mpls,metadata=0,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
275700000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
275800000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
275900000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
276000000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2761dnl
2762OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2763mpls,metadata=0,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
276400000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
276500000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
276600000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
276700000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2768dnl
2769OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2770mpls,metadata=0,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
277100000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
277200000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
277300000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
0c1625e8
SH
277400000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2775])
2776
2777dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
2778dnl copied exactly, except for the BOS bit. The ethertype should be updated
2779dnl to the MPLS ethertype of the MPLS push action which differs to that
2780dnl of the input packet.
2781AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2782
2783for i in 1 2 3; do
2784 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)'
2785done
62022172 2786OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c1625e8
SH
2787OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
2788
2789AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2790OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2791mplsm,metadata=0,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
279200000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
279300000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
279400000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
279500000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2796dnl
2797OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2798mplsm,metadata=0,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
279900000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
280000000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
280100000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
280200000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2803dnl
2804OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2805mplsm,metadata=0,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
280600000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
280700000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
280800000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
63636ee8
JS
280900000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2810])
2811
56879058
JS
2812OVS_VSWITCHD_STOP
2813AT_CLEANUP
2814
846e159a
SH
2815AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
2816OVS_VSWITCHD_START([dnl
2817 add-port br0 p1 -- set Interface p1 type=dummy
2818])
2819ON_EXIT([kill `cat ovs-ofctl.pid`])
2820
2821AT_CAPTURE_FILE([ofctl_monitor.log])
2822AT_DATA([flows.txt], [dnl
2823cookie=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
2824cookie=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
2825cookie=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
2826cookie=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
2827cookie=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
2828cookie=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
2829cookie=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
2830cookie=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
2831cookie=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
2832cookie=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
2833])
2834AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
2835
2836dnl Modified MPLS controller action.
2837dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
2838dnl both of these in the final flow
2839AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2840
2841for i in 1 2 3; do
2842 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)'
2843done
62022172 2844OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 2845OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
2846
2847AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2848OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2849mpls,metadata=0,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
285000000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
285100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
285200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
285300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
285400000040 00 00 00 00
2855dnl
2856OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2857mpls,metadata=0,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
285800000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
285900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
286000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
286100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
286200000040 00 00 00 00
2863dnl
2864OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2865mpls,metadata=0,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
286600000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
286700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
286800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
286900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
287000000040 00 00 00 00
2871])
2872
2873dnl Modified MPLS controller action.
2874dnl In this test, the input packet in vlan-tagged, which should be stripped
2875dnl before we push the MPLS and VLAN tags.
2876AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2877
2878for i in 1 2 3; do
2879 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))'
2880done
62022172 2881OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 2882OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
2883
2884AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2885OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2886mpls,metadata=0,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
288700000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
288800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
288900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
289000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2891dnl
2892OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2893mpls,metadata=0,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
289400000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
289500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
289600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
289700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2898dnl
2899OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2900mpls,metadata=0,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
290100000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
290200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
290300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
290400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2905])
2906
2907dnl Modified MPLS controller action.
2908dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
2909dnl both of these in the final flow
2910AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2911
2912for i in 1 2 3; do
2913 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)'
2914done
62022172 2915OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 2916OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
2917
2918AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2919OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2920mpls,metadata=0,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
292100000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
292200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
292300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
292400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
292500000040 00 00 00 00
2926dnl
2927OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2928mpls,metadata=0,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
292900000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
293000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
293100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
293200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
293300000040 00 00 00 00
2934dnl
2935OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2936mpls,metadata=0,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
293700000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
293800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
293900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
294000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
294100000040 00 00 00 00
2942])
2943
2944dnl Modified MPLS controller action.
2945dnl In this test, the input packet in vlan-tagged, which should be stripped
2946dnl before we push the MPLS and VLAN tags.
2947AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2948
2949for i in 1 2 3; do
2950 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))'
2951done
62022172 2952OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 2953OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
2954
2955AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2956OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2957mpls,metadata=0,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
295800000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
295900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
296000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
296100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2962dnl
2963OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2964mpls,metadata=0,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
296500000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
296600000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
296700000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
296800000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2969dnl
2970OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2971mpls,metadata=0,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
297200000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
297300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
297400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
297500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2976])
2977
2978dnl Modified MPLS controller action.
2979dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
2980dnl actions are reordered, so we see both of these in the final flow.
2981AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2982
2983for i in 1 2 3; do
2984 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)'
2985done
62022172 2986OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 2987OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
2988
2989AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2990OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2991mpls,metadata=0,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
299200000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
299300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
299400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
299500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
299600000040 00 00 00 00
2997dnl
2998OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2999mpls,metadata=0,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
300000000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
300100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
300200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
300300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
300400000040 00 00 00 00
3005dnl
3006OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3007mpls,metadata=0,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
300800000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
300900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
301000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
301100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
301200000040 00 00 00 00
3013])
3014
3015dnl Modified MPLS controller action.
3016dnl In this test, the input packet in vlan-tagged, which should be stripped
3017dnl before we push the MPLS and VLAN tags.
3018AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3019
3020for i in 1 2 3; do
3021 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))'
3022done
62022172 3023OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
28ae2f37 3024OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
846e159a
SH
3025
3026AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3027OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3028mpls,metadata=0,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
302900000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
303000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
303100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
303200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3033dnl
3034OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3035mpls,metadata=0,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
303600000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
303700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
303800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
303900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3040dnl
3041OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3042mpls,metadata=0,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
304300000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
304400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
304500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
304600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3047])
3048
3049dnl Modified MPLS controller action.
3050dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3051dnl actions are reordered, so we see both of these in the final flow.
3052AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3053
3054for i in 1 2 3; do
3055 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)'
3056done
62022172 3057OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3058OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3059
3060AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3061OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3062mpls,metadata=0,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
306300000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
306400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
306500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
306600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
306700000040 00 00 00 00
3068dnl
3069OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3070mpls,metadata=0,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
307100000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
307200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
307300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
307400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
307500000040 00 00 00 00
3076dnl
3077OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3078mpls,metadata=0,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
307900000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
308000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
308100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
308200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
308300000040 00 00 00 00
3084])
3085
3086dnl Modified MPLS controller action.
3087dnl In this test, the input packet in vlan-tagged, which should be stripped
3088dnl before we push the MPLS and VLAN tags.
3089AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
3090
3091for i in 1 2 3; do
3092 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))'
3093done
62022172 3094OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3095OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3096
3097AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3098OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3099mpls,metadata=0,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
310000000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
310100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
310200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
310300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3104dnl
3105OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3106mpls,metadata=0,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
310700000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
310800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
310900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
311000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3111dnl
3112OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3113mpls,metadata=0,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
311400000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
311500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
311600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
311700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3118])
3119
3120dnl Modified MPLS controller action.
3121dnl In this test, the input packet in vlan-tagged, which should be stripped
3122dnl before we push the MPLS and VLAN tags.
3123AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3124
3125for i in 1 2 3; do
3126 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))'
3127done
62022172 3128OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
0c473314 3129OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
846e159a
SH
3130
3131AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3132OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3133mpls,metadata=0,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
313400000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
313500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
313600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
313700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3138dnl
3139OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3140mpls,metadata=0,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
314100000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
314200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
314300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
314400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3145dnl
3146OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3147mpls,metadata=0,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
314800000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
314900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
315000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
315100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3152])
3153
3154dnl Modified MPLS controller action.
3155dnl In this test, the input packet in vlan-tagged, which should be modified
3156dnl before we push MPLS and VLAN tags.
3157AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3158
3159for i in 1 2 3; do
3160 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))'
3161done
62022172 3162OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
846e159a
SH
3163ovs-appctl -t ovs-ofctl exit
3164
3165AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3166OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3167mpls,metadata=0,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
316800000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
316900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
317000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
317100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3172dnl
3173OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3174mpls,metadata=0,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
317500000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
317600000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
317700000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
317800000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3179dnl
3180OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3181mpls,metadata=0,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
318200000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
318300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
318400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
318500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3186])
3187
3188AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3189AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3190 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
3191 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
3192 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
3193 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
3194 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
3195 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
3196 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
3197 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
3198 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
3199 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
3200OFPST_FLOW reply (OF1.2):
3201])
3202
3203OVS_VSWITCHD_STOP
3204AT_CLEANUP
3205
7257b535 3206AT_SETUP([ofproto-dpif - fragment handling])
023e1e0a 3207OVS_VSWITCHD_START
72d64e33 3208ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
7257b535
BP
3209AT_DATA([flows.txt], [dnl
3210priority=75 tcp ip_frag=no tp_dst=80 actions=output:1
3211priority=75 tcp ip_frag=first tp_dst=80 actions=output:2
3212priority=75 tcp ip_frag=later tp_dst=80 actions=output:3
3213priority=50 tcp ip_frag=no actions=output:4
3214priority=50 tcp ip_frag=first actions=output:5
3215priority=50 tcp ip_frag=later actions=output:6
3216])
3217AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3218
a61680c6 3219base_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
3220no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3221first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3222later_flow="$base_flow,frag=later)"
3223
3224 # mode no first later
3225for tuple in \
3226 'normal 1 5 6' \
3227 'drop 1 drop drop' \
3228 'nx-match 1 2 6'
3229do
3230 set $tuple
3231 mode=$1
3232 no=$2
3233 first=$3
3234 later=$4
3235
3236 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3237 for type in no first later; do
3238 eval flow=\$${type}_flow exp_output=\$$type
7fd51d39 3239 printf "\n%s\n" "----$mode $type-----"
50aa28fd 3240 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
7fd51d39
BP
3241 : > expout
3242 if test $mode = drop && test $type != no; then
3243 echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
3244 fi
3245 echo "Datapath actions: $exp_output" >> expout
3246 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
7257b535
BP
3247 done
3248done
023e1e0a 3249OVS_VSWITCHD_STOP
7257b535 3250AT_CLEANUP
848e8809
EJ
3251
3252AT_SETUP([ofproto-dpif - exit])
3253OVS_VSWITCHD_START
f7b8e494 3254ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14])
848e8809
EJ
3255AT_DATA([flows.txt], [dnl
3256in_port=1 actions=output:10,exit,output:11
3257in_port=2 actions=output:12,resubmit:1,output:12
3258in_port=3 actions=output:13,resubmit:2,output:14
3259])
3260AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50aa28fd 3261AT_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
3262AT_CHECK([tail -1 stdout], [0],
3263 [Datapath actions: 10
3264])
50aa28fd 3265AT_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
3266AT_CHECK([tail -1 stdout], [0],
3267 [Datapath actions: 12,10
3268])
50aa28fd 3269AT_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
3270AT_CHECK([tail -1 stdout], [0],
3271 [Datapath actions: 13,12,10
3272])
3273OVS_VSWITCHD_STOP
3274AT_CLEANUP
c06bba01
JP
3275
3276
3277AT_SETUP([ofproto-dpif - mirroring, select_all])
432fca23
BP
3278OVS_VSWITCHD_START
3279ADD_OF_PORTS([br0], 1, 2, 3)
3280ovs-vsctl \
c06bba01
JP
3281 set Bridge br0 mirrors=@m --\
3282 --id=@p3 get Port p3 --\
432fca23 3283 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
c06bba01 3284
c06bba01
JP
3285AT_DATA([flows.txt], [dnl
3286in_port=1 actions=output:2
3287in_port=2 actions=output:1
3288])
3289AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3290
247527db 3291flow="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 3292AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3293AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3294 [Datapath actions: 2,3
c06bba01
JP
3295])
3296
247527db 3297flow="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 3298AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3299AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3300 [Datapath actions: 1,3
c06bba01
JP
3301])
3302
3303OVS_VSWITCHD_STOP
3304AT_CLEANUP
3305
3306
3307AT_SETUP([ofproto-dpif - mirroring, select_src])
432fca23
BP
3308OVS_VSWITCHD_START
3309ADD_OF_PORTS([br0], 1, 2, 3)
3310ovs-vsctl \
c06bba01
JP
3311 set Bridge br0 mirrors=@m --\
3312 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
432fca23 3313 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
c06bba01 3314
c06bba01
JP
3315AT_DATA([flows.txt], [dnl
3316in_port=1 actions=output:2
3317in_port=2 actions=output:1
3318])
3319AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3320
247527db 3321flow="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 3322AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3323AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3324 [Datapath actions: 2,3
c06bba01
JP
3325])
3326
247527db 3327flow="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 3328AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3329AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3330 [Datapath actions: 1
c06bba01
JP
3331])
3332OVS_VSWITCHD_STOP
3333AT_CLEANUP
3334
33158a18 3335AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
432fca23
BP
3336OVS_VSWITCHD_START
3337ADD_OF_PORTS([br0], 1, 2)
3338ovs-vsctl \
33158a18
JP
3339 set Bridge br0 mirrors=@m --\
3340 --id=@p2 get Port p2 --\
432fca23 3341 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
33158a18 3342
33158a18
JP
3343AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
3344
3345# "in_port" defaults to OFPP_NONE if it's not specified.
72d64e33 3346flow="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
3347AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
3348AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3349 [Datapath actions: 1,2
33158a18
JP
3350])
3351
3352OVS_VSWITCHD_STOP
3353AT_CLEANUP
3354
c06bba01
JP
3355
3356AT_SETUP([ofproto-dpif - mirroring, select_dst])
432fca23
BP
3357OVS_VSWITCHD_START
3358ADD_OF_PORTS([br0], 1, 2, 3)
3359ovs-vsctl \
c06bba01
JP
3360 set Bridge br0 mirrors=@m --\
3361 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
432fca23 3362 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
c06bba01 3363
c06bba01
JP
3364AT_DATA([flows.txt], [dnl
3365in_port=1 actions=output:2
3366in_port=2 actions=output:1
3367])
3368AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3369
247527db 3370flow="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 3371AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3372AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3373 [Datapath actions: 2,3
c06bba01
JP
3374])
3375
247527db 3376flow="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 3377AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3378AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3379 [Datapath actions: 1
c06bba01
JP
3380])
3381
3382OVS_VSWITCHD_STOP
3383AT_CLEANUP
3384
3385
3386AT_SETUP([ofproto-dpif - mirroring, select_vlan])
432fca23
BP
3387OVS_VSWITCHD_START
3388ADD_OF_PORTS([br0], 1, 2, 3)
3389ovs-vsctl \
c06bba01
JP
3390 set Bridge br0 mirrors=@m --\
3391 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
432fca23 3392 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
c06bba01 3393
c06bba01
JP
3394AT_DATA([flows.txt], [dnl
3395in_port=1, actions=output:2
3396])
3397AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3398
247527db 3399flow="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 3400AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3401AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3402 [Datapath actions: 2
c06bba01
JP
3403])
3404
247527db 3405flow="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 3406AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3407AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3408 [Datapath actions: 2
c06bba01
JP
3409])
3410
247527db 3411flow="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 3412AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3413AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3414 [Datapath actions: 2,3
c06bba01
JP
3415])
3416
3417OVS_VSWITCHD_STOP
3418AT_CLEANUP
3419
3420
3421AT_SETUP([ofproto-dpif - mirroring, output_port])
432fca23
BP
3422OVS_VSWITCHD_START
3423ADD_OF_PORTS([br0], 1, 2, 3)
3424ovs-vsctl \
c06bba01
JP
3425 set Bridge br0 mirrors=@m --\
3426 --id=@p3 get Port p3 --\
432fca23 3427 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
c06bba01 3428
c06bba01
JP
3429AT_DATA([flows.txt], [dnl
3430in_port=1 actions=mod_vlan_vid:17,output:2
3431in_port=2 actions=output:1
3432])
3433AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3434
247527db 3435flow="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 3436AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3437AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3438 [Datapath actions: push_vlan(vid=17,pcp=0),2,pop_vlan,3
c06bba01
JP
3439])
3440
247527db 3441flow="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 3442AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01 3443AT_CHECK_UNQUOTED([tail -1 stdout], [0],
247527db 3444 [Datapath actions: 1,3
c06bba01
JP
3445])
3446
3447OVS_VSWITCHD_STOP
3448AT_CLEANUP
3449
c06bba01 3450AT_SETUP([ofproto-dpif - mirroring, output_vlan])
432fca23
BP
3451OVS_VSWITCHD_START
3452ADD_OF_PORTS([br0], 1, 2)
3453ovs-vsctl \
c06bba01 3454 set Bridge br0 mirrors=@m --\
432fca23 3455 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
c06bba01 3456
c06bba01
JP
3457AT_DATA([flows.txt], [dnl
3458in_port=1 actions=output:2
3459in_port=2 actions=mod_vlan_vid:17,output:1
3460])
3461AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3462
247527db 3463flow="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 3464AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01
JP
3465actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3466
e44768b7 3467expected="2,push_vlan(vid=12,pcp=0),1,2,100"
247527db 3468AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
c06bba01 3469mv stdout expout
247527db 3470AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
c06bba01 3471
247527db 3472flow="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 3473AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
c06bba01
JP
3474actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3475
e44768b7 3476expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
247527db 3477AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
c06bba01 3478mv stdout expout
247527db 3479AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
c06bba01
JP
3480
3481OVS_VSWITCHD_STOP
3482AT_CLEANUP
b44a10b7 3483
22bb3cbc
AW
3484# Two testcases below are for the ofproto/trace command
3485# The first one tests all correct syntax:
3486# ofproto/trace [dp_name] odp_flow [-generate|packet]
3487# ofproto/trace br_name br_flow [-generate|packet]
3488AT_SETUP([ofproto-dpif - ofproto/trace command 1])
3489OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
3490ADD_OF_PORTS([br0], 1, 2, 3)
3491
3492AT_DATA([flows.txt], [dnl
3493in_port=1 actions=output:2
3494in_port=2 actions=output:1
3495])
3496AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3497
c2a77f33 3498odp_flow="in_port(1)"
22bb3cbc 3499br_flow="in_port=1"
0a37839c
GS
3500# Test command: ofproto/trace odp_flow with in_port as a name.
3501AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3502AT_CHECK([tail -1 stdout], [0], [dnl
3503Datapath actions: 2
3504])
3505
3506odp_flow="in_port(1)"
22bb3cbc
AW
3507# Test command: ofproto/trace odp_flow
3508AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3509AT_CHECK([tail -1 stdout], [0], [dnl
3510Datapath actions: 2
3511])
3512
3513# Test command: ofproto/trace dp_name odp_flow
3514AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
3515AT_CHECK([tail -1 stdout], [0], [dnl
3516Datapath actions: 2
3517])
3518# Test commmand: ofproto/trace br_name br_flow
3519AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
3520AT_CHECK([tail -1 stdout], [0], [dnl
3521Datapath actions: 2
3522])
3523
3524# Delete the inserted flows
3525AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
3526AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
3527
3528# This section beflow tests the [-generate] option
3529odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
3530br_flow="arp,metadata=0,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=ff:ff:ff:ff:ff:ff"
3531
3532# Test command: ofproto/trace odp_flow
3533AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3534# Check for no MAC learning entry
3535AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3536 port VLAN MAC Age
3537])
3538
3539# Test command: ofproto/trace br_name br_flow
3540AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
3541# Check for no MAC learning entry
3542AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3543 port VLAN MAC Age
3544])
3545
3546# Test command: ofproto/trace odp_flow -generate
3547AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
3548# Check for the MAC learning entry
3549AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3550 port VLAN MAC Age
3551 3 0 50:54:00:00:00:05 ?
3552])
3553
3554# Test command: ofproto/trace dp_name odp_flow -generate
3555AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3556 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
3557 -generate], [0], [stdout])
3558# Check for both MAC learning entries
3559AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3560 port VLAN MAC Age
3561 3 0 50:54:00:00:00:05 ?
3562 1 0 50:54:00:00:00:06 ?
3563])
3564
3565# Test command: ofproto/trace br_name br_flow -generate
3566AT_CHECK([ovs-appctl ofproto/trace br0 \
3567 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
3568 -generate], [0], [stdout])
3569# Check for both MAC learning entries.
3570AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3571 port VLAN MAC Age
3572 3 0 50:54:00:00:00:05 ?
3573 1 0 50:54:00:00:00:06 ?
3574 2 0 50:54:00:00:00:07 ?
3575])
3576
3577# This section beflow tests the [packet] option
3578# The ovs-tcpundump of packets between port1 and port2
3579pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
3580pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
3581
3582# Construct the MAC learning table
3583AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3584 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
3585 -generate], [0], [stdout])
3586
3587# Construct the MAC learning table
3588AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3589 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
3590 -generate], [0], [stdout])
3591
3592# Test command: ofproto/trace odp_flow packet
3593AT_CHECK([ovs-appctl ofproto/trace \
3594 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
3595AT_CHECK([tail -1 stdout], [0], [dnl
3596Datapath actions: 2
3597])
b6f00895 3598AT_CHECK([head -n 2 stdout], [0], [dnl
22bb3cbc 3599Bridge: br0
1362e248 3600Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,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_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
22bb3cbc
AW
3601])
3602
3603# Test command: ofproto/trace dp_name odp_flow packet
3604AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3605 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
3606AT_CHECK([tail -1 stdout], [0], [dnl
3607Datapath actions: 2
3608])
b6f00895 3609AT_CHECK([head -n 2 stdout], [0], [dnl
22bb3cbc 3610Bridge: br0
1362e248 3611Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,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_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
22bb3cbc
AW
3612])
3613
3614# Test command: ofproto/trace br_name br_flow packet
3615AT_CHECK([ovs-appctl ofproto/trace br0 \
1362e248 3616 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
22bb3cbc 3617AT_CHECK([tail -1 stdout], [0], [dnl
ed2e7245 3618Datapath actions: 1
22bb3cbc
AW
3619])
3620AT_CHECK([head -n 2 stdout], [0], [dnl
b6f00895 3621Bridge: br0
1362e248 3622Flow: pkt_mark=0x1,skb_priority=0x2,arp,metadata=0,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_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
22bb3cbc
AW
3623])
3624
3625OVS_VSWITCHD_STOP
3626AT_CLEANUP
3627
3628# The second test tests the corner cases
3629AT_SETUP([ofproto-dpif - ofproto/trace command 2])
3630OVS_VSWITCHD_START
3631ADD_OF_PORTS([br0], 1, 2)
3632
3633# Define flows
3634odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
3635br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
3636# Define options
3637generate="-generate"
3638pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
3639
3640# Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
3641m4_foreach(
3642[option],
3643[[],
3644["$generate"],
3645["$pkt"]],
3646[AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
3647 [2], [], [stderr])
3648AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 3649Cannot find the datapath
22bb3cbc
AW
3650ovs-appctl: ovs-vswitchd: server returned an error
3651])])
3652
3653# Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
3654m4_foreach(
3655[option],
3656[[],
3657["$generate"],
3658["$pkt"]],
3659[AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
3660 [2], [], [stderr])
3661AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 3662Cannot find the datapath
22bb3cbc
AW
3663ovs-appctl: ovs-vswitchd: server returned an error
3664])])
3665
3666# Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
3667m4_foreach(
3668[option],
3669[[],
3670["$generate"],
3671["$pkt"]],
3672[AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
3673 [2], [], [stderr])
3674AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 3675Cannot find the datapath
22bb3cbc
AW
3676ovs-appctl: ovs-vswitchd: server returned an error
3677])])
3678
3679# Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
3680m4_foreach(
3681[option],
3682[[],
3683["$generate"],
3684["$pkt"]],
3685[AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
3686 [2], [], [stderr])
3687AT_CHECK([tail -2 stderr], [0], [dnl
0a37839c 3688Cannot find the datapath
22bb3cbc
AW
3689ovs-appctl: ovs-vswitchd: server returned an error
3690])])
3691
3692# Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
3693m4_foreach(
3694[option],
3695[[],
3696["$generate"],
3697["$pkt"]],
3698[AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
3699 [2], [], [stderr])
3700AT_CHECK([tail -2 stderr], [0], [dnl
3701Unknown bridge name
3702ovs-appctl: ovs-vswitchd: server returned an error
3703])])
3704
3705# Test incorrect command: ofproto/trace br_flow [-generate|packet]
3706m4_foreach(
3707[option],
3708[[],
3709["$generate"],
3710["$pkt"]],
3711[AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
3712 [2], [], [stderr])
3713AT_CHECK([tail -2 stderr], [0], [dnl
3714Must specify bridge name
3715ovs-appctl: ovs-vswitchd: server returned an error
3716])])
3717
3718# Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
3719AT_CHECK([ovs-appctl ofproto/trace \
3720 ovs-dummy "$odp_flow" garbage_option],
3721 [2], [stdout],[stderr])
3722AT_CHECK([tail -2 stderr], [0], [dnl
3723Trailing garbage in packet data
3724ovs-appctl: ovs-vswitchd: server returned an error
3725])
3726
3727# Test incorrect command: ofproto/trace with 4 arguments
3728AT_CHECK([ovs-appctl ofproto/trace \
3729 arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
3730AT_CHECK([tail -2 stderr], [0], [dnl
3731"ofproto/trace" command takes at most 3 arguments
3732ovs-appctl: ovs-vswitchd: server returned an error
3733])
3734
3735# Test incorrect command: ofproto/trace with 0 argument
3736AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
3737AT_CHECK([tail -2 stderr], [0], [dnl
3738"ofproto/trace" command requires at least 1 arguments
3739ovs-appctl: ovs-vswitchd: server returned an error
3740])
3741
3742OVS_VSWITCHD_STOP
3743AT_CLEANUP
3744
aee0979b
BP
3745AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
3746OVS_VSWITCHD_START
3747ADD_OF_PORTS([br0], 1, 2, 3)
3748
3749AT_DATA([flows.txt], [dnl
3750in_port=1 actions=output:2
3751in_port=2 actions=output:1
3752])
3753AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3754
3755AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
3756AT_CHECK([tail -1 stdout], [0], [dnl
3757Datapath actions: push_vlan(vid=123,pcp=0),2
3758])
3759
3760OVS_VSWITCHD_STOP
3761AT_CLEANUP
3762
3763
b44a10b7
BP
3764m4_define([OFPROTO_TRACE],
3765 [flow="$2"
3766 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
3767 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3768 expected="$4"
3769 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
3770 [0], [stdout])
3771 mv stdout expout
3772 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
3773 [0], [expout])])
3774
3775AT_SETUP([ofproto-dpif - MAC learning])
432fca23
BP
3776OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
3777ADD_OF_PORTS([br0], 1, 2, 3)
b44a10b7 3778
b44a10b7
BP
3779arp='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)'
3780
3781# Trace an ARP packet arriving on p3, to create a MAC learning entry.
3782OFPROTO_TRACE(
50aa28fd 3783 [ovs-dummy],
247527db 3784 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 3785 [-generate],
e44768b7 3786 [1,2,100])
b44a10b7
BP
3787
3788# Check for the MAC learning entry.
83664f72 3789AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 3790 port VLAN MAC Age
247527db 3791 3 0 50:54:00:00:00:05 ?
b44a10b7
BP
3792])
3793
3794# Trace a packet arrival destined for the learned MAC.
3795# (This will also learn a MAC.)
3796OFPROTO_TRACE(
50aa28fd 3797 [ovs-dummy],
247527db 3798 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
b44a10b7 3799 [-generate],
247527db 3800 [3])
b44a10b7
BP
3801
3802# Check for both MAC learning entries.
83664f72 3803AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 3804 port VLAN MAC Age
247527db
BP
3805 3 0 50:54:00:00:00:05 ?
3806 1 0 50:54:00:00:00:06 ?
b44a10b7
BP
3807])
3808
3809# Trace a packet arrival that updates the first learned MAC entry.
3810OFPROTO_TRACE(
50aa28fd 3811 [ovs-dummy],
247527db 3812 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 3813 [-generate],
e44768b7 3814 [1,3,100])
b44a10b7
BP
3815
3816# Check that the MAC learning entry was updated.
83664f72 3817AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 3818 port VLAN MAC Age
247527db
BP
3819 1 0 50:54:00:00:00:06 ?
3820 2 0 50:54:00:00:00:05 ?
b44a10b7
BP
3821])
3822
3823# Add another bridge.
3824AT_CHECK(
3825 [ovs-vsctl \
3826 -- add-br br1 \
ad28062f
BP
3827 -- set bridge br1 datapath-type=dummy])
3828ADD_OF_PORTS([br1], 4, 5)
b44a10b7
BP
3829
3830# Trace some packet arrivals in br1 to create MAC learning entries there too.
3831OFPROTO_TRACE(
50aa28fd 3832 [ovs-dummy],
247527db 3833 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 3834 [-generate],
e44768b7 3835 [5,101])
b44a10b7 3836OFPROTO_TRACE(
50aa28fd 3837 [ovs-dummy],
247527db 3838 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
b44a10b7 3839 [-generate],
e44768b7 3840 [4,101])
b44a10b7
BP
3841
3842# Check that the MAC learning entries were added.
83664f72 3843AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 3844 port VLAN MAC Age
247527db
BP
3845 4 0 50:54:00:00:00:06 ?
3846 5 0 50:54:00:00:00:07 ?
b44a10b7
BP
3847])
3848
3849# Delete port p1 and see that its MAC learning entry disappeared, and
3850# that the MAC learning entry for the same MAC was also deleted from br1.
3851AT_CHECK([ovs-vsctl del-port p1])
83664f72 3852AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 3853 port VLAN MAC Age
247527db 3854 2 0 50:54:00:00:00:05 ?
b44a10b7 3855])
83664f72 3856AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
b44a10b7 3857 port VLAN MAC Age
247527db 3858 5 0 50:54:00:00:00:07 ?
b44a10b7
BP
3859])
3860
3861OVS_VSWITCHD_STOP
3862AT_CLEANUP
17f7f7e0 3863
c4069512
BP
3864AT_SETUP([ofproto-dpif - MAC table overflow])
3865OVS_VSWITCHD_START(
ad28062f
BP
3866 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
3867ADD_OF_PORTS([br0], 1, 2, 3)
c4069512
BP
3868
3869arp='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)'
3870
3871AT_CHECK([ovs-appctl time/stop])
3872
3873# Trace 10 ARP packets arriving on p3, to create MAC learning entries.
3874for i in 0 1 2 3 4 5 6 7 8 9; do
3875 OFPROTO_TRACE(
50aa28fd 3876 [ovs-dummy],
c4069512
BP
3877 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
3878 [-generate],
3879 [1,2,100])
3880 ovs-appctl time/warp 1000
3881done
3882
3883# Check for the MAC learning entries.
3884AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
3885 [0], [dnl
3886 3 0 50:54:00:00:00:00
3887 3 0 50:54:00:00:00:01
3888 3 0 50:54:00:00:00:02
3889 3 0 50:54:00:00:00:03
3890 3 0 50:54:00:00:00:04
3891 3 0 50:54:00:00:00:05
3892 3 0 50:54:00:00:00:06
3893 3 0 50:54:00:00:00:07
3894 3 0 50:54:00:00:00:08
3895 3 0 50:54:00:00:00:09
3896 port VLAN MAC Age
3897])
3898
3899# Trace another ARP packet on another MAC.
3900OFPROTO_TRACE(
50aa28fd 3901 [ovs-dummy],
c4069512
BP
3902 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
3903 [-generate],
3904 [1,2,100])
3905
3906# Check that the new one chased the oldest one out of the table.
3907AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
3908 [0], [dnl
3909 3 0 50:54:00:00:00:01 ?
3910 3 0 50:54:00:00:00:02 ?
3911 3 0 50:54:00:00:00:03 ?
3912 3 0 50:54:00:00:00:04 ?
3913 3 0 50:54:00:00:00:05 ?
3914 3 0 50:54:00:00:00:06 ?
3915 3 0 50:54:00:00:00:07 ?
3916 3 0 50:54:00:00:00:08 ?
3917 3 0 50:54:00:00:00:09 ?
3918 3 0 50:54:00:00:00:10 ?
3919 port VLAN MAC Age
3920])
3921OVS_VSWITCHD_STOP
3922AT_CLEANUP
3923
e731d71b
AS
3924# CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS)
3925#
3926# Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
3927#
3928# IP_VERSION_TYPE is used in AT_SETUP
3929m4_define([CHECK_SFLOW_SAMPLING_PACKET],
3930 [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector])
0af89118 3931 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
e731d71b
AS
3932 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
3933
3934 ON_EXIT([kill `cat test-sflow.pid`])
eadd1644 3935 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
e731d71b 3936 AT_CAPTURE_FILE([sflow.log])
b52ecd96 3937 SFLOW_PORT=`parse_listening_port < test-sflow.log`
e731d71b
AS
3938 ovs-appctl time/stop
3939
3940 ADD_OF_PORTS([br0], 1, 2)
3941 ovs-vsctl \
3942 set Interface br0 options:ifindex=1002 -- \
3943 set Interface p1 options:ifindex=1004 -- \
3944 set Interface p2 options:ifindex=1003 -- \
3945 set Bridge br0 sflow=@sf -- \
3946 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
9a9808d7 3947 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
e731d71b
AS
3948
3949 dnl open with ARP packets to seed the bridge-learning. The output
3950 dnl ifIndex numbers should be reported predictably after that.
3951 dnl Since we set sampling=1 we should see all of these packets
3952 dnl reported. Sorting the output by data-source and seqNo makes
3953 dnl it deterministic. Ensuring that we send at least two packets
3954 dnl into each port means we get to check the seq nos are
3955 dnl incrementing correctly.
3956 dnl because packets from different ports can be handled by separate
3957 dnl threads, put some sleeps
3958
3959 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)'
3960 sleep 1
3961 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)'
3962 sleep 1
3963 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)'
3964 sleep 1
3965 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)'
3966 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)'
3967
3968 dnl sleep long enough to get more than one counter sample
3969 dnl from each datasource so we can check sequence numbers
3970 for i in `seq 1 30`; do
3971 ovs-appctl time/warp 100
3972 done
3973 OVS_VSWITCHD_STOP
3974 ovs-appctl -t test-sflow exit
8073dd31 3975
e731d71b 3976 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
8073dd31
NM
3977 /g']], [0], [dnl
3978HEADER
3979 dgramSeqNo=1
743cea45 3980 ds=127.0.0.1>2:1000
8073dd31
NM
3981 fsSeqNo=1
3982 in_vlan=0
3983 in_priority=0
3984 out_vlan=0
3985 out_priority=0
3986 meanSkip=1
3987 samplePool=1
3988 dropEvents=0
743cea45 3989 in_ifindex=1004
8073dd31
NM
3990 in_format=0
3991 out_ifindex=2
3992 out_format=2
3993 hdr_prot=1
3994 pkt_len=64
3995 stripped=4
3996 hdr_len=60
743cea45 3997 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
3998HEADER
3999 dgramSeqNo=1
743cea45 4000 ds=127.0.0.1>2:1000
8073dd31
NM
4001 fsSeqNo=2
4002 in_vlan=0
4003 in_priority=0
4004 out_vlan=0
4005 out_priority=0
4006 meanSkip=1
4007 samplePool=2
4008 dropEvents=0
4009 in_ifindex=1003
4010 in_format=0
743cea45
NM
4011 out_ifindex=2
4012 out_format=2
8073dd31
NM
4013 hdr_prot=1
4014 pkt_len=64
4015 stripped=4
4016 hdr_len=60
743cea45 4017 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
4018HEADER
4019 dgramSeqNo=1
743cea45 4020 ds=127.0.0.1>2:1000
8073dd31
NM
4021 fsSeqNo=3
4022 in_vlan=0
4023 in_priority=0
4024 out_vlan=0
4025 out_priority=0
4026 meanSkip=1
4027 samplePool=3
4028 dropEvents=0
743cea45 4029 in_ifindex=1004
8073dd31 4030 in_format=0
743cea45 4031 out_ifindex=1003
8073dd31
NM
4032 out_format=0
4033 hdr_prot=1
4034 pkt_len=64
4035 stripped=4
4036 hdr_len=60
743cea45 4037 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
4038HEADER
4039 dgramSeqNo=1
743cea45
NM
4040 ds=127.0.0.1>2:1000
4041 fsSeqNo=4
8073dd31
NM
4042 in_vlan=0
4043 in_priority=0
4044 out_vlan=0
4045 out_priority=0
4046 meanSkip=1
743cea45 4047 samplePool=4
8073dd31 4048 dropEvents=0
743cea45 4049 in_ifindex=1003
8073dd31 4050 in_format=0
743cea45
NM
4051 out_ifindex=1004
4052 out_format=0
8073dd31
NM
4053 hdr_prot=1
4054 pkt_len=64
4055 stripped=4
4056 hdr_len=60
743cea45 4057 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
4058HEADER
4059 dgramSeqNo=1
743cea45
NM
4060 ds=127.0.0.1>2:1000
4061 fsSeqNo=5
8073dd31
NM
4062 in_vlan=0
4063 in_priority=0
4064 out_vlan=0
4065 out_priority=0
4066 meanSkip=1
743cea45 4067 samplePool=5
8073dd31 4068 dropEvents=0
743cea45 4069 in_ifindex=1003
8073dd31 4070 in_format=0
743cea45 4071 out_ifindex=1004
8073dd31
NM
4072 out_format=0
4073 hdr_prot=1
4074 pkt_len=64
4075 stripped=4
4076 hdr_len=60
52105b67 4077 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
4078])
4079
e731d71b 4080 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\
8073dd31
NM
4081 /g']], [0], [dnl
4082IFCOUNTERS
4083 dgramSeqNo=2
4084 ds=127.0.0.1>0:1002
4085 csSeqNo=1
4086 ifindex=1002
4087 type=6
4088 ifspeed=100000000
4089 direction=0
1839c356 4090 status=0
8073dd31
NM
4091 in_octets=0
4092 in_unicasts=0
4093 in_multicasts=0
4094 in_broadcasts=4294967295
4095 in_discards=0
4096 in_errors=0
4097 in_unknownprotos=4294967295
4098 out_octets=120
4099 out_unicasts=2
4100 out_multicasts=4294967295
4101 out_broadcasts=4294967295
4102 out_discards=0
4103 out_errors=0
4104 promiscuous=0
4105IFCOUNTERS
4106 dgramSeqNo=2
4107 ds=127.0.0.1>0:1003
4108 csSeqNo=1
4109 ifindex=1003
4110 type=6
4111 ifspeed=100000000
4112 direction=0
4113 status=0
52105b67 4114 in_octets=138
8073dd31
NM
4115 in_unicasts=3
4116 in_multicasts=0
4117 in_broadcasts=4294967295
4118 in_discards=0
4119 in_errors=0
4120 in_unknownprotos=4294967295
4121 out_octets=120
4122 out_unicasts=2
4123 out_multicasts=4294967295
4124 out_broadcasts=4294967295
4125 out_discards=0
4126 out_errors=0
4127 promiscuous=0
4128IFCOUNTERS
4129 dgramSeqNo=2
4130 ds=127.0.0.1>0:1004
4131 csSeqNo=1
4132 ifindex=1004
4133 type=6
4134 ifspeed=100000000
4135 direction=0
4136 status=0
4137 in_octets=84
4138 in_unicasts=2
4139 in_multicasts=0
4140 in_broadcasts=4294967295
4141 in_discards=0
4142 in_errors=0
4143 in_unknownprotos=4294967295
4144 out_octets=180
4145 out_unicasts=3
4146 out_multicasts=4294967295
4147 out_broadcasts=4294967295
4148 out_discards=0
4149 out_errors=0
4150 promiscuous=0
4151IFCOUNTERS
4152 dgramSeqNo=3
4153 ds=127.0.0.1>0:1002
4154 csSeqNo=2
4155 ifindex=1002
4156 type=6
4157 ifspeed=100000000
4158 direction=0
1839c356 4159 status=0
8073dd31
NM
4160 in_octets=0
4161 in_unicasts=0
4162 in_multicasts=0
4163 in_broadcasts=4294967295
4164 in_discards=0
4165 in_errors=0
4166 in_unknownprotos=4294967295
4167 out_octets=120
4168 out_unicasts=2
4169 out_multicasts=4294967295
4170 out_broadcasts=4294967295
4171 out_discards=0
4172 out_errors=0
4173 promiscuous=0
4174IFCOUNTERS
4175 dgramSeqNo=3
4176 ds=127.0.0.1>0:1003
4177 csSeqNo=2
4178 ifindex=1003
4179 type=6
4180 ifspeed=100000000
4181 direction=0
4182 status=0
52105b67 4183 in_octets=138
8073dd31
NM
4184 in_unicasts=3
4185 in_multicasts=0
4186 in_broadcasts=4294967295
4187 in_discards=0
4188 in_errors=0
4189 in_unknownprotos=4294967295
4190 out_octets=120
4191 out_unicasts=2
4192 out_multicasts=4294967295
4193 out_broadcasts=4294967295
4194 out_discards=0
4195 out_errors=0
4196 promiscuous=0
4197IFCOUNTERS
4198 dgramSeqNo=3
4199 ds=127.0.0.1>0:1004
4200 csSeqNo=2
4201 ifindex=1004
4202 type=6
4203 ifspeed=100000000
4204 direction=0
4205 status=0
4206 in_octets=84
4207 in_unicasts=2
4208 in_multicasts=0
4209 in_broadcasts=4294967295
4210 in_discards=0
4211 in_errors=0
4212 in_unknownprotos=4294967295
4213 out_octets=180
4214 out_unicasts=3
4215 out_multicasts=4294967295
4216 out_broadcasts=4294967295
4217 out_discards=0
4218 out_errors=0
4219 promiscuous=0
4220])
e731d71b 4221 AT_CLEANUP])
17f7f7e0 4222
e731d71b
AS
4223CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4])
4224CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6])
1e04fcc8 4225
e731d71b
AS
4226# CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
4227#
4228# Test that basic NetFlow reports flow statistics correctly:
4229# The initial packet of a flow are correctly accounted.
4230# Later packets within a flow are correctly accounted.
4231# Flow actions changing (in this case, due to MAC learning)
4232# cause a record to be sent.
4233#
4234# IP_VERSION_TYPE is used in AT_SETUP
4235m4_define([CHECK_NETFLOW_EXPIRATION],
4236 [AT_SETUP([ofproto-dpif - NetFlow flow expiration - $2 collector])
4237 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4238 ADD_OF_PORTS([br0], 1, 2)
4239
4240 ovs-appctl time/stop
4241 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 4242 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 4243 AT_CAPTURE_FILE([netflow.log])
b52ecd96 4244 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
e731d71b
AS
4245
4246 ovs-vsctl \
4247 set Bridge br0 netflow=@nf -- \
4248 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4249 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
4250
4251 for delay in 1000 30000; do
4252 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 4253 sleep 1 # ensure the order in which these two packets are processed
e731d71b
AS
4254 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)'
4255
4256 ovs-appctl time/warp $delay
4257 done
17f7f7e0 4258
e731d71b 4259 ovs-appctl time/warp 6000
27f57736 4260 ovs-appctl revalidator/wait
e731d71b
AS
4261 OVS_VSWITCHD_STOP
4262 ovs-appctl -t test-netflow exit
e79a6c83 4263
e731d71b 4264 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 4265
e731d71b 4266 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 4267
e731d71b
AS
4268 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
4269 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
4270 AT_CHECK([test $separate = 2 || test $combined = 1], [0])
17f7f7e0 4271
e731d71b 4272 AT_CLEANUP])
17f7f7e0 4273
e731d71b
AS
4274CHECK_NETFLOW_EXPIRATION([127.0.0.1], [IPv4])
4275CHECK_NETFLOW_EXPIRATION([[[::1]]], [IPv6])
1e04fcc8 4276
e731d71b
AS
4277# CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
4278#
4279# Test that basic NetFlow reports active expirations correctly.
4280#
4281# IP_VERSION_TYPE is used in AT_SETUP
4282m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
4283 [AT_SETUP([ofproto-dpif - NetFlow active expiration - $2 collector])
1e04fcc8 4284
e731d71b
AS
4285 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4286 ADD_OF_PORTS([br0], 1, 2)
17f7f7e0 4287
e731d71b 4288 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 4289 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 4290 AT_CAPTURE_FILE([netflow.log])
b52ecd96 4291 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
17f7f7e0 4292
e731d71b
AS
4293 ovs-vsctl \
4294 set Bridge br0 netflow=@nf -- \
4295 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4296 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
17f7f7e0 4297
e731d71b
AS
4298 AT_CHECK([ovs-appctl time/stop])
4299 n=1
4300 while test $n -le 60; do
4301 n=`expr $n + 1`
17f7f7e0 4302
e731d71b
AS
4303 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)'
4304 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 4305
e731d71b
AS
4306 ovs-appctl time/warp 1000
4307 done
17f7f7e0 4308
e731d71b
AS
4309 ovs-appctl time/warp 10000
4310
27f57736 4311 ovs-appctl revalidator/wait
e731d71b
AS
4312 OVS_VSWITCHD_STOP
4313 ovs-appctl -t test-netflow exit
4314
4315 # Count the number of reported packets:
4316 # - From source to destination before MAC learning kicks in (just one).
4317 # - From source to destination after that.
4318 # - From destination to source.
4319 n_learn=0
4320 n_in=0
4321 n_out=0
4322 n_other=0
4323 n_recs=0
4324 none=0
4325 while read line; do
4326 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
4327 case $pkts in
4328 [[0-9]]*) ;;
4329 *) continue ;;
4330 esac
4331
4332 case $line in
4333 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
4334 counter=n_learn
4335 ;;
4336 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
4337 counter=n_in
4338 ;;
4339 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
4340 counter=n_out
4341 ;;
4342 *)
4343 counter=n_other
4344 ;;
4345 esac
4346 eval $counter=\`expr \$$counter + \$pkts\`
4347 n_recs=`expr $n_recs + 1`
4348 done < netflow.log
4349
4350 # There should be exactly 1 MAC learning packet,
4351 # exactly 59 other packets in that direction,
4352 # and exactly 60 packets in the other direction.
4353 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
4354])
4355
4356 AT_CLEANUP])
4357
4358CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1], [IPv4])
4359CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]], [IPv6])
f27f2134 4360
23a7d252
JS
4361AT_SETUP([ofproto-dpif - flow stats])
4362OVS_VSWITCHD_START
4363AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
4364AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
4365
4366ovs-appctl time/stop
4367
4368for i in `seq 1 10`; do
4369 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)'
4370done
4371
4372ovs-appctl time/warp 1000
27f57736 4373ovs-appctl revalidator/wait
23a7d252 4374
e96a5c24 4375AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
11f9de00 4376AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
e96a5c24 4377 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
11f9de00 4378 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
e96a5c24
JS
4379])
4380OVS_VSWITCHD_STOP
4381AT_CLEANUP
4382
4383AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
4384OVS_VSWITCHD_START
4385AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
4386AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
4387
4388ovs-appctl time/stop
4389
4390for i in `seq 1 10`; do
4391 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)'
4392done
4393
4394ovs-appctl time/warp 100
4395AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
4396ovs-appctl time/warp 1000
4397
23a7d252 4398AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
11f9de00 4399AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
23a7d252 4400 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
11f9de00 4401 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
23a7d252
JS
4402])
4403OVS_VSWITCHD_STOP
4404AT_CLEANUP
4405
f27f2134
BP
4406AT_SETUP([idle_age and hard_age increase over time])
4407OVS_VSWITCHD_START
4408
4409# get_ages DURATION HARD IDLE
4410#
4411# Fetch the flow duration, hard age, and idle age into the variables
4412# whose names are given as arguments. Rounds DURATION down to the
4413# nearest integer. If hard_age doesn't appear in the output, sets
4414# HARD to "none". If idle_age doesn't appear in the output, sets IDLE
4415# to 0.
4416get_ages () {
4417 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
4418
4419 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
4420 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
4421 AS_VAR_COPY([$1], [duration])
4422
4423 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
4424 if test X"$hard" = X; then
4425 hard=none
4426 else
4427 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
4428 fi
4429 AS_VAR_COPY([$2], [hard])
4430
4431 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
4432 if test X"$idle" = X; then
4433 idle=0
4434 else
4435 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
4436 fi
4437 AS_VAR_COPY([$3], [idle])
4438}
4439
4440# Add a flow and get its initial hard and idle age.
4441AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
4442get_ages duration1 hard1 idle1
4443
31ef9f51 4444ovs-appctl time/stop
f27f2134
BP
4445# Warp time forward by 10 seconds, then modify the flow's actions.
4446ovs-appctl time/warp 10000
4447get_ages duration2 hard2 idle2
4448AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
4449
4450# Warp time forward by 10 seconds.
4451ovs-appctl time/warp 10000
4452get_ages duration3 hard3 idle3
4453
4454# Warp time forward 10 more seconds, then pass some packets through the flow,
4455# then warp forward a few more times because idle times are only updated
4456# occasionally.
4457ovs-appctl time/warp 10000
4458ovs-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)'
4459ovs-appctl time/warp 1000
4460ovs-appctl time/warp 1000
4461ovs-appctl time/warp 1000
c0526804 4462sleep 1
f27f2134
BP
4463get_ages duration4 hard4 idle4
4464
4465printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
4466printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
4467printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
4468
4469# Duration should increase steadily over time.
4470AT_CHECK([test $duration1 -lt $duration2])
4471AT_CHECK([test $duration2 -lt $duration3])
4472AT_CHECK([test $duration3 -lt $duration4])
4473
4474# Hard age should be "none" initially because it's the same as flow_duration,
4475# then it should increase.
4476AT_CHECK([test $hard1 = none])
4477AT_CHECK([test $hard2 = none])
4478AT_CHECK([test $hard3 != none])
4479AT_CHECK([test $hard4 != none])
4480AT_CHECK([test $hard3 -lt $hard4])
4481
4482# Idle age should increase from 1 to 2 to 3, then decrease.
4483AT_CHECK([test $idle1 -lt $idle2])
4484AT_CHECK([test $idle2 -lt $idle3])
4485AT_CHECK([test $idle3 -gt $idle4])
4486
4487# Check some invariant relationships.
4488AT_CHECK([test $duration1 = $idle1])
4489AT_CHECK([test $duration2 = $idle2])
4490AT_CHECK([test $duration3 = $idle3])
4491AT_CHECK([test $idle3 -gt $hard3])
4492AT_CHECK([test $idle4 -lt $hard4])
4493AT_CHECK([test $hard4 -lt $duration4])
4494
4495OVS_VSWITCHD_STOP
4496AT_CLEANUP
0e553d9c
BP
4497
4498AT_SETUP([ofproto-dpif - fin_timeout])
4499OVS_VSWITCHD_START
b5c1a5df 4500ovs-appctl time/stop
0e553d9c
BP
4501AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
4502AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
4503[NXST_FLOW reply:
4504 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
4505])
31ef9f51 4506
0e553d9c
BP
4507# Check that a TCP SYN packet does not change the timeout. (Because
4508# flow stats updates are mainly what implements the fin_timeout
4509# feature, we warp forward a couple of times to ensure that flow stats
4510# run before re-checking the flow table.)
323cc924 4511AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
0e553d9c
BP
4512AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
4513warped
4514])
27f57736 4515ovs-appctl revalidator/wait
0e553d9c
BP
4516AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
4517[NXST_FLOW reply:
4518 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
4519])
4520# Check that a TCP FIN packet does change the timeout.
323cc924 4521AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
0e553d9c
BP
4522AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
4523warped
4524])
4525AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
4526[NXST_FLOW reply:
4527 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
4528])
4529OVS_VSWITCHD_STOP
4530AT_CLEANUP
27022416
JP
4531
4532AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
4533OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
4534ADD_OF_PORTS([br0], [1], [2])
4535ADD_OF_PORTS([br1], [3])
4536
4537AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
4538dummy@br0
4539dummy@br1
4540])
4541OVS_VSWITCHD_STOP
4542AT_CLEANUP
4543
4544AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
4545OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
4546ADD_OF_PORTS([br0], [1], [2])
4547ADD_OF_PORTS([br1], [3])
4548
4549AT_CHECK([ovs-appctl dpif/show], [0], [dnl
dc54ef36 4550dummy@ovs-dummy: hit:0 missed:0
e79a6c83 4551 br0:
dc54ef36
EJ
4552 br0 65534/100: (dummy)
4553 p1 1/1: (dummy)
4554 p2 2/2: (dummy)
e79a6c83 4555 br1:
dc54ef36
EJ
4556 br1 65534/101: (dummy)
4557 p3 3/3: (dummy)
27022416
JP
4558])
4559OVS_VSWITCHD_STOP
4560AT_CLEANUP
4561
4562AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
054e5aa6 4563# bump max-idle to avoid the flows being reclaimed behind us
27022416 4564OVS_VSWITCHD_START([add-br br1 -- \
054e5aa6
YT
4565 set bridge br1 datapath-type=dummy fail-mode=secure -- \
4566 set Open_vSwitch . other_config:max-idle=10000])
27022416
JP
4567ADD_OF_PORTS([br0], [1], [2])
4568ADD_OF_PORTS([br1], [3])
4569
323cc924
BP
4570AT_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)'])
4571AT_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)'])
4572AT_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 4573ovs-appctl revalidator/wait
27022416 4574AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
fbfe01de
AZ
4575skb_priority(0),recirc_id(0),in_port(1),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/0xff), packets:0, bytes:0, used:never, actions:drop
4576skb_priority(0),recirc_id(0),in_port(2),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/0xff), packets:0, bytes:0, used:never, actions:drop
27022416
JP
4577])
4578
4579AT_CHECK([ovs-appctl dpif/dump-flows br1 | sort | STRIP_USED], [0], [dnl
fbfe01de 4580skb_priority(0),recirc_id(0),in_port(3),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/0xff), packets:0, bytes:0, used:never, actions:drop
27022416
JP
4581])
4582
04b541df 4583AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sort | STRIP_USED], [0], [dnl
7ce2769e
JS
4584skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
4585skb_priority(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/0xff),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
04b541df
GS
4586])
4587
4588AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | sort | STRIP_USED], [0], [dnl
7ce2769e 4589skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
04b541df
GS
4590])
4591
27022416
JP
4592OVS_VSWITCHD_STOP
4593AT_CLEANUP
4594
50c1efc9 4595AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
8bfd0fda
BP
4596OVS_VSWITCHD_START([dnl
4597 add-port br0 p1 -- set Interface p1 type=dummy
4598])
c2a77f33 4599AT_CHECK([ovs-appctl vlog/set dpif:dbg])
8bfd0fda
BP
4600ON_EXIT([kill `cat ovs-ofctl.pid`])
4601
4602AT_CAPTURE_FILE([ofctl_monitor.log])
4603AT_DATA([flows.txt], [dnl
4604dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
4605dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
4606])
4607AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4608
4609dnl Packet is sent to userspace because a MPLS push or pop action is applied to
47fb7f71 4610dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
8bfd0fda 4611dnl
47fb7f71 4612dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
8bfd0fda 4613dnl 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
4614dnl (label 20, exp 0, [S], ttl 32)
4615dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
4616dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
4617
4618for dl_src in 00 01; do
47fb7f71 4619 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
4620done
4621sleep 1 # wait for the datapath flow installed
4622for dl_src in 00 01; do
c2a77f33 4623 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep ":$dl_src/" | STRIP_USED], [0], [dnl
7ce2769e 4624skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller))
8bfd0fda
BP
4625])
4626done
4627
4628OVS_VSWITCHD_STOP
4629AT_CLEANUP
4630
4631
50c1efc9 4632AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
8bfd0fda
BP
4633OVS_VSWITCHD_START([dnl
4634 add-port br0 p1 -- set Interface p1 type=dummy
4635])
c2a77f33 4636AT_CHECK([ovs-appctl vlog/set dpif:dbg])
8bfd0fda
BP
4637ON_EXIT([kill `cat ovs-ofctl.pid`])
4638
4639AT_CAPTURE_FILE([ofctl_monitor.log])
4640AT_DATA([flows.txt], [dnl
4641dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
4642dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
4643])
4644AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4645
4646dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
4647dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
47fb7f71 4648dnl can't determine the resulting MPLS label after MPLS push/pop actions.
8bfd0fda
BP
4649dnl
4650dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
4651dnl 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)
4652dnl (label 20, exp 0, ttl 32)
4653dnl (label 20, exp 0, ttl 32)
4654dnl (label 20, exp 0, [S], ttl 32)
4655dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
4656dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
8bfd0fda 4657
47fb7f71
JS
4658for dl_src in 00 01; do
4659 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
4660done
4661sleep 1 # wait for the datapath flow installed
4662for dl_src in 00 01; do
c2a77f33 4663 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep ":$dl_src/" | STRIP_USED], [0], [dnl
7ce2769e 4664skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller))
8bfd0fda 4665])
47fb7f71 4666done
8bfd0fda
BP
4667
4668OVS_VSWITCHD_STOP
4669AT_CLEANUP
4670
0a740f48
EJ
4671AT_SETUP([ofproto-dpif - patch ports])
4672OVS_VSWITCHD_START([add-br br1 \
4673-- set bridge br1 datapath-type=dummy fail-mode=secure \
4674-- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
4675-- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
4676
4677ADD_OF_PORTS([br0], [2])
4678ADD_OF_PORTS([br1], [3])
4679
aef0491b 4680AT_CHECK([ovs-appctl time/stop])
c2a77f33 4681AT_CHECK([ovs-appctl vlog/set dpif:dbg])
9fc0165a 4682
0a740f48
EJ
4683AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
4684AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
4685
4686for i in $(seq 1 10); do
4687 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
4688 if [[ $i -eq 1 ]]; then
4689 sleep 1
4690 fi
0a740f48
EJ
4691done
4692
4693for i in $(seq 1 5); do
4694 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
4695 if [[ $i -eq 1 ]]; then
4696 sleep 1
4697 fi
0a740f48
EJ
4698done
4699
0a8763fc
EJ
4700AT_CHECK([ovs-appctl time/warp 500], [0],
4701[warped
735d7efb 4702])
732207ad 4703sleep 1 # wait for log writer
735d7efb 4704
0a740f48 4705AT_CHECK([ovs-appctl dpif/show], [0], [dnl
dc54ef36 4706dummy@ovs-dummy: hit:13 missed:2
e79a6c83 4707 br0:
dc54ef36
EJ
4708 br0 65534/100: (dummy)
4709 p2 2/2: (dummy)
4710 pbr0 1/none: (patch: peer=pbr1)
e79a6c83 4711 br1:
dc54ef36
EJ
4712 br1 65534/101: (dummy)
4713 p3 3/3: (dummy)
4714 pbr1 1/none: (patch: peer=pbr0)
0a740f48
EJ
4715])
4716
c2a77f33 4717AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
7ce2769e
JS
4718skb_priority(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/0xff),icmp(type=8/0,code=0/0), actions:101,3,2
4719skb_priority(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/0xff),icmp(type=8/0,code=0/0), actions:100,2,3
c2a77f33
JS
4720])
4721
4722AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | FILTER_FLOW_DUMP], [0], [dnl
7ce2769e 4723skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:9, bytes:540, used:0.0s, actions:101,3,2
c2a77f33
JS
4724])
4725AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | FILTER_FLOW_DUMP], [0], [dnl
7ce2769e 4726skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:4, bytes:240, used:0.0s, actions:100,2,3
0a740f48
EJ
4727])
4728
4729AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
4730OFPST_PORT reply (xid=0x4): 1 ports
4731 port 1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
4732 tx pkts=10, bytes=600, drop=0, errs=0, coll=0
4733])
4734
4735AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
4736OFPST_PORT reply (xid=0x4): 1 ports
4737 port 1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
4738 tx pkts=5, bytes=300, drop=0, errs=0, coll=0
4739])
4740
4741OVS_VSWITCHD_STOP
4742AT_CLEANUP
655ab909 4743
65e0be10
BP
4744AT_SETUP([ofproto-dpif - port duration])
4745OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
4746ADD_OF_PORTS([br0], 1, 2)
4747
31ef9f51 4748ovs-appctl time/stop
65e0be10
BP
4749ovs-appctl time/warp 10000
4750
4751AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
125bf01d 4752AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
65e0be10 4753[dnl
65e0be10 4754 duration=?s
65e0be10 4755 duration=?s
65e0be10
BP
4756 duration=?s
4757])
4758OVS_VSWITCHD_STOP
4759AT_CLEANUP
bcd2633a
JP
4760
4761dnl ----------------------------------------------------------------------
4762AT_BANNER([ofproto-dpif -- megaflows])
4763
bcd2633a
JP
4764AT_SETUP([ofproto-dpif megaflow - port classification])
4765OVS_VSWITCHD_START
c2a77f33 4766AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4767ADD_OF_PORTS([br0], [1], [2])
4768AT_DATA([flows.txt], [dnl
4769table=0 in_port=1 actions=output(2)
4770])
4771AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4772AT_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 4773sleep 1
bcd2633a 4774AT_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 4775sleep 1
c2a77f33 4776AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e 4777skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(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/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
4778])
4779OVS_VSWITCHD_STOP
4780AT_CLEANUP
4781
4782AT_SETUP([ofproto-dpif megaflow - L2 classification])
4783OVS_VSWITCHD_START
c2a77f33 4784AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4785ADD_OF_PORTS([br0], [1], [2])
4786AT_DATA([flows.txt], [dnl
4787table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
4788])
4789AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4790AT_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)'])
4791AT_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 4792sleep 1
c2a77f33 4793AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e 4794skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
e9319757 4795skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:00:00:00:02,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
4796])
4797OVS_VSWITCHD_STOP
4798AT_CLEANUP
4799
4800AT_SETUP([ofproto-dpif megaflow - L3 classification])
4801OVS_VSWITCHD_START
c2a77f33 4802AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a 4803ADD_OF_PORTS([br0], [1], [2])
13751fd8 4804AT_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
4805AT_DATA([flows.txt], [dnl
4806table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
4807])
4808AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4809AT_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)'])
4810AT_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 4811sleep 1
c2a77f33 4812AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
a64759f0 4813skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.2,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
7ce2769e 4814skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
4815])
4816OVS_VSWITCHD_STOP
4817AT_CLEANUP
4818
13751fd8
JR
4819AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
4820OVS_VSWITCHD_START
c2a77f33 4821AT_CHECK([ovs-appctl vlog/set dpif:dbg])
13751fd8
JR
4822ADD_OF_PORTS([br0], [1], [2])
4823AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], [])
4824AT_DATA([flows.txt], [dnl
4825table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
4826])
4827AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4828AT_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)'])
4829AT_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 4830sleep 1
c2a77f33 4831AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e 4832skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),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(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff,dst=fe80::2/::,label=0/0,proto=10/0,tclass=0x70/0,hlimit=128/0,frag=no/0xff), actions: <del>
e9319757 4833skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:0:4::,dst=2001:db8:3c4d:1:2:3:4:1/::,label=0/0,proto=99/0,tclass=0x70/0,hlimit=64/0,frag=no/0xff), actions: <del>
13751fd8
JR
4834])
4835OVS_VSWITCHD_STOP
4836AT_CLEANUP
4837
bcd2633a
JP
4838AT_SETUP([ofproto-dpif megaflow - L4 classification])
4839OVS_VSWITCHD_START
c2a77f33 4840AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4841ADD_OF_PORTS([br0], [1], [2])
4842AT_DATA([flows.txt], [dnl
4843table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
4844])
4845AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4846AT_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 4847sleep 1
bcd2633a 4848AT_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 4849sleep 1
c2a77f33 4850AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e 4851skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0xff,code=0/0), actions: <del>
bcd2633a
JP
4852])
4853OVS_VSWITCHD_STOP
4854AT_CLEANUP
4855
4856AT_SETUP([ofproto-dpif megaflow - normal])
4857OVS_VSWITCHD_START
c2a77f33 4858AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4859ADD_OF_PORTS([br0], [1], [2])
4860AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4861AT_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)'])
4862AT_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 4863sleep 1
c2a77f33 4864AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
4865skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4866skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
4867])
4868OVS_VSWITCHD_STOP
4869AT_CLEANUP
4870
4871AT_SETUP([ofproto-dpif megaflow - mpls])
4872OVS_VSWITCHD_START
c2a77f33 4873AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4874ADD_OF_PORTS([br0], [1], [2])
4875AT_DATA([flows.txt], [dnl
4876table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
4877table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
4878])
4879AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4880AT_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)'])
4881AT_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 4882sleep 1
c2a77f33 4883AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
4884skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: <del>
4885skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: <del>
bcd2633a
JP
4886])
4887OVS_VSWITCHD_STOP
4888AT_CLEANUP
4889
e731d71b
AS
4890# CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR, IP_VERSION_TYPE)
4891#
4892# IP_VERSION_TYPE is used in AT_SETUP
4893m4_define([CHECK_MEGAFLOW_NETFLOW],
4894 [AT_SETUP([ofproto-dpif megaflow - netflow - $2 collector])
4895 OVS_VSWITCHD_START
c2a77f33 4896 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
e731d71b
AS
4897 ADD_OF_PORTS([br0], [1], [2])
4898
4899 dnl NetFlow configuration disables wildcarding relevant fields
4900 ON_EXIT([kill `cat test-netflow.pid`])
eadd1644 4901 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
e731d71b 4902 AT_CAPTURE_FILE([netflow.log])
b52ecd96 4903 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
e731d71b
AS
4904 ovs-vsctl \
4905 set Bridge br0 netflow=@nf -- \
4906 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4907 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
4908
4909 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4910 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)'])
4911 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)'])
4912 sleep 1
c2a77f33 4913 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
4914skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/255.255.255.255,dst=10.0.0.1/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: <del>
4915skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/255.255.255.255,dst=10.0.0.3/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: <del>
bcd2633a 4916])
e731d71b
AS
4917 OVS_VSWITCHD_STOP
4918 AT_CLEANUP])
4919
4920CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
4921CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
bcd2633a
JP
4922
4923AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
4924OVS_VSWITCHD_START(
4925 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
4926 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
4927 set interface p2 type=dummy ofport_request=2 -- \
4928 set interface p3 type=dummy ofport_request=3])
4929AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
4930])
c2a77f33 4931AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4932
4933AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4934AT_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)'])
4935AT_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 4936sleep 1
c2a77f33 4937AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
4938skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4939skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
4940])
4941OVS_VSWITCHD_STOP
4942AT_CLEANUP
4943
4944AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
4945OVS_VSWITCHD_START(
4946 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
4947 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
4948 set interface p2 type=dummy ofport_request=2 -- \
4949 set interface p3 type=dummy ofport_request=3])
4950AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
4951])
c2a77f33 4952AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4953
4954AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4955AT_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)'])
4956AT_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 4957sleep 1
c2a77f33 4958AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
4959skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4960skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
4961])
4962OVS_VSWITCHD_STOP
4963AT_CLEANUP
4964
4965AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
4966# Create bond0 on br0 with interfaces p0 and p1
4967# and bond1 on br1 with interfaces p2 and p3
4968# with p0 patched to p2 and p1 patched to p3.
4969OVS_VSWITCHD_START(
4970 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
4971 other-config:lacp-time=fast \
4972 other-config:bond-rebalance-interval=0 -- \
4973 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
4974 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
4975 add-br br1 -- \
4976 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
4977 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
4978 fail-mode=secure -- \
4979 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
4980 other-config:lacp-time=fast \
4981 other-config:bond-rebalance-interval=0 -- \
4982 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
4983 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
4984
4985AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
4986])
c2a77f33 4987AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
4988ADD_OF_PORTS([br0], [7])
4989AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4990AT_CHECK([ovs-ofctl add-flow br1 action=normal])
31ef9f51 4991ovs-appctl time/stop
bcd2633a
JP
4992ovs-appctl time/warp 5000
4993AT_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)'])
4994AT_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 4995sleep 1
c2a77f33 4996AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
4997skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4998skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
4999])
5000OVS_VSWITCHD_STOP
5001AT_CLEANUP
5002
5003AT_SETUP([ofproto-dpif megaflow - resubmit port action])
5004OVS_VSWITCHD_START
c2a77f33 5005AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5006ADD_OF_PORTS([br0], [1], [2])
5007AT_DATA([flows.txt], [dnl
5008table=0 in_port=1,ip actions=resubmit(90)
5009table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
5010])
5011AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5012AT_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)'])
5013AT_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 5014sleep 1
c2a77f33 5015AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e 5016skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
e9319757 5017skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:00:00:00:02,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5018])
5019OVS_VSWITCHD_STOP
5020AT_CLEANUP
5021
5022AT_SETUP([ofproto-dpif megaflow - resubmit table action])
5023OVS_VSWITCHD_START
c2a77f33 5024AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5025ADD_OF_PORTS([br0], [1], [2])
5026AT_DATA([flows.txt], [dnl
5027table=0 in_port=1,ip actions=resubmit(,1)
5028table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5029])
5030AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5031AT_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)'])
5032AT_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=
50331,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
ae692725 5034sleep 1
c2a77f33 5035AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
5036skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
5037skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5038])
5039OVS_VSWITCHD_STOP
5040AT_CLEANUP
5041
5042AT_SETUP([ofproto-dpif megaflow - goto_table action])
5043OVS_VSWITCHD_START
c2a77f33 5044AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5045ADD_OF_PORTS([br0], [1], [2])
5046AT_DATA([flows.txt], [dnl
5047table=0 in_port=1,ip actions=goto_table(1)
5048table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5049])
5050AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
5051AT_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)'])
5052AT_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 5053sleep 1
c2a77f33 5054AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
5055skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
5056skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5057])
5058OVS_VSWITCHD_STOP
5059AT_CLEANUP
5060
5061AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
5062OVS_VSWITCHD_START
c2a77f33 5063AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5064ADD_OF_PORTS([br0], [1], [2], [3])
5065ovs-vsctl \
5066 set Bridge br0 mirrors=@m --\
5067 --id=@p3 get Port p3 --\
5068 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
5069
5070AT_DATA([flows.txt], [dnl
5071in_port=1 actions=output:2
5072])
5073AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5074AT_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 5075sleep 1
bcd2633a 5076AT_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 5077sleep 1
c2a77f33 5078AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e 5079skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(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/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5080])
5081OVS_VSWITCHD_STOP
5082AT_CLEANUP
5083
5084AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
5085OVS_VSWITCHD_START
c2a77f33 5086AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5087ADD_OF_PORTS([br0], [1], [2], [3])
5088ovs-vsctl \
5089 set Bridge br0 mirrors=@m --\
5090 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
5091 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
5092
5093AT_DATA([flows.txt], [dnl
5094in_port=1 actions=output:2
5095])
5096AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5097AT_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))'])
5098AT_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 5099sleep 1
c2a77f33 5100AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
5101skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8100),vlan(vid=11/0xfff,pcp=7/0x0,cfi=1/1),encap(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/0xff),icmp(type=8/0,code=0/0)), actions: <del>
5102skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5103])
5104OVS_VSWITCHD_STOP
5105AT_CLEANUP
5106
5107AT_SETUP([ofproto-dpif megaflow - move action])
5108OVS_VSWITCHD_START
c2a77f33 5109AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5110ADD_OF_PORTS([br0], [1], [2])
5111AT_DATA([flows.txt], [dnl
5112table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
5113table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
5114table=0 in_port=91 reg0=0x0a000002,actions=output(2)
5115])
5116AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5117AT_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)'])
5118AT_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 5119sleep 1
c2a77f33 5120AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
5121skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
5122skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5123])
5124OVS_VSWITCHD_STOP
5125AT_CLEANUP
5126
5127AT_SETUP([ofproto-dpif megaflow - push action])
5128OVS_VSWITCHD_START
c2a77f33 5129AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5130ADD_OF_PORTS([br0], [1], [2])
5131AT_DATA([flows.txt], [dnl
5132table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
5133])
5134AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5135AT_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)'])
5136AT_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 5137sleep 1
c2a77f33 5138AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
5139skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
5140skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5141])
5142OVS_VSWITCHD_STOP
5143AT_CLEANUP
5144
5145AT_SETUP([ofproto-dpif megaflow - learning])
5146OVS_VSWITCHD_START
c2a77f33 5147AT_CHECK([ovs-appctl vlog/set dpif:dbg])
bcd2633a
JP
5148ADD_OF_PORTS([br0], [1], [2])
5149AT_DATA([flows.txt], [dnl
5150table=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
5151])
5152AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
31ef9f51 5153ovs-appctl time/stop
956f2bf0
BP
5154# We send each packet twice because the first packet in each flow causes the
5155# flow table to change and thus revalidations, which (depending on timing)
5156# can keep a megaflow from being installed. The revalidations are done by
5157# the second iteration, allowing the flows to be installed.
5158for i in 1 2; do
5159 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)'])
5160 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)'])
5161 ovs-appctl time/warp 100
5162done
ae692725 5163sleep 1
bcd2633a 5164dnl The original flow is missing due to a revalidation.
c2a77f33 5165AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
5166skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
5167skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
bcd2633a
JP
5168])
5169OVS_VSWITCHD_STOP
5170AT_CLEANUP
d4f4a9b2
JP
5171
5172AT_SETUP([ofproto-dpif megaflow - tunnels])
5173OVS_VSWITCHD_START(
2c0ea78f 5174 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
c2a77f33 5175AT_CHECK([ovs-appctl vlog/set dpif:dbg])
2c0ea78f
GS
5176AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
5177 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
5178AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
5179 ofport_request=3])
5180AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
5181 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
5182 ofport_request=4 options:key=flow])
d4f4a9b2
JP
5183AT_DATA([flows.txt], [dnl
5184in_port=1,actions=output(2)
5185in_port=3,actions=output(4)
5186])
5187AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5188dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
5189dnl will cause the packet to be dropped.
5190AT_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 5191sleep 1
d4f4a9b2
JP
5192AT_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)'])
5193AT_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 5194sleep 1
d4f4a9b2 5195AT_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 5196sleep 1
c2a77f33 5197AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
7ce2769e
JS
5198skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0xfd/0x3,ttl=128/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
5199skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(3),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=0xfd/0xff,ttl=128/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
5200skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(3),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0x1/0xff,ttl=64/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
1dd35f8a
JP
5201])
5202OVS_VSWITCHD_STOP
5203AT_CLEANUP
5204
5205AT_SETUP([ofproto-dpif megaflow - dec_ttl])
5206OVS_VSWITCHD_START
c2a77f33 5207AT_CHECK([ovs-appctl vlog/set dpif:dbg])
1dd35f8a 5208ADD_OF_PORTS([br0], [1], [2])
13751fd8 5209AT_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
5210AT_DATA([flows.txt], [dnl
5211table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
5212])
5213AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5214AT_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)'])
5215AT_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 5216sleep 1
c2a77f33 5217AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
a64759f0 5218skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.2,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
7ce2769e 5219skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),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/0,code=0/0), actions: <del>
d4f4a9b2
JP
5220])
5221OVS_VSWITCHD_STOP
5222AT_CLEANUP
74cc3969 5223
f74e7df7
JP
5224AT_SETUP([ofproto-dpif megaflow - set dl_dst])
5225OVS_VSWITCHD_START
c2a77f33 5226AT_CHECK([ovs-appctl vlog/set dpif:dbg])
f74e7df7
JP
5227ADD_OF_PORTS([br0], [1], [2])
5228AT_DATA([flows.txt], [dnl
5229table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
5230])
5231AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5232AT_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)'])
5233AT_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 5234sleep 1
f74e7df7
JP
5235dnl The megaflows do not match the same fields, since the first packet
5236dnl is essentially a no-op. (The new destination MAC is the same as the
5237dnl original.) The ofproto-dpif library un-wildcards the destination MAC
5238dnl so that a packet that doesn't need its MAC address changed doesn't
5239dnl hide one that does. Since the first entry doesn't need to change,
5240dnl only the destination MAC address is matched (as decided by
5241dnl ofproto-dpif). The second entry actually updates the destination
5242dnl MAC, so both the source and destination MAC addresses are
5243dnl un-wildcarded, since the ODP commit functions update both the source
5244dnl and destination MAC addresses.
c2a77f33 5245AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
7ce2769e
JS
5246skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/ff:ff:ff:ff:ff:ff),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/0xff),icmp(type=8/0,code=0/0), actions:2
5247skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:set(eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a)),2
f74e7df7
JP
5248])
5249OVS_VSWITCHD_STOP
5250AT_CLEANUP
5251
8c301900
JR
5252AT_SETUP([ofproto-dpif megaflow - disabled])
5253OVS_VSWITCHD_START
c2a77f33 5254AT_CHECK([ovs-appctl vlog/set dpif:dbg])
8c301900
JR
5255ADD_OF_PORTS([br0], [1], [2])
5256AT_DATA([flows.txt], [dnl
5257table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
5258table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
5259])
e79a6c83 5260AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
8c301900
JR
5261], [])
5262AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
5263AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5264for i in 1 2 3 4; do
5265 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)'])
5266 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
5267 if [[ $i -eq 1 ]]; then
5268 sleep 1
5269 fi
8c301900 5270done
ae692725 5271sleep 1
c2a77f33 5272AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
7ce2769e
JS
5273skb_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), actions:2
5274skb_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), actions:drop
c2a77f33
JS
5275])
5276AT_CHECK([cat ovs-vswitchd.log | grep '00:09.*packets:3' | FILTER_FLOW_DUMP], [0], [dnl
7d170098 5277skb_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
c2a77f33
JS
5278])
5279AT_CHECK([cat ovs-vswitchd.log | grep '00:0b.*packets:3' | FILTER_FLOW_DUMP], [0], [dnl
7d170098 5280skb_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
5281])
5282OVS_VSWITCHD_STOP
5283AT_CLEANUP
5284
74cc3969
BP
5285AT_SETUP([ofproto-dpif - datapath port number change])
5286OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5287ADD_OF_PORTS([br0], 1)
5288
5289# Trace a flow that should output to p1.
5290AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5291 [0], [stdout])
5292AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
5293])
5294
5295# Change p1's port number to 5.
5296AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
5297
5298# Trace a flow that should output to p1 in its new location.
5299AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5300 [0], [stdout])
5301AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
5302])
5303OVS_VSWITCHD_STOP
5304AT_CLEANUP
2d344ba5
AW
5305
5306# Tests the bundling with various bfd and cfm configurations.
5307AT_SETUP([ofproto - bundle with variable bfd/cfm config])
5308OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
5309 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
5310 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
5311 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
5312 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
5313 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
5314 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
5315 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
5316 set Interface p0 cfm_mpid=1 -- \
5317 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
5318
5319ovs-appctl time/stop
5320# advance the clock to stablize everything.
5321for i in `seq 0 49`; do ovs-appctl time/warp 100; done
5322# cfm/show should show 'recv' fault.
5323AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5324 fault: recv
5325])
5326# bfd/show should show 'up'.
5327AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5328 Local Session State: up
5329 Remote Session State: up
5330 Local Session State: up
5331 Remote Session State: up
5332])
5333# bond/show should show 'may-enable: true' for all slaves.
5334AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
5335 may_enable: true
5336 may_enable: true
5337 may_enable: true
5338 may_enable: true
5339])
5340
5341# now disable the bfd on p1.
5342AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
5343# advance the clock to stablize everything.
5344for i in `seq 0 49`; do ovs-appctl time/warp 100; done
5345# cfm/show should show 'recv' fault.
5346AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5347 fault: recv
5348])
5349# bfd/show should show 'down'.
5350AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5351 Local Session State: down
5352 Remote Session State: down
5353])
5354# bond/show should show 'may-enable: false' for p0.
125bf01d 5355AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
2d344ba5
AW
5356 may_enable: false
5357 may_enable: true
2d344ba5
AW
5358])
5359
5360# now enable the bfd on p1 and disable bfd on p0.
5361AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
5362AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
5363# advance the clock to stablize everything.
5364for i in `seq 0 49`; do ovs-appctl time/warp 100; done
5365# cfm/show should show 'recv' fault.
5366AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5367 fault: recv
5368])
5369# bfd/show should show 'down'.
5370AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5371 Local Session State: down
5372 Remote Session State: down
5373])
5374# bond/show should show 'may-enable: false' for p0 and p1.
5375AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
5376 may_enable: false
5377 may_enable: true
5378 may_enable: false
5379 may_enable: true
5380])
5381
e441a806
AW
5382OVS_VSWITCHD_STOP
5383AT_CLEANUP
5384
5385AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
5386OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
5387
5388# enable bfd on p0.
5389AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
5390# check log.
1335a8d5 5391OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
5392# disable bfd on p0.
5393AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
5394# check log.
1335a8d5 5395OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
5396AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
5397
5398# enable cfm on p0.
5399AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
5400# check log.
1335a8d5 5401OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
5402# disable cfm on p0.
5403AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
5404# check log.
1335a8d5 5405OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
5406AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
5407
5408# enable both bfd and cfm on p0.
5409AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
5410# check log.
1335a8d5 5411OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
e441a806
AW
5412# disable bfd on p0.
5413AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
5414# check log, there should not be the log of thread terminated.
738cd849 5415AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
e441a806
AW
5416])
5417# reenable bfd on p0.
5418AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
5419# check log, should still be on log of thread created.
738cd849 5420AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
e441a806
AW
5421monitor thread created
5422])
5423# disable bfd and cfm together.
5424AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
5425# check log.
1335a8d5 5426OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
e441a806
AW
5427
5428OVS_VSWITCHD_STOP
5429AT_CLEANUP
5430
5431# this test helps avoid the deadlock between the main thread and monitor thread.
5432AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
5433OVS_VSWITCHD_START
5434
5435for i in `seq 1 199`
5436do
5437 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])
5438done
5439
98cf638b
AW
5440OVS_VSWITCHD_STOP
5441AT_CLEANUP
98b07853
BP
5442\f
5443AT_BANNER([ofproto-dpif - flow translation resource limits])
5444
5445AT_SETUP([ofproto-dpif - infinite resubmit])
5446OVS_VSWITCHD_START
5447AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
5448AT_CHECK([ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
5449 [0], [stdout])
5450AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
5451])
5452AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
5453 [0], [1
5454])
5455OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
5456AT_CLEANUP
5457
5458AT_SETUP([ofproto-dpif - exponential resubmit chain])
5459OVS_VSWITCHD_START
5460ADD_OF_PORTS([br0], 1)
5461(for i in `seq 1 64`; do
5462 j=`expr $i + 1`
5463 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
5464 done
5465 echo "in_port=65, actions=local") > flows
5466 AT_CHECK([ovs-ofctl add-flows br0 flows])
5467AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
5468AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
5469])
5470OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
5471AT_CLEANUP
5472
5473AT_SETUP([ofproto-dpif - too many output actions])
5474OVS_VSWITCHD_START
5475ADD_OF_PORTS([br0], 1)
5476(for i in `seq 1 12`; do
5477 j=`expr $i + 1`
5478 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
5479 done
5480 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
542024c4 5481AT_CHECK([ovs-ofctl add-flows br0 flows])
98b07853 5482AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
0f032e95
BP
5483AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
5484 [0], [1
98b07853 5485])
0f032e95 5486AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
542024c4 5487])
0f032e95 5488OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
98b07853
BP
5489AT_CLEANUP
5490
5491AT_SETUP([ofproto-dpif - stack too deep])
5492OVS_VSWITCHD_START
5493ADD_OF_PORTS([br0], 1)
5494(for i in `seq 1 12`; do
5495 j=`expr $i + 1`
5496 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
5497 done
5498 push="push:NXM_NX_REG0[[]]"
5499 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
5500 AT_CHECK([ovs-ofctl add-flows br0 flows])
5501AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
5502AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
5503])
5504OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
5505AT_CLEANUP
d611866c
SH
5506
5507
2608616d 5508AT_SETUP([ofproto-dpif packet-out controller])
d611866c
SH
5509OVS_VSWITCHD_START
5510ADD_OF_PORTS([br0], 1, 2)
5511
5512AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
5513
5514AT_CAPTURE_FILE([ofctl_monitor.log])
5515AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5516
5517for i in 1 2 3; do
5518 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
5519done
5520
5521OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5522AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5523NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
5524metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5525dnl
5526NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
5527metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5528dnl
5529NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
5530metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5531])
5532
5533AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5534 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
5535NXST_FLOW reply:
5536])
5537
5538(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
5539 echo " 0: active=1, lookup=0, matched=0"
5540 x=1
5541 while test $x -lt 254; do
5542 echo " $x: active=0, lookup=0, matched=0"
5543 x=`expr $x + 1`
5544 done) > expout
5545AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5546
5547OVS_VSWITCHD_STOP
5548AT_CLEANUP
5549
5550
2608616d 5551AT_SETUP([ofproto-dpif packet-out controller (patch port)])
d611866c
SH
5552OVS_VSWITCHD_START(
5553 [-- \
5554 add-port br0 p1 -- \
5555 set interface p1 type=patch options:peer=p2 -- \
5556 add-br br1 -- \
5557 set bridge br1 datapath-type=dummy -- \
5558 set bridge br1 fail-mode=secure -- \
5559 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
5560 add-port br1 p2 -- \
5561 set interface p2 type=patch options:peer=p1 --])
5562
5563AT_CAPTURE_FILE([ofctl_monitor.log])
5564AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5565
5566for i in 1 2 3; do
5567 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
5568done
5569
5570OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5571AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5572NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
5573metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5574dnl
5575NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
5576metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5577dnl
5578NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
5579metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5580])
5581
5582(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
5583 x=0
5584 while test $x -lt 254; do
5585 echo " $x: active=0, lookup=0, matched=0"
5586 x=`expr $x + 1`
5587 done) > expout
5588AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5589
5590(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
5591 echo " 0: active=0, lookup=3, matched=0"
5592 x=1
5593 while test $x -lt 254; do
5594 echo " $x: active=0, lookup=0, matched=0"
5595 x=`expr $x + 1`
5596 done) > expout
5597AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
5598
5599OVS_VSWITCHD_STOP
5600AT_CLEANUP
5601
5602
2608616d 5603AT_SETUP([ofproto-dpif packet-out goto_table])
d611866c
SH
5604OVS_VSWITCHD_START
5605ADD_OF_PORTS([br0], 1, 2)
5606
5607AT_DATA([flows.txt], [dnl
5608table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
5609table=1 dl_dst=50:54:00:00:00:0a actions=controller
5610])
5611AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5612
5613AT_CAPTURE_FILE([ofctl_monitor.log])
5614AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5615
5616for i in 1 2 3; do
5617 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)'
5618done
5619
5620OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
5621OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5622AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5623NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5624metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5625dnl
5626NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5627metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5628dnl
5629NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5630metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5631])
5632
5633AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
5634
5635AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
5636 n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
5637 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
5638OFPST_FLOW reply (OF1.3):
5639])
5640
5641(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
5642 echo " 0: active=1, lookup=3, matched=3"
5643 echo " 1: active=1, lookup=3, matched=3"
5644 x=2
5645 while test $x -lt 254; do
5646 echo " $x: active=0, lookup=0, matched=0"
5647 x=`expr $x + 1`
5648 done) > expout
5649AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5650
5651OVS_VSWITCHD_STOP
5652AT_CLEANUP
5653
5654
2608616d 5655AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
d611866c
SH
5656OVS_VSWITCHD_START
5657ADD_OF_PORTS([br0], 1, 2)
5658
5659AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
5660AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 all continue])
5661
5662AT_CAPTURE_FILE([ofctl_monitor.log])
5663AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5664
5665for i in 1 2 3; do
5666 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)'
5667done
5668
5669OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
5670OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5671AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5672NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5673metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5674dnl
5675NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5676metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5677dnl
5678NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5679metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5680])
5681
5682AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
5683
5684AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
5685 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
5686OFPST_FLOW reply (OF1.3):
5687])
5688
5689(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
5690 echo " 0: active=0, lookup=3, matched=0"
5691 echo " 1: active=1, lookup=3, matched=3"
5692 x=2
5693 while test $x -lt 254; do
5694 echo " $x: active=0, lookup=0, matched=0"
5695 x=`expr $x + 1`
5696 done) > expout
5697AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5698
5699OVS_VSWITCHD_STOP
5700AT_CLEANUP
b0e2ec32
JR
5701
5702AT_SETUP([ofproto-dpif - ICMPv6])
5703OVS_VSWITCHD_START
5704ADD_OF_PORTS([br0], 1)
5705
5706AT_CAPTURE_FILE([ofctl_monitor.log])
5707
5708AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5709
5710ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
5711
5712OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5713
5714AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5715NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
5716icmp6,metadata=0,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
5717])
5718
5719OVS_VSWITCHD_STOP
5720AT_CLEANUP