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