]>
Commit | Line | Data |
---|---|---|
589dd1d5 IM |
1 | AT_BANNER([PMD]) |
2 | ||
a12e2a88 DDP |
3 | m4_divert_push([PREPARE_TESTS]) |
4 | ||
5 | # Given the output of `ovs-appctl dpif-netdev/pmd-rxq-show`, prints a list | |
6 | # of every rxq (one per line) in the form: | |
7 | # port_name rxq_id numa_id core_id | |
8 | parse_pmd_rxq_show () { | |
2a2c67b4 KT |
9 | awk '/pmd thread/ {numa=$4; core=substr($6, 1, length($6) - 1)} /\tport:/ {print $2, $4, numa, core}' | sort |
10 | } | |
11 | ||
12 | # Given the output of `ovs-appctl dpif-netdev/pmd-rxq-show`, | |
13 | # and with queues for each core on one line, prints the rxqs | |
14 | # of the core on one line | |
15 | # 'port:' port_name 'queue_id:' rxq_id rxq_id rxq_id rxq_id | |
16 | parse_pmd_rxq_show_group () { | |
17 | awk '/port:/ {print $1, $2, $3, $4, $12, $20, $28}' | |
a12e2a88 DDP |
18 | } |
19 | ||
20 | # Given the output of `ovs-appctl dpctl/dump-flows`, prints a list of flows | |
21 | # (one per line), with the pmd_id at the beginning of the line | |
22 | # | |
23 | flow_dump_prepend_pmd () { | |
24 | awk '/flow-dump from non-dpdk/ {pmd_id=-1; next} /flow-dump from pmd/ {pmd_id=$7; next} {print pmd_id, $0}' | sort | |
25 | } | |
26 | ||
27 | m4_divert_pop([PREPARE_TESTS]) | |
28 | ||
589dd1d5 IM |
29 | dnl CHECK_CPU_DISCOVERED([n_cpu]) |
30 | dnl | |
31 | dnl Waits until CPUs discovered and checks if number of discovered CPUs | |
32 | dnl is greater or equal to 'n_cpu'. Without parameters checks that at | |
33 | dnl least one CPU discovered. | |
34 | m4_define([CHECK_CPU_DISCOVERED], [ | |
35 | PATTERN="Discovered [[0-9]]* NUMA nodes and [[0-9]]* CPU cores" | |
3a21992e PB |
36 | OVS_WAIT_UNTIL([grep "$PATTERN" ovs-vswitchd.log]) |
37 | N_CPU=$(grep "$PATTERN" ovs-vswitchd.log | sed -e 's/.* \([[0-9]]*\) CPU cores/\1/') | |
589dd1d5 IM |
38 | if [[ -z "$1" ]] |
39 | then AT_CHECK([test "$N_CPU" -gt "0"]) | |
40 | else AT_SKIP_IF([test "$N_CPU" -lt "$1"]) | |
41 | fi | |
42 | ]) | |
43 | ||
44 | dnl CHECK_PMD_THREADS_CREATED([n_threads], [numa_id], [+line]) | |
45 | dnl | |
46 | dnl Whaits for creation of 'n_threads' or at least 1 thread if $1 not | |
47 | dnl passed. Checking starts from line number 'line' in ovs-vswithd.log . | |
48 | m4_define([CHECK_PMD_THREADS_CREATED], [ | |
140dd699 | 49 | PATTERN="There are [[0-9]]* pmd threads on numa node $2" |
589dd1d5 IM |
50 | line_st=$3 |
51 | if [[ -z "$line_st" ]] | |
52 | then | |
53 | line_st="+0" | |
54 | fi | |
55 | OVS_WAIT_UNTIL([tail -n $line_st ovs-vswitchd.log | grep "$PATTERN"]) | |
56 | N_THREADS=$(tail -n $line_st ovs-vswitchd.log | grep "$PATTERN" | tail -1 | sed -e 's/.* \([[0-9]]*\) pmd .*/\1/') | |
57 | if [[ -z "$1" ]] | |
58 | then AT_CHECK([test "$N_THREADS" -gt 0]) | |
59 | else AT_CHECK([test "$N_THREADS" -eq "$1"]) | |
60 | fi | |
61 | ]) | |
62 | ||
63 | m4_define([SED_NUMA_CORE_PATTERN], ["s/\(numa_id \)[[0-9]]*\( core_id \)[[0-9]]*:/\1<cleared>\2<cleared>:/"]) | |
2a2c67b4 | 64 | m4_define([SED_NUMA_CORE_QUEUE_PATTERN], ["s/1 2 5 6/<group>/;s/0 3 4 7/<group>/"]) |
b9584f21 | 65 | m4_define([DUMMY_NUMA], [--dummy-numa="0,0,0,0"]) |
589dd1d5 IM |
66 | |
67 | AT_SETUP([PMD - creating a thread/add-port]) | |
68 | OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy-pmd], [], [], [DUMMY_NUMA]) | |
69 | ||
70 | CHECK_CPU_DISCOVERED() | |
71 | CHECK_PMD_THREADS_CREATED() | |
72 | ||
73 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl | |
74 | pmd thread numa_id <cleared> core_id <cleared>: | |
3eb67853 | 75 | isolated : false |
2a2c67b4 | 76 | port: p0 queue-id: 0 pmd usage: NOT AVAIL |
589dd1d5 IM |
77 | ]) |
78 | ||
79 | AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl | |
80 | dummy@ovs-dummy: hit:0 missed:0 | |
81 | br0: | |
e98d0cb3 | 82 | br0 65534/100: (dummy-internal) |
589dd1d5 IM |
83 | p0 1/1: (dummy-pmd: configured_rx_queues=1, configured_tx_queues=<cleared>, requested_rx_queues=1, requested_tx_queues=<cleared>) |
84 | ]) | |
85 | ||
86 | OVS_VSWITCHD_STOP | |
87 | AT_CLEANUP | |
88 | ||
89 | AT_SETUP([PMD - multiqueue support]) | |
90 | OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy-pmd], [], [], [DUMMY_NUMA]) | |
91 | ||
92 | CHECK_CPU_DISCOVERED() | |
93 | CHECK_PMD_THREADS_CREATED() | |
94 | ||
95 | AT_CHECK([ovs-vsctl set interface p0 options:n_rxq=8]) | |
96 | ||
97 | AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl | |
98 | dummy@ovs-dummy: hit:0 missed:0 | |
99 | br0: | |
e98d0cb3 | 100 | br0 65534/100: (dummy-internal) |
589dd1d5 IM |
101 | p0 1/1: (dummy-pmd: configured_rx_queues=8, configured_tx_queues=<cleared>, requested_rx_queues=8, requested_tx_queues=<cleared>) |
102 | ]) | |
103 | ||
104 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl | |
105 | pmd thread numa_id <cleared> core_id <cleared>: | |
3eb67853 | 106 | isolated : false |
2a2c67b4 KT |
107 | port: p0 queue-id: 0 pmd usage: NOT AVAIL |
108 | port: p0 queue-id: 1 pmd usage: NOT AVAIL | |
109 | port: p0 queue-id: 2 pmd usage: NOT AVAIL | |
110 | port: p0 queue-id: 3 pmd usage: NOT AVAIL | |
111 | port: p0 queue-id: 4 pmd usage: NOT AVAIL | |
112 | port: p0 queue-id: 5 pmd usage: NOT AVAIL | |
113 | port: p0 queue-id: 6 pmd usage: NOT AVAIL | |
114 | port: p0 queue-id: 7 pmd usage: NOT AVAIL | |
589dd1d5 IM |
115 | ]) |
116 | ||
117 | OVS_VSWITCHD_STOP | |
118 | AT_CLEANUP | |
119 | ||
120 | ||
121 | AT_SETUP([PMD - pmd-cpu-mask/distribution of rx queues]) | |
122 | OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy-pmd options:n_rxq=8], | |
123 | [], [], [DUMMY_NUMA]) | |
124 | ||
125 | CHECK_CPU_DISCOVERED(2) | |
126 | CHECK_PMD_THREADS_CREATED() | |
127 | ||
128 | AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl | |
129 | dummy@ovs-dummy: hit:0 missed:0 | |
130 | br0: | |
e98d0cb3 | 131 | br0 65534/100: (dummy-internal) |
589dd1d5 IM |
132 | p0 1/1: (dummy-pmd: configured_rx_queues=8, configured_tx_queues=<cleared>, requested_rx_queues=8, requested_tx_queues=<cleared>) |
133 | ]) | |
134 | ||
135 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl | |
136 | pmd thread numa_id <cleared> core_id <cleared>: | |
3eb67853 | 137 | isolated : false |
2a2c67b4 KT |
138 | port: p0 queue-id: 0 pmd usage: NOT AVAIL |
139 | port: p0 queue-id: 1 pmd usage: NOT AVAIL | |
140 | port: p0 queue-id: 2 pmd usage: NOT AVAIL | |
141 | port: p0 queue-id: 3 pmd usage: NOT AVAIL | |
142 | port: p0 queue-id: 4 pmd usage: NOT AVAIL | |
143 | port: p0 queue-id: 5 pmd usage: NOT AVAIL | |
144 | port: p0 queue-id: 6 pmd usage: NOT AVAIL | |
145 | port: p0 queue-id: 7 pmd usage: NOT AVAIL | |
589dd1d5 IM |
146 | ]) |
147 | ||
148 | TMP=$(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]]) | |
3fa215b1 | 149 | AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x3]) |
589dd1d5 IM |
150 | CHECK_PMD_THREADS_CREATED([2], [], [+$TMP]) |
151 | ||
2a2c67b4 KT |
152 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed ':a;/AVAIL$/{N;s/\n//;ba}' | parse_pmd_rxq_show_group | sed SED_NUMA_CORE_QUEUE_PATTERN], [0], [dnl |
153 | port: p0 queue-id: <group> | |
154 | port: p0 queue-id: <group> | |
589dd1d5 IM |
155 | ]) |
156 | ||
157 | TMP=$(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]]) | |
3fa215b1 | 158 | AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x1]) |
589dd1d5 IM |
159 | CHECK_PMD_THREADS_CREATED([1], [], [+$TMP]) |
160 | ||
161 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl | |
162 | pmd thread numa_id <cleared> core_id <cleared>: | |
3eb67853 | 163 | isolated : false |
2a2c67b4 KT |
164 | port: p0 queue-id: 0 pmd usage: NOT AVAIL |
165 | port: p0 queue-id: 1 pmd usage: NOT AVAIL | |
166 | port: p0 queue-id: 2 pmd usage: NOT AVAIL | |
167 | port: p0 queue-id: 3 pmd usage: NOT AVAIL | |
168 | port: p0 queue-id: 4 pmd usage: NOT AVAIL | |
169 | port: p0 queue-id: 5 pmd usage: NOT AVAIL | |
170 | port: p0 queue-id: 6 pmd usage: NOT AVAIL | |
171 | port: p0 queue-id: 7 pmd usage: NOT AVAIL | |
589dd1d5 IM |
172 | ]) |
173 | ||
174 | OVS_VSWITCHD_STOP | |
175 | AT_CLEANUP | |
176 | ||
177 | ||
178 | AT_SETUP([PMD - stats]) | |
179 | OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 ofport_request=7 type=dummy-pmd options:n_rxq=4], | |
180 | [], [], [DUMMY_NUMA]) | |
181 | ||
182 | CHECK_CPU_DISCOVERED() | |
183 | CHECK_PMD_THREADS_CREATED() | |
184 | ||
185 | AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg]) | |
186 | AT_CHECK([ovs-ofctl add-flow br0 action=normal]) | |
4c30b246 | 187 | AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:emc-insert-inv-prob=1]) |
589dd1d5 IM |
188 | |
189 | sleep 1 | |
190 | ||
191 | AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl | |
192 | dummy@ovs-dummy: hit:0 missed:0 | |
193 | br0: | |
e98d0cb3 | 194 | br0 65534/100: (dummy-internal) |
589dd1d5 IM |
195 | p0 7/1: (dummy-pmd: configured_rx_queues=4, configured_tx_queues=<cleared>, requested_rx_queues=4, requested_tx_queues=<cleared>) |
196 | ]) | |
197 | ||
82a48ead | 198 | AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 8], [0], [dnl |
589dd1d5 | 199 | pmd thread numa_id <cleared> core_id <cleared>: |
82a48ead JS |
200 | packets received: 0 |
201 | packet recirculations: 0 | |
202 | avg. datapath passes per packet: 0.00 | |
203 | emc hits: 0 | |
204 | megaflow hits: 0 | |
205 | avg. subtable lookups per megaflow hit: 0.00 | |
206 | miss with success upcall: 0 | |
207 | miss with failed upcall: 0 | |
589dd1d5 IM |
208 | ]) |
209 | ||
210 | ovs-appctl time/stop | |
211 | ovs-appctl time/warp 100 | |
212 | ( | |
213 | for i in `seq 0 19`; | |
214 | do | |
215 | pkt="in_port(7),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),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)" | |
216 | AT_CHECK([ovs-appctl netdev-dummy/receive p0 $pkt]) | |
217 | done | |
218 | ) | |
219 | ovs-appctl time/warp 100 | |
220 | ||
221 | AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl | |
3d4b2e6e | 222 | skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),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) |
589dd1d5 IM |
223 | ]) |
224 | AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl | |
3d4b2e6e | 225 | recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),eth_type(0x0800),ipv4(frag=no), actions: <del> |
589dd1d5 IM |
226 | ]) |
227 | ||
82a48ead | 228 | AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 8], [0], [dnl |
589dd1d5 | 229 | pmd thread numa_id <cleared> core_id <cleared>: |
82a48ead JS |
230 | packets received: 20 |
231 | packet recirculations: 0 | |
232 | avg. datapath passes per packet: 1.00 | |
233 | emc hits: 19 | |
234 | megaflow hits: 0 | |
235 | avg. subtable lookups per megaflow hit: 0.00 | |
236 | miss with success upcall: 1 | |
237 | miss with failed upcall: 0 | |
589dd1d5 IM |
238 | ]) |
239 | ||
240 | OVS_VSWITCHD_STOP | |
241 | AT_CLEANUP | |
a12e2a88 DDP |
242 | |
243 | dnl Reconfigure the number of rx queues of a port, make sure that all the | |
244 | dnl queues are polled by the datapath and try to send a couple of packets. | |
245 | AT_SETUP([PMD - reconfigure n_rxq]) | |
246 | OVS_VSWITCHD_START( | |
247 | [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=2 -- \ | |
248 | add-port br0 p2 -- set Interface p2 type=dummy-pmd ofport_request=2 | |
249 | ], [], [], [--dummy-numa 0]) | |
250 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
251 | ||
252 | AT_CHECK([ovs-ofctl add-flow br0 action=controller]) | |
253 | ||
254 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
255 | p1 0 0 0 | |
256 | p1 1 0 0 | |
257 | p2 0 0 0 | |
258 | ]) | |
259 | ||
260 | AT_CAPTURE_FILE([ofctl_monitor.log]) | |
261 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
262 | ||
263 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 1 '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)']) | |
264 | ||
265 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) | |
266 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) | |
267 | ||
268 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
269 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) |
270 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
a12e2a88 DDP |
271 | ]) |
272 | ||
273 | AT_CHECK([ovs-vsctl set interface p1 options:n_rxq=4]) | |
274 | ||
275 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
276 | p1 0 0 0 | |
277 | p1 1 0 0 | |
278 | p1 2 0 0 | |
279 | p1 3 0 0 | |
280 | p2 0 0 0 | |
281 | ]) | |
282 | ||
283 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
284 | ||
285 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 3 '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)']) | |
286 | ||
287 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) | |
288 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) | |
289 | ||
290 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
291 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) |
292 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
a12e2a88 DDP |
293 | ]) |
294 | ||
2a21e757 IM |
295 | dnl Check resetting to default number of rx queues after removal from the db. |
296 | AT_CHECK([ovs-vsctl remove interface p1 options n_rxq]) | |
297 | ||
298 | AT_CHECK([ovs-appctl dpif/show | grep p1 | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl | |
299 | p1 1/1: (dummy-pmd: configured_rx_queues=1, configured_tx_queues=<cleared>, requested_rx_queues=1, requested_tx_queues=<cleared>) | |
300 | ]) | |
301 | ||
a12e2a88 DDP |
302 | OVS_VSWITCHD_STOP |
303 | AT_CLEANUP | |
304 | ||
305 | dnl There was a bug where OVS failed to create a ukey and install a megaflow | |
306 | dnl if a packet with the exact same flow was received by two different pmd | |
307 | dnl threads. This is a regression test for that bug. | |
308 | AT_SETUP([PMD - same flow multiple threads]) | |
309 | OVS_VSWITCHD_START( | |
310 | [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=2 -- \ | |
311 | set Open_vSwitch . other_config:pmd-cpu-mask=3 | |
312 | ], [], [], [--dummy-numa 0,0]) | |
313 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
314 | ||
315 | AT_CHECK([ovs-ofctl add-flow br0 action=controller]) | |
316 | ||
317 | dnl Make sure that the queues are on different cores. There's no way to | |
318 | dnl control which queue is on which thread, we just need to make sure that | |
319 | dnl two threads (core_id) show up in pmd-rxq-show | |
320 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show | cut -f 4 -d ' ' | sort], [0], [dnl | |
321 | 0 | |
322 | 1 | |
323 | ]) | |
324 | ||
325 | AT_CAPTURE_FILE([ofctl_monitor.log]) | |
326 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
327 | ||
328 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
329 | ||
330 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 1 '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)']) | |
331 | ||
332 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4]) | |
333 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) | |
334 | ||
335 | dnl Make sure that both flows have been installed | |
336 | AT_CHECK([ovs-appctl dpctl/dump-flows | flow_dump_prepend_pmd], [0], [dnl | |
74c4530d JP |
337 | 0 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535)) |
338 | 1 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535)) | |
a12e2a88 DDP |
339 | ]) |
340 | ||
341 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
342 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) |
343 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
344 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) | |
345 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
a12e2a88 DDP |
346 | ]) |
347 | ||
348 | OVS_VSWITCHD_STOP | |
349 | AT_CLEANUP | |
350 | ||
351 | AT_SETUP([PMD - change numa node]) | |
352 | OVS_VSWITCHD_START( | |
353 | [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=2 -- \ | |
354 | add-port br0 p2 -- set Interface p2 type=dummy-pmd ofport_request=2 options:n_rxq=2 -- \ | |
355 | set Open_vSwitch . other_config:pmd-cpu-mask=3 | |
356 | ], [], [], [--dummy-numa 0,1]) | |
357 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
358 | ||
359 | AT_CHECK([ovs-ofctl add-flow br0 action=controller]) | |
360 | ||
361 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
362 | p1 0 0 0 | |
363 | p1 1 0 0 | |
364 | p2 0 0 0 | |
365 | p2 1 0 0 | |
366 | ]) | |
367 | ||
368 | AT_CAPTURE_FILE([ofctl_monitor.log]) | |
369 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
370 | ||
371 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
372 | ||
ad73c142 | 373 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) |
a12e2a88 DDP |
374 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) |
375 | ||
376 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
377 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) |
378 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
ad73c142 TR |
379 | ]) |
380 | ||
381 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
382 | ||
383 | AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 1 '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)']) | |
384 | ||
385 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) | |
386 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) | |
387 | ||
388 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
389 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered) |
390 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
a12e2a88 DDP |
391 | ]) |
392 | ||
393 | AT_CHECK([ovs-vsctl set Interface p2 options:numa_id=1]) | |
394 | ||
395 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
396 | p1 0 0 0 | |
397 | p1 1 0 0 | |
398 | p2 0 1 1 | |
399 | p2 1 1 1 | |
400 | ]) | |
401 | ||
402 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
403 | ||
404 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 1 '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)']) | |
405 | ||
ad73c142 | 406 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) |
a12e2a88 DDP |
407 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) |
408 | ||
409 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
410 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) |
411 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
ad73c142 TR |
412 | ]) |
413 | ||
414 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
415 | ||
416 | AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
417 | ||
418 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) | |
419 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) | |
420 | ||
421 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
422 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered) |
423 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
a12e2a88 DDP |
424 | ]) |
425 | ||
426 | OVS_VSWITCHD_STOP | |
427 | AT_CLEANUP | |
428 | ||
429 | AT_SETUP([PMD - non pmd device]) | |
430 | OVS_VSWITCHD_START( | |
431 | [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=1 -- \ | |
432 | add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \ | |
433 | set Interface br0 options:tx_pcap=br0.pcap -- \ | |
434 | set Open_vSwitch . other_config:pmd-cpu-mask=1 | |
435 | ], [], [], [--dummy-numa 0,0]) | |
436 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
437 | ||
438 | AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL]) | |
439 | ||
440 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
441 | p1 0 0 0 | |
442 | ]) | |
443 | ||
444 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
445 | ||
446 | AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
447 | ||
448 | OVS_WAIT_UNTIL([test `ovs-pcap br0.pcap | wc -l` -ge 2]) | |
449 | ||
450 | AT_CHECK([ovs-pcap br0.pcap], [0], [dnl | |
6f068379 BP |
451 | 50540000000a50540000000908004500005c000000004001669f0a0000020a000001080013fc00000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f |
452 | 50540000000a50540000000908004500005c000000004001669f0a0000020a000001080013fc00000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f | |
a12e2a88 DDP |
453 | ]) |
454 | ||
455 | AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=2]) | |
456 | ||
457 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
458 | p1 0 0 1 | |
459 | ]) | |
460 | ||
461 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
462 | ||
463 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
464 | ||
465 | AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
466 | ||
467 | OVS_WAIT_UNTIL([test `ovs-pcap br0.pcap | wc -l` -ge 4]) | |
468 | ||
469 | AT_CHECK([ovs-pcap br0.pcap], [0], [dnl | |
6f068379 BP |
470 | 50540000000a50540000000908004500005c000000004001669f0a0000020a000001080013fc00000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f |
471 | 50540000000a50540000000908004500005c000000004001669f0a0000020a000001080013fc00000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f | |
472 | 50540000000a50540000000908004500005c000000004001669f0a0000020a000001080013fc00000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f | |
473 | 50540000000a50540000000908004500005c000000004001669f0a0000020a000001080013fc00000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f | |
a12e2a88 DDP |
474 | ]) |
475 | ||
476 | OVS_VSWITCHD_STOP | |
477 | AT_CLEANUP | |
478 | ||
479 | AT_SETUP([PMD - add remove ports]) | |
480 | OVS_VSWITCHD_START( | |
481 | [], [], [], [--dummy-numa 0,0]) | |
482 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
483 | ||
484 | AT_CHECK([ovs-ofctl add-flow br0 actions=controller]) | |
485 | ||
486 | AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=1]) | |
487 | ||
488 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
489 | p1 0 0 0 | |
490 | ]) | |
491 | ||
492 | AT_CAPTURE_FILE([ofctl_monitor.log]) | |
493 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
494 | ||
495 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
496 | ||
497 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) | |
498 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) | |
499 | ||
500 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
501 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) |
502 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
a12e2a88 DDP |
503 | ]) |
504 | ||
505 | AT_CHECK([ovs-vsctl del-port br0 p1]) | |
506 | AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=1]) | |
507 | ||
508 | AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) | |
509 | ||
510 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
511 | ||
512 | OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2]) | |
513 | OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) | |
514 | ||
515 | AT_CHECK([cat ofctl_monitor.log], [0], [dnl | |
6f068379 BP |
516 | NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered) |
517 | icmp,vlan_tci=0x0000,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_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:13fc | |
a12e2a88 DDP |
518 | ]) |
519 | ||
520 | OVS_VSWITCHD_STOP | |
521 | AT_CLEANUP | |
5e512845 DDP |
522 | |
523 | AT_SETUP([PMD - rxq affinity]) | |
524 | OVS_VSWITCHD_START( | |
525 | [], [], [], [--dummy-numa 0,0,0,0,0,0,0,0,0]) | |
526 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
527 | ||
528 | AT_CHECK([ovs-ofctl add-flow br0 actions=controller]) | |
529 | ||
3fa215b1 | 530 | AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x1fe]) |
5e512845 DDP |
531 | |
532 | AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=4 other_config:pmd-rxq-affinity="0:3,1:7,2:2,3:8"]) | |
533 | ||
534 | dnl The rxqs should be on the requested cores. | |
535 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
536 | p1 0 0 3 | |
537 | p1 1 0 7 | |
538 | p1 2 0 2 | |
539 | p1 3 0 8 | |
540 | ]) | |
541 | ||
542 | AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=6]) | |
543 | ||
544 | dnl We removed the cores requested by some queues from pmd-cpu-mask. | |
545 | dnl Those queues will not be polled. | |
546 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
547 | p1 2 0 2 | |
548 | ]) | |
549 | ||
550 | AT_CHECK([ovs-vsctl remove Interface p1 other_config pmd-rxq-affinity]) | |
551 | ||
552 | dnl We removed the rxq-affinity request. dpif-netdev should assign queues | |
553 | dnl in a round robin fashion. We just make sure that every rxq is being | |
554 | dnl polled again. | |
555 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show | cut -f 1,2 -d ' ' | sort], [0], [dnl | |
556 | p1 0 | |
557 | p1 1 | |
558 | p1 2 | |
559 | p1 3 | |
560 | ]) | |
561 | ||
562 | AT_CHECK([ovs-vsctl set Interface p1 other_config:pmd-rxq-affinity='0:1']) | |
563 | ||
564 | dnl We explicitly requested core 1 for queue 0. Core 1 becomes isolated and | |
565 | dnl every other queue goes to core 2. | |
566 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
567 | p1 0 0 1 | |
568 | p1 1 0 2 | |
569 | p1 2 0 2 | |
570 | p1 3 0 2 | |
571 | ]) | |
572 | ||
573 | OVS_VSWITCHD_STOP(["/dpif_netdev|WARN|There is no PMD thread on core/d"]) | |
574 | AT_CLEANUP | |
546e57d4 | 575 | |
5dd57e80 IM |
576 | AT_SETUP([PMD - rxq affinity - NUMA]) |
577 | OVS_VSWITCHD_START( | |
578 | [], [], [], [--dummy-numa 0,0,0,1,1]) | |
579 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
580 | ||
581 | AT_CHECK([ovs-ofctl add-flow br0 actions=controller]) | |
582 | ||
583 | AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=7e]) | |
584 | ||
585 | AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=2 options:numa_id=0 other_config:pmd-rxq-affinity="0:1,1:2"]) | |
586 | ||
587 | dnl The rxqs should be on the requested cores. | |
588 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
589 | p1 0 0 1 | |
590 | p1 1 0 2 | |
591 | ]) | |
592 | ||
593 | AT_CHECK([ovs-vsctl set Interface p1 other_config:pmd-rxq-affinity="0:3,1:4"]) | |
594 | ||
595 | dnl We moved the queues to different numa node. Expecting threads on | |
596 | dnl NUMA node 1 to be created. | |
597 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
598 | p1 0 1 3 | |
599 | p1 1 1 4 | |
600 | ]) | |
601 | ||
602 | AT_CHECK([ovs-vsctl set Interface p1 other_config:pmd-rxq-affinity="0:3,1:1"]) | |
603 | ||
604 | dnl Queues splitted between NUMA nodes. | |
605 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
606 | p1 0 1 3 | |
607 | p1 1 0 1 | |
608 | ]) | |
609 | ||
610 | AT_CHECK([ovs-vsctl remove Interface p1 other_config pmd-rxq-affinity]) | |
611 | ||
612 | dnl We removed the rxq-affinity request. dpif-netdev should assign queues | |
613 | dnl in a round robin fashion. We just make sure that every rxq is being | |
614 | dnl polled again. | |
615 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show | cut -f 1,2 -d ' ' | sort], [0], [dnl | |
616 | p1 0 | |
617 | p1 1 | |
618 | ]) | |
619 | ||
620 | AT_CHECK([ovs-vsctl set Interface p1 other_config:pmd-rxq-affinity='0:3']) | |
621 | ||
622 | dnl We explicitly requesting NUMA node 1 for queue 0. | |
623 | dnl Queue 1 should be polled by thread from NUMA node 0. | |
624 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show | cut -f 1,2,3 -d ' '], [0], [dnl | |
625 | p1 0 1 | |
626 | p1 1 0 | |
627 | ]) | |
628 | ||
629 | OVS_VSWITCHD_STOP | |
630 | AT_CLEANUP | |
631 | ||
546e57d4 DDP |
632 | AT_SETUP([PMD - monitor threads]) |
633 | OVS_VSWITCHD_START( | |
634 | [], [], [], [--dummy-numa 0,0]) | |
635 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
636 | ||
637 | dnl The two devices are connected together externally using net.sock | |
638 | AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=1 options:pstream=punix:$OVS_RUNDIR/net.sock]) | |
639 | AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=dummy-pmd ofport_request=2 options:n_rxq=1 options:stream=unix:$OVS_RUNDIR/net.sock]) | |
640 | ||
641 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
642 | p1 0 0 0 | |
643 | p2 0 0 0 | |
644 | ]) | |
645 | ||
646 | dnl Enable bfd with a very aggressive interval. This will make the monitor very | |
647 | dnl busy, and uncover race conditions with the main thread. | |
648 | AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true bfd:min_rx=1 bfd:min_tx=1]) | |
649 | AT_CHECK([ovs-vsctl set Interface p2 bfd:enable=true bfd:min_rx=1 bfd:min_tx=1]) | |
650 | ||
651 | AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p1 bfd_status:forwarding=true \ | |
652 | -- wait-until Interface p2 bfd_status:forwarding=true]) | |
653 | ||
654 | dnl Trigger reconfiguration of the datapath | |
655 | AT_CHECK([ovs-vsctl set Interface p1 options:n_rxq=2]) | |
656 | AT_CHECK([ovs-vsctl set Interface p2 options:n_rxq=2]) | |
657 | ||
658 | dnl Make sure that reconfiguration succeded | |
659 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl | |
660 | p1 0 0 0 | |
661 | p1 1 0 0 | |
662 | p2 0 0 0 | |
663 | p2 1 0 0 | |
664 | ]) | |
665 | ||
e32971b8 | 666 | OVS_VSWITCHD_STOP |
546e57d4 | 667 | AT_CLEANUP |
f5d317a1 DDP |
668 | |
669 | AT_SETUP([PMD - dpctl]) | |
670 | OVS_VSWITCHD_START( | |
671 | [del-br br0], [], [], [--dummy-numa 0,0]) | |
672 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) | |
673 | ||
674 | AT_CHECK([ovs-appctl dpctl/add-dp dummy@dp0]) | |
675 | AT_CHECK([ovs-appctl dpctl/add-if dummy@dp0 p1,type=dummy-pmd]) | |
676 | AT_CHECK([ovs-appctl dpctl/add-if dummy@dp0 p2,type=dummy]) | |
677 | ||
678 | AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show dp0 | parse_pmd_rxq_show], [0], [dnl | |
679 | p1 0 0 0 | |
680 | ]) | |
681 | ||
682 | AT_CHECK([ovs-appctl dpctl/show dummy@dp0], [0], [dnl | |
683 | dummy@dp0: | |
684 | lookups: hit:0 missed:0 lost:0 | |
685 | flows: 0 | |
686 | port 0: dp0 (dummy-internal) | |
687 | port 1: p1 (dummy-pmd: configured_rx_queues=1, configured_tx_queues=1, requested_rx_queues=1, requested_tx_queues=1) | |
688 | port 2: p2 (dummy) | |
689 | ]) | |
690 | ||
691 | AT_CHECK([ovs-appctl dpctl/add-flow dummy@dp0 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234)' 2], [0], [dnl | |
692 | ]) | |
693 | ||
694 | AT_CHECK([ovs-appctl dpctl/dump-flows dummy@dp0 | sort], [0], [dnl | |
695 | flow-dump from non-dpdk interfaces: | |
696 | flow-dump from pmd on cpu core: 0 | |
697 | recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:2 | |
698 | recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:2 | |
699 | ]) | |
700 | ||
701 | AT_CHECK([ovs-appctl dpctl/del-flow dummy@dp0 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234)'], [0], [dnl | |
702 | ]) | |
703 | ||
704 | AT_CHECK([ovs-appctl dpctl/dump-flows dummy@dp0], [0], [dnl | |
705 | ]) | |
706 | ||
707 | AT_CHECK([ovs-appctl dpctl/del-dp dummy@dp0], [0], [dnl | |
708 | ]) | |
709 | ||
710 | OVS_VSWITCHD_STOP | |
711 | AT_CLEANUP |