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