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