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