1 AT_BANNER([ofproto-dpif])
3 AT_SETUP([ofproto-dpif - resubmit])
5 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13], [14], [15],
6 [16], [17], [18], [19], [20], [21])
7 AT_DATA([flows.txt], [dnl
8 table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
9 table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
10 table=0 in_port=3 priority=2000 icmp actions=output(20)
11 table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
12 table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
13 table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
15 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
16 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])
17 AT_CHECK([tail -1 stdout], [0],
18 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
23 AT_SETUP([ofproto-dpif - goto table])
25 ADD_OF_PORTS([br0], [1], [10], [11])
26 echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
27 for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
28 echo "table=64 actions=output(11)" >> flows.txt
29 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
30 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])
31 AT_CHECK([tail -1 stdout], [0],
32 [Datapath actions: 10,11
37 AT_SETUP([ofproto-dpif - write actions])
39 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
40 AT_DATA([flows.txt], [dnl
41 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
42 table=1 ip actions=write_actions(output(13)),goto_table(2)
43 table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
45 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
46 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])
47 AT_CHECK([tail -1 stdout], [0],
48 [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
53 AT_SETUP([ofproto-dpif - clear actions])
55 ADD_OF_PORTS([br0], [1], [10], [11], [12])
56 AT_DATA([flows.txt], [dnl
57 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
58 table=1 ip actions=set_field:192.168.3.91->ip_src,output(11),clear_actions
60 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
61 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])
62 AT_CHECK([tail -1 stdout], [0],
63 [Datapath actions: 10,set(ipv4(src=192.168.3.91,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11
68 AT_SETUP([ofproto-dpif - registers])
70 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
71 AT_DATA([flows.txt], [dnl
72 in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
73 in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
74 in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
75 in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
77 in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
78 in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
79 in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
80 in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
81 in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
82 in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
83 in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
84 in_port=9,reg0=0xdeadbeef actions=output:20
85 in_port=10,reg1=0xdeadbeef actions=output:21
86 in_port=11,reg2=0xeef22dea actions=output:22
88 dnl Sanilty check all registers
89 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
90 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
91 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
92 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
95 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
96 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])
97 AT_CHECK([tail -1 stdout], [0],
98 [Datapath actions: 20,21,22,33
103 AT_SETUP([ofproto-dpif - push-pop])
105 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
106 AT_DATA([flows.txt], [dnl
107 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
108 in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
109 in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
110 in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
111 in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
114 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
115 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])
116 AT_CHECK([tail -1 stdout], [0],
117 [Datapath actions: 33,22,21,20
122 AT_SETUP([ofproto-dpif - output])
124 ADD_OF_PORTS([br0], [1], [9], [10], [11], [55], [66], [77], [88])
125 AT_DATA([flows.txt], [dnl
126 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
127 in_port=2 actions=output:9
128 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
129 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
130 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
131 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
132 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
133 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
135 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
136 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])
137 AT_CHECK([tail -1 stdout], [0],
138 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
143 AT_SETUP([ofproto-dpif - dec_ttl])
145 ADD_OF_PORTS([br0], [1], [2], [3], [4])
146 AT_DATA([flows.txt], [dnl
147 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
148 table=1 in_port=1 action=dec_ttl,output:3
150 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
151 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=2,frag=no)' -generate], [0], [stdout])
152 AT_CHECK([tail -3 stdout], [0],
153 [Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=1,frag=no)),2,4
154 This flow is handled by the userspace slow path because it:
155 - Sends "packet-in" messages to the OpenFlow controller.
157 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=3,frag=no)'], [0], [stdout])
158 AT_CHECK([tail -1 stdout], [0],
159 [Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=2,frag=no)),2,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=1,frag=no)),3,4
161 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])
162 AT_CHECK([tail -1 stdout], [0],
163 [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
166 AT_CAPTURE_FILE([ofctl_monitor.log])
167 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
168 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=2,frag=no)' -generate], [0], [stdout])
169 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
170 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
171 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 in_port=1 (via invalid_ttl) data_len=42 (unbuffered)
172 icmp,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=1,icmp_type=0,icmp_code=0
178 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
180 ADD_OF_PORTS([br0], [1], [2])
182 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
184 # "in_port" defaults to OFPP_NONE if it's not specified.
185 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"
186 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
187 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
196 AT_SETUP([ofproto-dpif - DSCP])
197 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
198 ADD_OF_PORTS([br0], [9])
199 AT_DATA([flows.txt], [dnl
200 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
202 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
203 AT_CHECK([ovs-vsctl -- \
204 set Port p1 qos=@newqos --\
205 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
206 --id=@q1 create Queue dscp=1 --\
207 --id=@q2 create Queue dscp=2], [0], [ignore])
208 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])
209 AT_CHECK([tail -1 stdout], [0],
210 [Datapath actions: dnl
212 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
213 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
215 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
216 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
217 set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x3,ttl=128,frag=no)),1,dnl
223 AT_SETUP([ofproto-dpif - output/flood flags])
225 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
227 AT_DATA([flows.txt], [dnl
228 in_port=local actions=local,flood
229 in_port=1 actions=flood
230 in_port=2 actions=all
231 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
232 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
234 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
235 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
236 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
238 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])
239 AT_CHECK([tail -1 stdout \
240 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
248 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])
249 AT_CHECK([tail -1 stdout \
250 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
258 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])
259 AT_CHECK([tail -1 stdout \
260 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
269 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])
270 AT_CHECK([tail -1 stdout], [0],
271 [Datapath actions: 100,1,2,4,6,7
274 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])
275 AT_CHECK([tail -1 stdout], [0],
276 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
281 AT_SETUP([ofproto-dpif - controller])
282 OVS_VSWITCHD_START([dnl
283 add-port br0 p1 -- set Interface p1 type=dummy
285 ON_EXIT([kill `cat ovs-ofctl.pid`])
287 AT_CAPTURE_FILE([ofctl_monitor.log])
288 AT_DATA([flows.txt], [dnl
289 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
290 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
291 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
293 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
294 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)
295 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)
296 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
297 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)
298 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
299 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
300 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
301 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
302 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
303 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
304 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
305 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
306 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
307 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
308 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
309 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
310 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
311 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
312 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[[]],controller
314 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
317 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
320 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)'
322 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
323 ovs-appctl -t ovs-ofctl exit
325 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
326 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
327 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
329 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
330 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
332 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
333 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
336 dnl Singleton controller action.
337 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
340 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)'
342 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
343 ovs-appctl -t ovs-ofctl exit
345 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
346 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
347 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
349 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
350 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
352 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
353 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
356 dnl Modified controller action.
357 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
360 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)'
362 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
363 ovs-appctl -t ovs-ofctl exit
365 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
366 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
367 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
369 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
370 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
372 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
373 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
376 dnl Modified VLAN controller action.
377 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
380 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=6,tos=0,ttl=64,frag=no)'
382 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
383 ovs-appctl -t ovs-ofctl exit
385 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
386 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
387 tcp,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_tos=0,nw_ecn=0,nw_ttl=64,tcp_flags=0x000 tcp_csum:0
389 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
390 tcp,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_tos=0,nw_ecn=0,nw_ttl=64,tcp_flags=0x000 tcp_csum:0
392 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
393 tcp,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_tos=0,nw_ecn=0,nw_ttl=64,tcp_flags=0x000 tcp_csum:0
396 dnl Modified MPLS controller action.
397 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
400 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=6,tos=0,ttl=64,frag=no)'
402 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
403 ovs-appctl -t ovs-ofctl exit
405 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
406 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
407 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
409 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
410 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
412 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
413 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
416 dnl Modified MPLS controller action.
417 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
420 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=6,tos=0,ttl=64,frag=no)'
422 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
423 ovs-appctl -t ovs-ofctl exit
425 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
426 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
427 tcp,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_tos=0,nw_ecn=0,nw_ttl=64,tcp_flags=0x000 tcp_csum:0
429 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
430 tcp,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_tos=0,nw_ecn=0,nw_ttl=64,tcp_flags=0x000 tcp_csum:0
432 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
433 tcp,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_tos=0,nw_ecn=0,nw_ttl=64,tcp_flags=0x000 tcp_csum:0
436 dnl Modified MPLS controller action.
437 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
439 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)
442 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)'
445 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
446 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
447 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
448 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
450 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
451 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
453 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
454 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
457 dnl Modified MPLS controller action.
458 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
461 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=6,tos=0,ttl=64,frag=no))'
463 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
464 ovs-appctl -t ovs-ofctl exit
466 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
467 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
468 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
470 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
471 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
473 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
474 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
477 dnl Modified MPLS controller action.
478 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
481 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=6,tos=0,ttl=64,frag=no)'
483 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
484 ovs-appctl -t ovs-ofctl exit
486 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
487 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
488 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
490 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
491 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
493 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
494 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
497 dnl Modified MPLS controller action.
498 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
501 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=6,tos=0,ttl=64,frag=no)'
503 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
504 ovs-appctl -t ovs-ofctl exit
506 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
507 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
508 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
510 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
511 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
513 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
514 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
517 dnl Modified MPLS controller action.
518 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
521 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=6,tos=0,ttl=64,frag=no)'
523 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
524 ovs-appctl -t ovs-ofctl exit
526 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
527 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
528 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
530 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
531 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
533 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
534 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
537 dnl Modified MPLS controller action.
538 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
541 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=6,tos=0,ttl=64,frag=no)'
543 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
544 ovs-appctl -t ovs-ofctl exit
546 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
547 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
548 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
550 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
551 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
553 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
554 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
557 dnl Modified MPLS actions.
558 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
561 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)'
563 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
564 ovs-appctl -t ovs-ofctl exit
566 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
567 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
568 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
570 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
571 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
573 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
574 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
577 dnl Modified MPLS ipv6 controller action.
578 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
581 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)'
583 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
584 ovs-appctl -t ovs-ofctl exit
586 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
587 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
588 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=64,mpls_bos=1
590 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
591 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=64,mpls_bos=1
593 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
594 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=64,mpls_bos=1
598 dnl Modified MPLS pop action.
599 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
600 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)
601 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
603 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
606 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'
609 # 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)'
611 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
612 ovs-appctl -t ovs-ofctl exit
614 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
615 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
616 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
618 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
619 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
621 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
622 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
626 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
629 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)'
631 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
632 ovs-appctl -t ovs-ofctl exit
634 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
635 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
636 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
638 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
639 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
641 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)
642 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
644 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)
645 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
647 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)
648 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
650 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)
651 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
653 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)
654 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
656 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)
657 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
659 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)
660 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
664 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
667 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'
669 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
670 ovs-appctl -t ovs-ofctl exit
672 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
673 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
674 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
676 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
677 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
679 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)
680 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
682 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)
683 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
685 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)
686 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
688 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)
689 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
691 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)
692 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
694 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)
695 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
697 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)
698 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
701 dnl Modified ARP controller action.
702 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
705 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)'
708 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
709 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
710 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
711 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
712 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
713 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
714 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
715 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=40:44:44:44:44:41
716 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
717 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
718 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
719 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
720 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
721 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=40:44:44:44:44:41
722 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
723 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
724 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
725 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
726 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
727 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=40:44:44:44:44:41
730 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
733 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
736 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'
739 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
740 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
741 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
742 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
744 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered)
745 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
747 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)
748 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
750 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)
751 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
753 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)
754 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
756 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)
757 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
759 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)
760 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
762 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)
763 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
765 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)
766 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
769 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
770 cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
771 cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
772 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)
773 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)
774 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)
775 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)
776 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)
777 cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
778 cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
779 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
780 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
781 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
782 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
783 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
784 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
785 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
786 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
787 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
788 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
789 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
790 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[[]],CONTROLLER:65535
791 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
792 n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
799 AT_SETUP([ofproto-dpif - ARP modification slow-path])
801 ADD_OF_PORTS([br0], [1], [2])
803 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
804 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'
806 # Input some packets that should follow the arp modification slow-path.
808 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)'
810 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
812 # Check the packets that were output.
813 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
814 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
815 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
816 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=40:44:44:44:44:41
817 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
818 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
819 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=40:44:44:44:44:41
820 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
821 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
822 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=40:44:44:44:44:41
825 # Check that each of the packets actually passed through the slow-path.
826 AT_CHECK([ovs-appctl coverage/show], [0], [stdout])
827 AT_CHECK([sed -n 's/[[ ]]\{2,\}/ /g
828 s/^dpif_execute_with_help.*total: //p' stdout], [0], [3
834 AT_SETUP([ofproto-dpif - VLAN handling])
836 [set Bridge br0 fail-mode=standalone -- \
837 add-port br0 p1 trunks=10,12 -- \
838 add-port br0 p2 tag=10 -- \
839 add-port br0 p3 tag=12 \
840 other-config:priority-tags=true -- \
841 add-port br0 p4 tag=12 -- \
842 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
843 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
844 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
845 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
846 other-config:priority-tags=true -- \
847 set Interface p1 type=dummy -- \
848 set Interface p2 type=dummy -- \
849 set Interface p3 type=dummy -- \
850 set Interface p4 type=dummy -- \
851 set Interface p5 type=dummy -- \
852 set Interface p6 type=dummy -- \
853 set Interface p7 type=dummy -- \
854 set Interface p8 type=dummy --])
856 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
857 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
863 "100 10 0 1,5,6,7,8,pop_vlan,2" \
864 "100 10 1 1,5,6,7,8,pop_vlan,2" \
867 "100 12 0 1,5,6,pop_vlan,3,4,7,8" \
868 "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
872 "1 10 0 5,6,7,8,100,pop_vlan,2" \
873 "1 10 1 5,6,7,8,100,pop_vlan,2" \
876 "1 12 0 5,6,100,pop_vlan,3,4,7,8" \
877 "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
878 "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
879 "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
880 "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
887 "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
888 "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
889 "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
896 "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
897 "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
898 "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
905 "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
906 "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
907 "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
908 "5 10 0 1,6,7,8,100,pop_vlan,2" \
909 "5 10 1 1,6,7,8,100,pop_vlan,2" \
912 "5 12 0 1,6,100,pop_vlan,3,4,7,8" \
913 "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
914 "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
915 "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
916 "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
917 "6 10 0 1,5,7,8,100,pop_vlan,2" \
918 "6 10 1 1,5,7,8,100,pop_vlan,2" \
921 "6 12 0 1,5,100,pop_vlan,3,4,7,8" \
922 "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
923 "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
924 "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
925 "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
926 "7 10 0 1,5,6,8,100,pop_vlan,2" \
927 "7 10 1 1,5,6,8,100,pop_vlan,2" \
930 "7 12 0 1,5,6,100,pop_vlan,3,4,8" \
931 "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
932 "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
933 "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
934 "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
935 "8 10 0 1,5,6,7,100,pop_vlan,2" \
936 "8 10 1 1,5,6,7,100,pop_vlan,2" \
939 "8 12 0 1,5,6,100,pop_vlan,3,4,7" \
940 "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
948 if test $vlan = none; then
949 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
951 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))"
954 echo "----------------------------------------------------------------------"
955 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
957 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
958 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
960 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
962 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
968 AT_SETUP([ofproto-dpif - fragment handling])
970 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
971 AT_DATA([flows.txt], [dnl
972 priority=75 tcp ip_frag=no tp_dst=80 actions=output:1
973 priority=75 tcp ip_frag=first tp_dst=80 actions=output:2
974 priority=75 tcp ip_frag=later tp_dst=80 actions=output:3
975 priority=50 tcp ip_frag=no actions=output:4
976 priority=50 tcp ip_frag=first actions=output:5
977 priority=50 tcp ip_frag=later actions=output:6
979 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
981 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"
982 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
983 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
984 later_flow="$base_flow,frag=later)"
986 # mode no first later
998 AT_CHECK([ovs-ofctl set-frags br0 $mode])
999 for type in no first later; do
1000 eval flow=\$${type}_flow exp_output=\$$type
1001 printf "\n%s\n" "----$mode $type-----"
1002 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1004 if test $mode = drop && test $type != no; then
1005 echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
1007 echo "Datapath actions: $exp_output" >> expout
1008 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
1014 AT_SETUP([ofproto-dpif - exit])
1016 ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14])
1017 AT_DATA([flows.txt], [dnl
1018 in_port=1 actions=output:10,exit,output:11
1019 in_port=2 actions=output:12,resubmit:1,output:12
1020 in_port=3 actions=output:13,resubmit:2,output:14
1022 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1023 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])
1024 AT_CHECK([tail -1 stdout], [0],
1025 [Datapath actions: 10
1027 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])
1028 AT_CHECK([tail -1 stdout], [0],
1029 [Datapath actions: 12,10
1031 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])
1032 AT_CHECK([tail -1 stdout], [0],
1033 [Datapath actions: 13,12,10
1039 AT_SETUP([ofproto-dpif - mirroring, select_all])
1041 ADD_OF_PORTS([br0], 1, 2, 3)
1043 set Bridge br0 mirrors=@m --\
1044 --id=@p3 get Port p3 --\
1045 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
1047 AT_DATA([flows.txt], [dnl
1048 in_port=1 actions=output:2
1049 in_port=2 actions=output:1
1051 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1053 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)"
1054 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1055 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1056 [Datapath actions: 2,3
1059 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)"
1060 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1061 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1062 [Datapath actions: 1,3
1069 AT_SETUP([ofproto-dpif - mirroring, select_src])
1071 ADD_OF_PORTS([br0], 1, 2, 3)
1073 set Bridge br0 mirrors=@m --\
1074 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
1075 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
1077 AT_DATA([flows.txt], [dnl
1078 in_port=1 actions=output:2
1079 in_port=2 actions=output:1
1081 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1083 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)"
1084 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1085 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1086 [Datapath actions: 2,3
1089 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)"
1090 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1091 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1092 [Datapath actions: 1
1097 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
1099 ADD_OF_PORTS([br0], 1, 2)
1101 set Bridge br0 mirrors=@m --\
1102 --id=@p2 get Port p2 --\
1103 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
1105 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
1107 # "in_port" defaults to OFPP_NONE if it's not specified.
1108 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"
1109 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
1110 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1111 [Datapath actions: 1,2
1118 AT_SETUP([ofproto-dpif - mirroring, select_dst])
1120 ADD_OF_PORTS([br0], 1, 2, 3)
1122 set Bridge br0 mirrors=@m --\
1123 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
1124 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
1126 AT_DATA([flows.txt], [dnl
1127 in_port=1 actions=output:2
1128 in_port=2 actions=output:1
1130 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1132 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)"
1133 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1134 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1135 [Datapath actions: 2,3
1138 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)"
1139 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1140 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1141 [Datapath actions: 1
1148 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
1150 ADD_OF_PORTS([br0], 1, 2, 3)
1152 set Bridge br0 mirrors=@m --\
1153 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
1154 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
1156 AT_DATA([flows.txt], [dnl
1157 in_port=1, actions=output:2
1159 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1161 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)"
1162 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1163 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1164 [Datapath actions: 2
1167 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))"
1168 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1169 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1170 [Datapath actions: 2
1173 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))"
1174 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1175 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1176 [Datapath actions: 2,3
1183 AT_SETUP([ofproto-dpif - mirroring, output_port])
1185 ADD_OF_PORTS([br0], 1, 2, 3)
1187 set Bridge br0 mirrors=@m --\
1188 --id=@p3 get Port p3 --\
1189 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
1191 AT_DATA([flows.txt], [dnl
1192 in_port=1 actions=mod_vlan_vid:17,output:2
1193 in_port=2 actions=output:1
1195 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1197 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)"
1198 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1199 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1200 [Datapath actions: push_vlan(vid=17,pcp=0),2,pop_vlan,3
1203 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)"
1204 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1205 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
1206 [Datapath actions: 1,3
1212 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
1214 ADD_OF_PORTS([br0], 1, 2)
1216 set Bridge br0 mirrors=@m --\
1217 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
1219 AT_DATA([flows.txt], [dnl
1220 in_port=1 actions=output:2
1221 in_port=2 actions=mod_vlan_vid:17,output:1
1223 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1225 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)"
1226 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1227 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
1229 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
1230 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
1232 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
1234 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)"
1235 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1236 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
1238 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
1239 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
1241 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
1246 # Two testcases below are for the ofproto/trace command
1247 # The first one tests all correct syntax:
1248 # ofproto/trace [dp_name] odp_flow [-generate|packet]
1249 # ofproto/trace br_name br_flow [-generate|packet]
1250 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
1251 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
1252 ADD_OF_PORTS([br0], 1, 2, 3)
1254 AT_DATA([flows.txt], [dnl
1255 in_port=1 actions=output:2
1256 in_port=2 actions=output:1
1258 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1260 odp_flow="in_port(p1)"
1262 # Test command: ofproto/trace odp_flow with in_port as a name.
1263 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
1264 AT_CHECK([tail -1 stdout], [0], [dnl
1268 odp_flow="in_port(1)"
1269 # Test command: ofproto/trace odp_flow
1270 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
1271 AT_CHECK([tail -1 stdout], [0], [dnl
1275 # Test command: ofproto/trace dp_name odp_flow
1276 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
1277 AT_CHECK([tail -1 stdout], [0], [dnl
1280 # Test commmand: ofproto/trace br_name br_flow
1281 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
1282 AT_CHECK([tail -1 stdout], [0], [dnl
1286 # Delete the inserted flows
1287 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
1288 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
1290 # This section beflow tests the [-generate] option
1291 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
1292 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"
1294 # Test command: ofproto/trace odp_flow
1295 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
1296 # Check for no MAC learning entry
1297 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1301 # Test command: ofproto/trace br_name br_flow
1302 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
1303 # Check for no MAC learning entry
1304 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1308 # Test command: ofproto/trace odp_flow -generate
1309 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
1310 # Check for the MAC learning entry
1311 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1313 3 0 50:54:00:00:00:05 ?
1316 # Test command: ofproto/trace dp_name odp_flow -generate
1317 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
1318 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
1319 -generate], [0], [stdout])
1320 # Check for both MAC learning entries
1321 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1323 3 0 50:54:00:00:00:05 ?
1324 1 0 50:54:00:00:00:06 ?
1327 # Test command: ofproto/trace br_name br_flow -generate
1328 AT_CHECK([ovs-appctl ofproto/trace br0 \
1329 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
1330 -generate], [0], [stdout])
1331 # Check for both MAC learning entries.
1332 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1334 3 0 50:54:00:00:00:05 ?
1335 1 0 50:54:00:00:00:06 ?
1336 2 0 50:54:00:00:00:07 ?
1339 # This section beflow tests the [packet] option
1340 # The ovs-tcpundump of packets between port1 and port2
1341 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
1342 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
1344 # Construct the MAC learning table
1345 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
1346 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
1347 -generate], [0], [stdout])
1349 # Construct the MAC learning table
1350 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
1351 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
1352 -generate], [0], [stdout])
1354 # Test command: ofproto/trace odp_flow packet
1355 AT_CHECK([ovs-appctl ofproto/trace \
1356 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
1357 AT_CHECK([tail -1 stdout], [0], [dnl
1360 AT_CHECK([head -n 3 stdout], [0], [dnl
1362 Packet: arp,metadata=0,in_port=0,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
1363 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
1366 # Test command: ofproto/trace dp_name odp_flow packet
1367 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
1368 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
1369 AT_CHECK([tail -1 stdout], [0], [dnl
1372 AT_CHECK([head -n 3 stdout], [0], [dnl
1374 Packet: arp,metadata=0,in_port=0,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
1375 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
1378 # Test command: ofproto/trace br_name br_flow packet
1379 AT_CHECK([ovs-appctl ofproto/trace br0 \
1380 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
1381 AT_CHECK([tail -1 stdout], [0], [dnl
1384 AT_CHECK([head -n 2 stdout], [0], [dnl
1385 Packet: arp,metadata=0,in_port=0,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
1386 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
1392 # The second test tests the corner cases
1393 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
1395 ADD_OF_PORTS([br0], 1, 2)
1398 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
1399 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
1401 generate="-generate"
1402 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
1404 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
1410 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
1412 AT_CHECK([tail -2 stderr], [0], [dnl
1413 Cannot find the datapath
1414 ovs-appctl: ovs-vswitchd: server returned an error
1417 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
1423 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
1425 AT_CHECK([tail -2 stderr], [0], [dnl
1426 Cannot find the datapath
1427 ovs-appctl: ovs-vswitchd: server returned an error
1430 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
1436 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
1438 AT_CHECK([tail -2 stderr], [0], [dnl
1439 Cannot find the datapath
1440 ovs-appctl: ovs-vswitchd: server returned an error
1443 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
1449 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
1451 AT_CHECK([tail -2 stderr], [0], [dnl
1452 Cannot find the datapath
1453 ovs-appctl: ovs-vswitchd: server returned an error
1456 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
1462 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
1464 AT_CHECK([tail -2 stderr], [0], [dnl
1466 ovs-appctl: ovs-vswitchd: server returned an error
1469 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
1475 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
1477 AT_CHECK([tail -2 stderr], [0], [dnl
1478 Must specify bridge name
1479 ovs-appctl: ovs-vswitchd: server returned an error
1482 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
1483 AT_CHECK([ovs-appctl ofproto/trace \
1484 ovs-dummy "$odp_flow" garbage_option],
1485 [2], [stdout],[stderr])
1486 AT_CHECK([tail -2 stderr], [0], [dnl
1487 Trailing garbage in packet data
1488 ovs-appctl: ovs-vswitchd: server returned an error
1491 # Test incorrect command: ofproto/trace with 4 arguments
1492 AT_CHECK([ovs-appctl ofproto/trace \
1493 arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
1494 AT_CHECK([tail -2 stderr], [0], [dnl
1495 "ofproto/trace" command takes at most 3 arguments
1496 ovs-appctl: ovs-vswitchd: server returned an error
1499 # Test incorrect command: ofproto/trace with 0 argument
1500 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
1501 AT_CHECK([tail -2 stderr], [0], [dnl
1502 "ofproto/trace" command requires at least 1 arguments
1503 ovs-appctl: ovs-vswitchd: server returned an error
1509 m4_define([OFPROTO_TRACE],
1511 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
1512 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
1514 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
1517 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
1520 AT_SETUP([ofproto-dpif - MAC learning])
1521 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
1522 ADD_OF_PORTS([br0], 1, 2, 3)
1524 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)'
1526 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
1529 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
1533 # Check for the MAC learning entry.
1534 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1536 3 0 50:54:00:00:00:05 ?
1539 # Trace a packet arrival destined for the learned MAC.
1540 # (This will also learn a MAC.)
1543 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
1547 # Check for both MAC learning entries.
1548 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1550 3 0 50:54:00:00:00:05 ?
1551 1 0 50:54:00:00:00:06 ?
1554 # Trace a packet arrival that updates the first learned MAC entry.
1557 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
1561 # Check that the MAC learning entry was updated.
1562 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1564 1 0 50:54:00:00:00:06 ?
1565 2 0 50:54:00:00:00:05 ?
1568 # Add another bridge.
1572 -- set bridge br1 datapath-type=dummy])
1573 ADD_OF_PORTS([br1], 4, 5)
1575 # Trace some packet arrivals in br1 to create MAC learning entries there too.
1578 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
1583 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
1587 # Check that the MAC learning entries were added.
1588 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1590 4 0 50:54:00:00:00:06 ?
1591 5 0 50:54:00:00:00:07 ?
1594 # Delete port p1 and see that its MAC learning entry disappeared, and
1595 # that the MAC learning entry for the same MAC was also deleted from br1.
1596 AT_CHECK([ovs-vsctl del-port p1])
1597 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1599 2 0 50:54:00:00:00:05 ?
1601 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
1603 5 0 50:54:00:00:00:07 ?
1609 AT_SETUP([ofproto-dpif - MAC table overflow])
1611 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
1612 ADD_OF_PORTS([br0], 1, 2, 3)
1614 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)'
1616 AT_CHECK([ovs-appctl time/stop])
1618 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
1619 for i in 0 1 2 3 4 5 6 7 8 9; do
1622 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
1625 ovs-appctl time/warp 1000
1628 # Check for the MAC learning entries.
1629 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
1631 3 0 50:54:00:00:00:00
1632 3 0 50:54:00:00:00:01
1633 3 0 50:54:00:00:00:02
1634 3 0 50:54:00:00:00:03
1635 3 0 50:54:00:00:00:04
1636 3 0 50:54:00:00:00:05
1637 3 0 50:54:00:00:00:06
1638 3 0 50:54:00:00:00:07
1639 3 0 50:54:00:00:00:08
1640 3 0 50:54:00:00:00:09
1644 # Trace another ARP packet on another MAC.
1647 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
1651 # Check that the new one chased the oldest one out of the table.
1652 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
1654 3 0 50:54:00:00:00:01 ?
1655 3 0 50:54:00:00:00:02 ?
1656 3 0 50:54:00:00:00:03 ?
1657 3 0 50:54:00:00:00:04 ?
1658 3 0 50:54:00:00:00:05 ?
1659 3 0 50:54:00:00:00:06 ?
1660 3 0 50:54:00:00:00:07 ?
1661 3 0 50:54:00:00:00:08 ?
1662 3 0 50:54:00:00:00:09 ?
1663 3 0 50:54:00:00:00:10 ?
1669 dnl Test that sFlow samples packets correctly.
1670 AT_SETUP([ofproto-dpif - sFlow packet sampling])
1671 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
1673 ON_EXIT([kill `cat test-sflow.pid`])
1674 AT_CHECK([test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
1675 AT_CAPTURE_FILE([sflow.log])
1676 SFLOW_PORT=`parse_listening_port < test-sflow.log`
1678 ovs-appctl time/stop
1680 ADD_OF_PORTS([br0], 1, 2)
1682 set Interface br0 options:ifindex=1002 -- \
1683 set Interface p1 options:ifindex=1004 -- \
1684 set Interface p2 options:ifindex=1003 -- \
1685 set Bridge br0 sflow=@sf -- \
1686 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
1687 header=128 sampling=1 polling=1
1689 dnl open with ARP packets to seed the bridge-learning. The output
1690 dnl ifIndex numbers should be reported predictably after that.
1691 dnl Since we set sampling=1 we should see all of these packets
1692 dnl reported. Sorting the output by data-source and seqNo makes
1693 dnl it deterministic. Ensuring that we send at least two packets
1694 dnl into each port means we get to check the seq nos are
1695 dnl incrementing correctly.
1697 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)'
1698 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)'
1699 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)'
1700 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)'
1701 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)'
1703 dnl sleep long enough to get more than one counter sample
1704 dnl from each datasource so we can check sequence numbers
1705 for i in `seq 1 30`; do
1706 ovs-appctl time/warp 100
1709 ovs-appctl -t test-sflow exit
1711 AT_CHECK([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
1732 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
1752 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
1772 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
1792 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
1812 hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
1815 AT_CHECK([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\
1829 in_broadcasts=4294967295
1832 in_unknownprotos=4294967295
1835 out_multicasts=4294967295
1836 out_broadcasts=4294967295
1852 in_broadcasts=4294967295
1855 in_unknownprotos=4294967295
1858 out_multicasts=4294967295
1859 out_broadcasts=4294967295
1875 in_broadcasts=4294967295
1878 in_unknownprotos=4294967295
1881 out_multicasts=4294967295
1882 out_broadcasts=4294967295
1898 in_broadcasts=4294967295
1901 in_unknownprotos=4294967295
1904 out_multicasts=4294967295
1905 out_broadcasts=4294967295
1921 in_broadcasts=4294967295
1924 in_unknownprotos=4294967295
1927 out_multicasts=4294967295
1928 out_broadcasts=4294967295
1944 in_broadcasts=4294967295
1947 in_unknownprotos=4294967295
1950 out_multicasts=4294967295
1951 out_broadcasts=4294967295
1960 dnl Test that basic NetFlow reports flow statistics correctly:
1961 dnl - The initial packet of a flow are correctly accounted.
1962 dnl - Later packets within a flow are correctly accounted.
1963 dnl - Flow actions changing (in this case, due to MAC learning)
1964 dnl cause a record to be sent.
1965 AT_SETUP([ofproto-dpif - NetFlow flow expiration])
1967 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
1968 ADD_OF_PORTS([br0], 1, 2)
1970 ovs-appctl time/stop
1971 ON_EXIT([kill `cat test-netflow.pid`])
1972 AT_CHECK([test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log], [0], [], [ignore])
1973 AT_CAPTURE_FILE([netflow.log])
1974 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
1977 set Bridge br0 netflow=@nf -- \
1978 --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \
1979 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
1981 for delay in 1000 30000; do
1982 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)'
1983 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)'
1985 ovs-appctl time/warp $delay
1990 ovs-appctl -t test-netflow exit
1992 AT_CHECK([[sed -e 's/, uptime [0-9]*//
1994 s/time \([0-9]*\)\.\.\.\1$/time <moment>/
1995 s/time [0-9]*\.\.\.[0-9]*/time <range>/
1996 ' netflow.log | sort]], [0],
1998 header: v5, seq 0, engine 2,1
1999 header: v5, seq 1, engine 2,1
2000 seq 0: 192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0, time <moment>
2001 seq 1: 192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0, time <moment>
2002 seq 1: 192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0, time <range>
2006 dnl Test that basic NetFlow reports active expirations correctly.
2007 AT_SETUP([ofproto-dpif - NetFlow active expiration])
2009 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
2010 ADD_OF_PORTS([br0], 1, 2)
2012 ON_EXIT([kill `cat test-netflow.pid`])
2013 AT_CHECK([test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log], [0], [], [ignore])
2014 AT_CAPTURE_FILE([netflow.log])
2015 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
2018 set Bridge br0 netflow=@nf -- \
2019 --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \
2020 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
2022 AT_CHECK([ovs-appctl time/stop])
2024 while test $n -le 60; do
2027 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)'
2028 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)'
2030 ovs-appctl time/warp 1000
2033 ovs-appctl time/warp 10000
2037 ovs-appctl -t test-netflow exit
2039 # Count the number of reported packets:
2040 # - From source to destination before MAC learning kicks in (just one).
2041 # - From source to destination after that.
2042 # - From destination to source.
2050 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
2057 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
2060 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
2063 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
2070 eval $counter=\`expr \$$counter + \$pkts\`
2071 n_recs=`expr $n_recs + 1`
2074 # There should be exactly 1 MAC learning packet,
2075 # exactly 59 other packets in that direction,
2076 # and exactly 60 packets in the other direction.
2077 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
2080 # There should be 1 expiration for MAC learning,
2081 # at least 5 active and a final expiration in one direction,
2082 # and at least 5 active and a final expiration in the other direction.
2084 AT_CHECK([test $n_recs -ge 13])
2088 AT_SETUP([idle_age and hard_age increase over time])
2091 # get_ages DURATION HARD IDLE
2093 # Fetch the flow duration, hard age, and idle age into the variables
2094 # whose names are given as arguments. Rounds DURATION down to the
2095 # nearest integer. If hard_age doesn't appear in the output, sets
2096 # HARD to "none". If idle_age doesn't appear in the output, sets IDLE
2099 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
2101 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
2102 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
2103 AS_VAR_COPY([$1], [duration])
2105 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
2106 if test X"$hard" = X; then
2109 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
2111 AS_VAR_COPY([$2], [hard])
2113 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
2114 if test X"$idle" = X; then
2117 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
2119 AS_VAR_COPY([$3], [idle])
2122 # Add a flow and get its initial hard and idle age.
2123 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
2124 get_ages duration1 hard1 idle1
2126 ovs-appctl time/stop
2127 # Warp time forward by 10 seconds, then modify the flow's actions.
2128 ovs-appctl time/warp 10000
2129 get_ages duration2 hard2 idle2
2130 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
2132 # Warp time forward by 10 seconds.
2133 ovs-appctl time/warp 10000
2134 get_ages duration3 hard3 idle3
2136 # Warp time forward 10 more seconds, then pass some packets through the flow,
2137 # then warp forward a few more times because idle times are only updated
2139 ovs-appctl time/warp 10000
2140 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)'
2141 ovs-appctl time/warp 1000
2142 ovs-appctl time/warp 1000
2143 ovs-appctl time/warp 1000
2144 get_ages duration4 hard4 idle4
2146 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
2147 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
2148 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
2150 # Duration should increase steadily over time.
2151 AT_CHECK([test $duration1 -lt $duration2])
2152 AT_CHECK([test $duration2 -lt $duration3])
2153 AT_CHECK([test $duration3 -lt $duration4])
2155 # Hard age should be "none" initially because it's the same as flow_duration,
2156 # then it should increase.
2157 AT_CHECK([test $hard1 = none])
2158 AT_CHECK([test $hard2 = none])
2159 AT_CHECK([test $hard3 != none])
2160 AT_CHECK([test $hard4 != none])
2161 AT_CHECK([test $hard3 -lt $hard4])
2163 # Idle age should increase from 1 to 2 to 3, then decrease.
2164 AT_CHECK([test $idle1 -lt $idle2])
2165 AT_CHECK([test $idle2 -lt $idle3])
2166 AT_CHECK([test $idle3 -gt $idle4])
2168 # Check some invariant relationships.
2169 AT_CHECK([test $duration1 = $idle1])
2170 AT_CHECK([test $duration2 = $idle2])
2171 AT_CHECK([test $duration3 = $idle3])
2172 AT_CHECK([test $idle3 -gt $hard3])
2173 AT_CHECK([test $idle4 -lt $hard4])
2174 AT_CHECK([test $hard4 -lt $duration4])
2179 AT_SETUP([ofproto-dpif - fin_timeout])
2181 AT_DATA([flows.txt], [dnl
2182 in_port=1 actions=output:2
2183 in_port=2 actions=mod_vlan_vid:17,output:1
2185 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
2186 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
2188 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
2191 ovs-appctl time/stop
2192 # Check that a TCP SYN packet does not change the timeout. (Because
2193 # flow stats updates are mainly what implements the fin_timeout
2194 # feature, we warp forward a couple of times to ensure that flow stats
2195 # run before re-checking the flow table.)
2196 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
2197 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
2200 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
2202 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
2204 # Check that a TCP FIN packet does change the timeout.
2205 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
2206 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
2209 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
2211 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
2216 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
2217 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
2218 ADD_OF_PORTS([br0], [1], [2])
2219 ADD_OF_PORTS([br1], [3])
2221 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
2228 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
2229 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
2230 ADD_OF_PORTS([br0], [1], [2])
2231 ADD_OF_PORTS([br1], [3])
2233 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
2234 dummy@ovs-dummy: hit:0 missed:0
2235 flows: cur: 0, avg: 0, max: 0, life span: 0ms
2237 br0 65534/100: (dummy)
2241 br1 65534/101: (dummy)
2247 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
2248 OVS_VSWITCHD_START([add-br br1 -- \
2249 set bridge br1 datapath-type=dummy fail-mode=secure])
2250 ADD_OF_PORTS([br0], [1], [2])
2251 ADD_OF_PORTS([br1], [3])
2253 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)'])
2254 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)'])
2255 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)'])
2257 AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
2258 skb_priority(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:0.0s, actions:userspace(pid=0,slow_path(controller))
2259 skb_priority(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:0.0s, actions:userspace(pid=0,slow_path(controller))
2262 AT_CHECK([ovs-appctl dpif/dump-flows br1 | sort | STRIP_USED], [0], [dnl
2263 skb_priority(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:0.0s, actions:userspace(pid=0,slow_path(controller))
2269 AT_SETUP([ofproto-dpif - ovs-appctl dpif/del-flows])
2270 OVS_VSWITCHD_START([add-br br1 -- \
2271 set bridge br1 datapath-type=dummy fail-mode=secure])
2272 ADD_OF_PORTS([br0], [1], [2])
2273 ADD_OF_PORTS([br1], [3])
2275 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)'])
2276 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)'])
2277 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)'])
2279 AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
2280 skb_priority(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:0.0s, actions:userspace(pid=0,slow_path(controller))
2281 skb_priority(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:0.0s, actions:userspace(pid=0,slow_path(controller))
2284 AT_CHECK([ovs-appctl dpif/dump-flows br1 | sort | STRIP_USED], [0], [dnl
2285 skb_priority(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:0.0s, actions:userspace(pid=0,slow_path(controller))
2288 AT_CHECK([ovs-appctl dpif/del-flows br0])
2289 AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
2292 AT_CHECK([ovs-appctl dpif/dump-flows br1 | sort | STRIP_USED], [0], [dnl
2293 skb_priority(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:0.0s, actions:userspace(pid=0,slow_path(controller))
2299 AT_SETUP([ofproto-dpif - patch ports])
2300 OVS_VSWITCHD_START([add-br br1 \
2301 -- set bridge br1 datapath-type=dummy fail-mode=secure \
2302 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
2303 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
2305 ADD_OF_PORTS([br0], [2])
2306 ADD_OF_PORTS([br1], [3])
2308 AT_CHECK([ovs-appctl time/stop]) dnl Make life span averages consistent.
2310 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
2311 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
2313 for i in $(seq 1 10); do
2314 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)'
2317 for i in $(seq 1 5); do
2318 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)'
2321 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
2325 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
2326 dummy@ovs-dummy: hit:13 missed:2
2327 flows: cur: 2, avg: 1, max: 2, life span: 1250ms
2329 br0 65534/100: (dummy)
2331 pbr0 1/none: (patch: peer=pbr1)
2333 br1 65534/101: (dummy)
2335 pbr1 1/none: (patch: peer=pbr0)
2338 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_USED], [0], [dnl
2339 skb_priority(0),in_port(100),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:9, bytes:540, used:0.0s, actions:101,3,2
2341 AT_CHECK([ovs-appctl dpif/dump-flows br1 | STRIP_USED], [0], [dnl
2342 skb_priority(0),in_port(101),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:4, bytes:240, used:0.0s, actions:100,2,3
2345 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
2346 OFPST_PORT reply (xid=0x4): 1 ports
2347 port 1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
2348 tx pkts=10, bytes=600, drop=0, errs=0, coll=0
2351 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
2352 OFPST_PORT reply (xid=0x4): 1 ports
2353 port 1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
2354 tx pkts=5, bytes=300, drop=0, errs=0, coll=0
2360 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show rates])
2361 OVS_VSWITCHD_START([set Bridge br0 fail-mode=secure])
2362 ADD_OF_PORTS([br0], 1, 2)
2364 AT_CHECK([ovs-appctl time/stop]) dnl Make life span averages consistent.
2365 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
2367 for i in $(seq 1 61); do
2368 ovs-appctl netdev-dummy/receive br0 '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)'
2369 ovs-appctl time/warp 10000
2370 ovs-appctl time/warp 50000
2373 AT_CHECK([ovs-appctl time/warp 10000], [0], [warped
2376 AT_CHECK([ovs-appctl dpif/show | sed 's/ 10[[0-9]]\{3\}(ms)$/ 10000(ms)/'], [0], [dnl
2377 dummy@ovs-dummy: hit:0 missed:61
2378 flows: cur: 0, avg: 0, max: 1, life span: 1666ms
2379 br0: hit:0 missed:61
2380 br0 65534/100: (dummy)
2388 AT_SETUP([ofproto-dpif - port duration])
2389 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
2390 ADD_OF_PORTS([br0], 1, 2)
2392 ovs-appctl time/stop
2393 ovs-appctl time/warp 10000
2395 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
2396 AT_CHECK([sed 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/' stdout], [0],
2398 OFPST_PORT reply (OF1.3) (xid=0x2): 3 ports
2399 port 1: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
2400 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
2402 port 2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
2403 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
2405 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
2406 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
2412 dnl ----------------------------------------------------------------------
2413 AT_BANNER([ofproto-dpif -- megaflows])
2415 # Strips out uninteresting parts of megaflow output, as well as parts
2416 # that vary from one run to another (e.g., timing and bond actions).
2417 m4_define([STRIP_USED], [[sed '
2418 s/used:[0-9]*\.[0-9]*/used:0.0/
2420 m4_define([STRIP_XOUT], [[sed '
2421 s/used:[0-9]*\.[0-9]*/used:0.0/
2422 s/Datapath actions:.*/Datapath actions: <del>/
2425 AT_SETUP([ofproto-dpif megaflow - port classification])
2427 ADD_OF_PORTS([br0], [1], [2])
2428 AT_DATA([flows.txt], [dnl
2429 table=0 in_port=1 actions=output(2)
2431 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2432 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)'])
2433 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)'])
2434 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2435 skb_priority=0,ip,in_port=1,nw_frag=no, n_subfacets:2, used:0.0s, Datapath actions: <del>
2440 AT_SETUP([ofproto-dpif megaflow - L2 classification])
2442 ADD_OF_PORTS([br0], [1], [2])
2443 AT_DATA([flows.txt], [dnl
2444 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
2446 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2447 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)'])
2448 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)'])
2449 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2450 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2451 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2456 AT_SETUP([ofproto-dpif megaflow - L3 classification])
2458 ADD_OF_PORTS([br0], [1], [2])
2459 AT_DATA([flows.txt], [dnl
2460 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
2462 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2463 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)'])
2464 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)'])
2465 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2466 skb_priority=0,icmp,in_port=1,nw_src=10.0.0.2,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2467 skb_priority=0,icmp,in_port=1,nw_src=10.0.0.4,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2472 AT_SETUP([ofproto-dpif megaflow - L4 classification])
2474 ADD_OF_PORTS([br0], [1], [2])
2475 AT_DATA([flows.txt], [dnl
2476 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
2478 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2479 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)'])
2480 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)'])
2481 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2482 skb_priority=0,icmp,in_port=1,nw_frag=no,icmp_type=8, n_subfacets:2, used:0.0s, Datapath actions: <del>
2487 AT_SETUP([ofproto-dpif megaflow - normal])
2489 ADD_OF_PORTS([br0], [1], [2])
2490 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
2491 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)'])
2492 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)'])
2493 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2494 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2495 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2500 AT_SETUP([ofproto-dpif megaflow - mpls])
2502 ADD_OF_PORTS([br0], [1], [2])
2503 AT_DATA([flows.txt], [dnl
2504 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
2505 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
2507 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2508 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)'])
2509 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)'])
2510 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2511 skb_priority=0,mpls,in_port=1,dl_src=50:54:00:00:00:09,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2512 skb_priority=0,mpls,in_port=1,dl_src=50:54:00:00:00:0b,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2517 AT_SETUP([ofproto-dpif megaflow - netflow])
2519 ADD_OF_PORTS([br0], [1], [2])
2521 dnl NetFlow configuration disables wildcarding relevant fields
2522 ON_EXIT([kill `cat test-netflow.pid`])
2523 AT_CHECK([test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log], [0], [], [ignore])
2524 AT_CAPTURE_FILE([netflow.log])
2525 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
2527 set Bridge br0 netflow=@nf -- \
2528 --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \
2529 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
2531 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
2532 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)'])
2533 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)'])
2534 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2535 skb_priority=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_frag=no,icmp_type=8,icmp_code=0, n_subfacets:1, used:0.0s, Datapath actions: <del>
2536 skb_priority=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_frag=no,icmp_type=8,icmp_code=0, n_subfacets:1, used:0.0s, Datapath actions: <del>
2541 AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
2543 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
2544 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
2545 set interface p2 type=dummy ofport_request=2 -- \
2546 set interface p3 type=dummy ofport_request=3])
2547 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
2550 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
2551 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)'])
2552 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)'])
2553 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2554 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2555 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2560 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
2562 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
2563 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
2564 set interface p2 type=dummy ofport_request=2 -- \
2565 set interface p3 type=dummy ofport_request=3])
2566 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
2569 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
2570 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)'])
2571 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)'])
2572 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2573 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2574 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2579 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
2580 # Create bond0 on br0 with interfaces p0 and p1
2581 # and bond1 on br1 with interfaces p2 and p3
2582 # with p0 patched to p2 and p1 patched to p3.
2584 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
2585 other-config:lacp-time=fast \
2586 other-config:bond-rebalance-interval=0 -- \
2587 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
2588 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
2590 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
2591 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
2592 fail-mode=secure -- \
2593 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
2594 other-config:lacp-time=fast \
2595 other-config:bond-rebalance-interval=0 -- \
2596 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
2597 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
2599 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
2601 ADD_OF_PORTS([br0], [7])
2602 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
2603 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
2604 ovs-appctl time/stop
2605 ovs-appctl time/warp 5000
2606 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)'])
2607 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)'])
2609 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2610 skb_priority=0,icmp,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_frag=no,icmp_type=8,icmp_code=0, n_subfacets:1, used:0.0s, Datapath actions: <del>
2611 skb_priority=0,icmp,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_frag=no,icmp_type=8,icmp_code=0, n_subfacets:1, used:0.0s, Datapath actions: <del>
2616 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
2618 ADD_OF_PORTS([br0], [1], [2])
2619 AT_DATA([flows.txt], [dnl
2620 table=0 in_port=1,ip actions=resubmit(90)
2621 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
2623 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2624 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)'])
2625 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)'])
2626 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2627 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2628 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2633 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
2635 ADD_OF_PORTS([br0], [1], [2])
2636 AT_DATA([flows.txt], [dnl
2637 table=0 in_port=1,ip actions=resubmit(,1)
2638 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
2640 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2641 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)'])
2642 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=
2643 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
2644 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2645 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2646 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2651 AT_SETUP([ofproto-dpif megaflow - goto_table action])
2653 ADD_OF_PORTS([br0], [1], [2])
2654 AT_DATA([flows.txt], [dnl
2655 table=0 in_port=1,ip actions=goto_table(1)
2656 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
2658 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2659 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)'])
2660 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)'])
2661 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2662 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2663 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2668 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
2670 ADD_OF_PORTS([br0], [1], [2], [3])
2672 set Bridge br0 mirrors=@m --\
2673 --id=@p3 get Port p3 --\
2674 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
2676 AT_DATA([flows.txt], [dnl
2677 in_port=1 actions=output:2
2679 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2680 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)'])
2681 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)'])
2682 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2683 skb_priority=0,ip,in_port=1,nw_frag=no, n_subfacets:2, used:0.0s, Datapath actions: <del>
2688 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
2690 ADD_OF_PORTS([br0], [1], [2], [3])
2692 set Bridge br0 mirrors=@m --\
2693 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
2694 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
2696 AT_DATA([flows.txt], [dnl
2697 in_port=1 actions=output:2
2699 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2700 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))'])
2701 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)'])
2702 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2703 skb_priority=0,ip,in_port=1,dl_vlan=11,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2704 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2709 AT_SETUP([ofproto-dpif megaflow - move action])
2711 ADD_OF_PORTS([br0], [1], [2])
2712 AT_DATA([flows.txt], [dnl
2713 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
2714 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
2715 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
2717 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2718 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)'])
2719 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)'])
2720 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2721 skb_priority=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2722 skb_priority=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2727 AT_SETUP([ofproto-dpif megaflow - push action])
2729 ADD_OF_PORTS([br0], [1], [2])
2730 AT_DATA([flows.txt], [dnl
2731 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
2733 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2734 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)'])
2735 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)'])
2736 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2737 skb_priority=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2738 skb_priority=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2743 AT_SETUP([ofproto-dpif megaflow - learning])
2745 ADD_OF_PORTS([br0], [1], [2])
2746 AT_DATA([flows.txt], [dnl
2747 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
2749 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2750 ovs-appctl time/stop
2751 # We send each packet twice because the first packet in each flow causes the
2752 # flow table to change and thus revalidations, which (depending on timing)
2753 # can keep a megaflow from being installed. The revalidations are done by
2754 # the second iteration, allowing the flows to be installed.
2756 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)'])
2757 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)'])
2758 ovs-appctl time/warp 100
2760 dnl The original flow is missing due to a revalidation.
2761 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2762 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:09,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2763 skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:0b,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2768 AT_SETUP([ofproto-dpif megaflow - tunnels])
2770 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \
2771 ofport_request=1 -- \
2772 add-port br0 p2 -- set Interface p2 type=gre options:remote_ip=1.1.1.1 \
2773 ofport_request=2 options:key=flow -- \
2774 add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \
2775 ofport_request=3 -- \
2776 add-port br0 p4 -- set Interface p4 type=gre options:remote_ip=1.1.1.2 \
2777 options:tos=inherit options:ttl=inherit ofport_request=4 options:key=flow])
2778 AT_DATA([flows.txt], [dnl
2779 in_port=1,actions=output(2)
2780 in_port=3,actions=output(4)
2782 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2783 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
2784 dnl will cause the packet to be dropped.
2785 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)'])
2786 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)'])
2787 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)'])
2788 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)'])
2789 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2790 skb_priority=0,ip,in_port=1,nw_ecn=1,nw_frag=no, n_subfacets:2, used:0.0s, Datapath actions: <del>
2791 skb_priority=0,ip,in_port=3,nw_tos=0,nw_ecn=1,nw_ttl=64,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2792 skb_priority=0,ip,in_port=3,nw_tos=252,nw_ecn=1,nw_ttl=128,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2797 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
2799 ADD_OF_PORTS([br0], [1], [2])
2800 AT_DATA([flows.txt], [dnl
2801 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
2803 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2804 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)'])
2805 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)'])
2806 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_XOUT], [0], [dnl
2807 skb_priority=0,icmp,in_port=1,nw_src=10.0.0.2,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: <del>
2808 skb_priority=0,icmp,in_port=1,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_ecn=0,nw_ttl=64, n_subfacets:1, used:0.0s, Datapath actions: <del>
2813 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
2815 ADD_OF_PORTS([br0], [1], [2])
2816 AT_DATA([flows.txt], [dnl
2817 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
2819 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2820 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)'])
2821 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)'])
2822 dnl The megaflows do not match the same fields, since the first packet
2823 dnl is essentially a no-op. (The new destination MAC is the same as the
2824 dnl original.) The ofproto-dpif library un-wildcards the destination MAC
2825 dnl so that a packet that doesn't need its MAC address changed doesn't
2826 dnl hide one that does. Since the first entry doesn't need to change,
2827 dnl only the destination MAC address is matched (as decided by
2828 dnl ofproto-dpif). The second entry actually updates the destination
2829 dnl MAC, so both the source and destination MAC addresses are
2830 dnl un-wildcarded, since the ODP commit functions update both the source
2831 dnl and destination MAC addresses.
2832 AT_CHECK([ovs-appctl dpif/dump-megaflows br0 | STRIP_USED], [0], [dnl
2833 skb_priority=0,ip,in_port=1,dl_dst=50:54:00:00:00:0a,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: 2
2834 skb_priority=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, n_subfacets:1, used:0.0s, Datapath actions: set(eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a)),2
2839 AT_SETUP([ofproto-dpif - datapath port number change])
2840 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
2841 ADD_OF_PORTS([br0], 1)
2843 # Trace a flow that should output to p1.
2844 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
2846 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
2849 # Change p1's port number to 5.
2850 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
2852 # Trace a flow that should output to p1 in its new location.
2853 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
2855 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
2860 # Tests the bundling with various bfd and cfm configurations.
2861 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
2862 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
2863 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
2864 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
2865 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
2866 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
2867 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
2868 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
2869 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
2870 set Interface p0 cfm_mpid=1 -- \
2871 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
2873 ovs-appctl time/stop
2874 # advance the clock to stablize everything.
2875 for i in `seq 0 49`; do ovs-appctl time/warp 100; done
2876 # cfm/show should show 'recv' fault.
2877 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
2880 # bfd/show should show 'up'.
2881 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
2882 Local Session State: up
2883 Remote Session State: up
2884 Local Session State: up
2885 Remote Session State: up
2887 # bond/show should show 'may-enable: true' for all slaves.
2888 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
2895 # now disable the bfd on p1.
2896 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
2897 # advance the clock to stablize everything.
2898 for i in `seq 0 49`; do ovs-appctl time/warp 100; done
2899 # cfm/show should show 'recv' fault.
2900 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
2903 # bfd/show should show 'down'.
2904 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
2905 Local Session State: down
2906 Remote Session State: down
2908 # bond/show should show 'may-enable: false' for p0.
2909 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
2916 # now enable the bfd on p1 and disable bfd on p0.
2917 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
2918 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
2919 # advance the clock to stablize everything.
2920 for i in `seq 0 49`; do ovs-appctl time/warp 100; done
2921 # cfm/show should show 'recv' fault.
2922 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
2925 # bfd/show should show 'down'.
2926 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
2927 Local Session State: down
2928 Remote Session State: down
2930 # bond/show should show 'may-enable: false' for p0 and p1.
2931 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
2941 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
2942 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
2945 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
2947 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2948 monitor thread created
2950 # disable bfd on p0.
2951 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
2953 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2954 monitor thread terminated
2956 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
2959 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
2961 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2962 monitor thread created
2964 # disable cfm on p0.
2965 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
2967 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2968 monitor thread terminated
2970 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
2972 # enable both bfd and cfm on p0.
2973 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
2975 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2976 monitor thread created
2978 # disable bfd on p0.
2979 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
2980 # check log, there should not be the log of thread terminated.
2981 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2983 # reenable bfd on p0.
2984 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
2985 # check log, should still be on log of thread created.
2986 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2987 monitor thread created
2989 # disable bfd and cfm together.
2990 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
2992 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
2993 monitor thread terminated
2999 # this test helps avoid the deadlock between the main thread and monitor thread.
3000 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
3003 for i in `seq 1 199`
3005 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])
3011 AT_BANNER([ofproto-dpif - flow translation resource limits])
3013 AT_SETUP([ofproto-dpif - infinite resubmit])
3015 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
3016 AT_CHECK([ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
3018 AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
3020 AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
3023 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
3026 AT_SETUP([ofproto-dpif - exponential resubmit chain])
3028 ADD_OF_PORTS([br0], 1)
3029 (for i in `seq 1 64`; do
3031 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
3033 echo "in_port=65, actions=local") > flows
3034 AT_CHECK([ovs-ofctl add-flows br0 flows])
3035 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
3036 AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
3038 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
3041 AT_SETUP([ofproto-dpif - too many output actions])
3043 ADD_OF_PORTS([br0], 1)
3044 (for i in `seq 1 12`; do
3046 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
3048 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
3049 AT_CHECK([ovs-ofctl add-flows br0 flows])
3050 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
3051 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
3053 AT_CHECK([grep -c 'discarding oversize datapath actions' ovs-vswitchd.log], [0], [1
3055 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d
3056 /discarding oversize datapath actions/d"])
3059 AT_SETUP([ofproto-dpif - stack too deep])
3061 ADD_OF_PORTS([br0], 1)
3062 (for i in `seq 1 12`; do
3064 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
3066 push="push:NXM_NX_REG0[[]]"
3067 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
3068 AT_CHECK([ovs-ofctl add-flows br0 flows])
3069 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
3070 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
3072 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])