fix(hoststack): Do not limit number of RX queues
[csit.git] / resources / libraries / robot / hoststack / hoststack.robot
1 # Copyright (c) 2024 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | resources.libraries.python.InterfaceUtil
16 | Library | resources.libraries.python.IPUtil
17 | Library | resources.libraries.python.HoststackUtil
18 | Library | resources.libraries.python.NginxUtil
19 | Library | resources.libraries.python.NsimUtil
20 | Library | resources.libraries.python.DMAUtil
21 | Library | resources.tools.ab.ABTools
22 | Variables | resources/libraries/python/Constants.py
23 | Resource | resources/libraries/robot/features/dma.robot
24 | Resource | resources/libraries/robot/ip/ip4.robot
25 | Resource | resources/libraries/robot/nsim/nsim.robot
26 | Resource | resources/libraries/robot/nginx/default.robot
27 |
28 | Documentation | *L2 keywords to set up VPP to test hoststack.*
29
30 *** Variables ***
31 | ${quic_crypto_engine}= | nocrypto
32 | ${quic_fifo_size}= | 4M
33 | &{vpp_hoststack_attr}=
34 | ... | rxd=${256}
35 | ... | txd=${256}
36 | ... | phy_cores=${1}
37 | ... | app_api_socket=/run/vpp/app_ns_sockets/default
38 | ... | tcp_cc_algo=cubic
39 | ... | sess_evt_q_length=16384
40 | ... | sess_prealloc_sess=1024
41 | ... | sess_v4_tbl_buckets=20000
42 | ... | sess_v4_tbl_mem=64M
43 | ... | sess_v4_hopen_buckets=20000
44 | ... | sess_v4_hopen_mem=64M
45 | ... | sess_lendpt_buckets=250000
46 | ... | sess_lendpt_mem=512M
47 | &{vpp_echo_server_attr}=
48 | ... | role=server
49 | ... | cpu_cnt=${1}
50 | ... | cfg_vpp_feature=${None}
51 | ... | namespace=default
52 | ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket]
53 | ... | json_output=json
54 | ... | uri_protocol=quic
55 | ... | uri_ip4_addr=${EMPTY}
56 | ... | uri_port=1234
57 | ... | nthreads=1
58 | ... | mq_size=${vpp_hoststack_attr}[sess_evt_q_length]
59 | ... | nclients=1
60 | ... | quic_streams=1
61 | ... | time=sconnect:lastbyte
62 | ... | fifo_size=4M
63 | ... | rx_bytes=0
64 | ... | tx_bytes=0
65 | ... | rx_results_diff=${False}
66 | ... | tx_results_diff=${False}
67 | ... | use_app_socket_api=${True}
68 | &{vpp_echo_client_attr}=
69 | ... | role=client
70 | ... | cpu_cnt=${1}
71 | ... | cfg_vpp_feature=${None}
72 | ... | namespace=default
73 | ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket]
74 | ... | json_output=json
75 | ... | uri_protocol=quic
76 | ... | uri_ip4_addr=${EMPTY}
77 | ... | uri_port=1234
78 | ... | nthreads=1
79 | ... | mq_size=${vpp_hoststack_attr}[sess_evt_q_length]
80 | ... | nclients=1
81 | ... | quic_streams=1
82 | ... | time=sconnect:lastbyte
83 | ... | fifo_size=4M
84 | ... | rx_bytes=0
85 | ... | tx_bytes=0
86 | ... | rx_results_diff=${False}
87 | ... | tx_results_diff=${False}
88 | ... | use_app_socket_api=${True}
89 | &{iperf3_server_attr}=
90 | ... | role=server
91 | ... | cpu_cnt=${1}
92 | ... | cfg_vpp_feature=${Empty}
93 | ... | namespace=default
94 | ... | vcl_config=vcl_iperf3.conf
95 | ... | ld_preload=${True}
96 | ... | transparent_tls=${False}
97 | ... | json=${True}
98 | ... | ip_version=${4}
99 | &{iperf3_client_attr}=
100 | ... | role=client
101 | ... | cpu_cnt=${1}
102 | ... | cfg_vpp_feature=${Empty}
103 | ... | namespace=default
104 | ... | vcl_config=vcl_iperf3.conf
105 | ... | ld_preload=${True}
106 | ... | transparent_tls=${False}
107 | ... | json=${True}
108 | ... | ip_version=${4}
109 | ... | ip_address=${EMPTY}
110 | ... | parallel=${1}
111 | ... | time=${20}
112 | ... | udp=${False}
113 | ... | bandwidth=10000000
114 | ... | length=${0}
115 | &{nginx_server_attr}=
116 | ... | role=server
117 | ... | cpu_cnt=${1}
118 | ... | cfg_vpp_feature=${Empty}
119 | ... | namespace=default
120 | ... | vcl_config=vcl_nginx.conf
121 | ... | ld_preload=${True}
122 | ... | transparent_tls=${False}
123 | ... | json=${True}
124 | ... | ip_version=${4}
125 | &{nginx_server_with_dma_attr}=
126 | ... | role=server
127 | ... | cpu_cnt=${1}
128 | ... | cfg_vpp_feature=${Empty}
129 | ... | namespace=default
130 | ... | vcl_config=vcl_dma.conf
131 | ... | ld_preload=${True}
132 | ... | transparent_tls=${False}
133 | ... | json=${True}
134 | ... | ip_version=${4}
135
136 *** Keywords ***
137 | Set VPP Hoststack Attributes
138 | | [Documentation]
139 | | ... | Set the VPP HostStack attributes in the vpp_hoststack_attr dictionary.
140 | |
141 | | ... | *Arguments:*
142 | | ... | - ${rxd} - Number of Rx Descriptors Type: int
143 | | ... | - ${txd} - Number of Tx Descriptors Type: int
144 | | ... | - ${phy_cores} - Number of cores for workers Type: int
145 | | ... | - ${app_api_socket} - Path to application api socket file Type: string
146 | | ... | - ${tcp_cc_algo} - TCP congestion control algorithm Type: string
147 | | ... | Type: string
148 | | ... | - ${sess_evt_q_length} - Session event queue length Type: string
149 | | ... | - ${sess_prealloc_sess} - Number of sessions to preallocate
150 | | ... | Type: string
151 | | ... | - ${sess_v4_tbl_buckets} - Number of IPv4 session table buckets
152 | | ... | Type: string
153 | | ... | - ${sess_v4_tbl_mem} - IPv4 session table memory size
154 | | ... | Type: string
155 | | ... | - ${sess_v4_hopen_buckets} - Number of IPv4 session
156 | | ... | half open table buckets Type: string
157 | | ... | - ${sess_v4_hopen_mem} - IPv4 session half open
158 | | ... | table memory size Type: string
159 | | ... | - ${sess_lendpt_buckets} - Number of session local endpoint
160 | | ... | table buckets Type: string
161 | | ... | - ${sess_lendpt_mem} - Session local endpoint
162 | | ... | table memory size Type: string
163 | |
164 | | ... | *Example:*
165 | |
166 | | ... | \| Set VPP Hoststack Attributes \| phy_cores=${phy_cores} \|
167 | |
168 | | [Arguments]
169 | | ... | ${rxd}=${vpp_hoststack_attr}[rxd]
170 | | ... | ${txd}=${vpp_hoststack_attr}[txd]
171 | | ... | ${phy_cores}=${vpp_hoststack_attr}[phy_cores]
172 | | ... | ${app_api_socket}=${vpp_hoststack_attr}[app_api_socket]
173 | | ... | ${tcp_cc_algo}=${vpp_hoststack_attr}[tcp_cc_algo]
174 | | ... | ${sess_evt_q_length}=${vpp_hoststack_attr}[sess_evt_q_length]
175 | | ... | ${sess_prealloc_sess}=${vpp_hoststack_attr}[sess_prealloc_sess]
176 | | ... | ${sess_v4_tbl_buckets}=${vpp_hoststack_attr}[sess_v4_tbl_buckets]
177 | | ... | ${sess_v4_tbl_mem}=${vpp_hoststack_attr}[sess_v4_tbl_mem]
178 | | ... | ${sess_v4_hopen_buckets}=${vpp_hoststack_attr}[sess_v4_hopen_buckets]
179 | | ... | ${sess_v4_hopen_mem}=${vpp_hoststack_attr}[sess_v4_hopen_mem]
180 | | ... | ${sess_lendpt_buckets}=${vpp_hoststack_attr}[sess_lendpt_buckets]
181 | | ... | ${sess_lendpt_mem}=${vpp_hoststack_attr}[sess_lendpt_mem]
182 | |
183 | | Set To Dictionary | ${vpp_hoststack_attr} | rxd | ${rxd}
184 | | Set To Dictionary | ${vpp_hoststack_attr} | txd | ${txd}
185 | | Set To Dictionary | ${vpp_hoststack_attr} | phy_cores | ${phy_cores}
186 | | Set To Dictionary | ${vpp_hoststack_attr}
187 | | ... | app_api_socket | ${app_api_socket}
188 | | Set To Dictionary | ${vpp_hoststack_attr}
189 | | ... | tcp_cc_algo | ${tcp_cc_algo}
190 | | Set To Dictionary | ${vpp_hoststack_attr}
191 | | ... | sess_evt_q_length | ${sess_evt_q_length}
192 | | Set To Dictionary | ${vpp_hoststack_attr}
193 | | ... | sess_prealloc_sess | ${sess_prealloc_sess}
194 | | Set To Dictionary | ${vpp_hoststack_attr}
195 | | ... | sess_v4_tbl_buckets | ${sess_v4_tbl_buckets}
196 | | Set To Dictionary | ${vpp_hoststack_attr}
197 | | ... | sess_v4_tbl_mem | ${sess_v4_tbl_mem}
198 | | Set To Dictionary | ${vpp_hoststack_attr}
199 | | ... | sess_v4_hopen_buckets | ${sess_v4_hopen_buckets}
200 | | Set To Dictionary | ${vpp_hoststack_attr}
201 | | ... | sess_v4_hopen_mem | ${sess_v4_hopen_mem}
202 | | Set To Dictionary | ${vpp_hoststack_attr}
203 | | ... | sess_lendpt_buckets | ${sess_lendpt_buckets}
204 | | Set To Dictionary | ${vpp_hoststack_attr}
205 | | ... | sess_lendpt_mem | ${sess_lendpt_mem}
206
207 | Set VPP Echo Server Attributes
208 | | [Documentation]
209 | | ... | Set the HostStack vpp_echo test program attributes
210 | | ... | in the vpp_echo_server_attr dictionary.
211 | |
212 | | ... | *Arguments:*
213 | | ... | - ${cfg_vpp_feature} - VPP Feature requiring config Type: string
214 | | ... | - ${namespace} - Namespace Type: string
215 | | ... | - ${nthreads} - Number of threads Type: string
216 | | ... | - ${mq_size} - Number of threads Type: string
217 | | ... | - ${nclients} - Number of clients Type: string
218 | | ... | - ${quic_streams} - Number of quic streams Type: string
219 | | ... | - ${fifo_size} - Session Fifo Size Type: integer
220 | | ... | - ${time} - Timing events (start:end) Type: string
221 | | ... | - ${rx_bytes} - Number of Bytes to receive Type: string
222 | | ... | - ${tx_bytes} - Number of Bytes to send Type: string
223 | | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
224 | | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
225 | | ... | - ${use_app_socket_api} - Use app socket API instead of VPP API
226 | |
227 | | ... | *Example:*
228 | |
229 | | ... | \| Set VPP Echo Server Attributes \| nclients=${nclients} \|
230 | | ... | \| tx_bytes=${tx_bytes} \|
231 | |
232 | | [Arguments]
233 | | ... | ${cfg_vpp_feature}=${vpp_echo_server_attr}[cfg_vpp_feature]
234 | | ... | ${namespace}=${vpp_echo_server_attr}[namespace]
235 | | ... | ${nthreads}=${vpp_echo_server_attr}[nthreads]
236 | | ... | ${mq_size}=${vpp_echo_server_attr}[mq_size]
237 | | ... | ${nclients}=${vpp_echo_server_attr}[nclients]
238 | | ... | ${quic_streams}=${vpp_echo_server_attr}[quic_streams]
239 | | ... | ${time}=${vpp_echo_server_attr}[time]
240 | | ... | ${fifo_size}=${vpp_echo_server_attr}[fifo_size]
241 | | ... | ${rx_bytes}=${vpp_echo_server_attr}[rx_bytes]
242 | | ... | ${tx_bytes}=${vpp_echo_server_attr}[tx_bytes]
243 | | ... | ${rx_results_diff}=${vpp_echo_server_attr}[rx_results_diff]
244 | | ... | ${tx_results_diff}=${vpp_echo_server_attr}[tx_results_diff]
245 | | ... | ${use_app_socket_api}=${vpp_echo_server_attr}[use_app_socket_api]
246 | |
247 | | Set To Dictionary | ${vpp_echo_server_attr} | cfg_vpp_feature
248 | | ... | ${cfg_vpp_feature}
249 | | Set To Dictionary | ${vpp_echo_server_attr} | namespace | ${namespace}
250 | | Set To Dictionary | ${vpp_echo_server_attr} | nthreads | ${nthreads}
251 | | Set To Dictionary | ${vpp_echo_server_attr} | mq_size | ${mq_size}
252 | | Set To Dictionary | ${vpp_echo_server_attr} | nclients | ${nclients}
253 | | Set To Dictionary | ${vpp_echo_server_attr} | quic_streams | ${quic_streams}
254 | | Set To Dictionary | ${vpp_echo_server_attr} | time | ${time}
255 | | Set To Dictionary | ${vpp_echo_server_attr} | fifo_size | ${fifo_size}
256 | | Set To Dictionary | ${vpp_echo_server_attr} | rx_bytes | ${rx_bytes}
257 | | Set To Dictionary | ${vpp_echo_server_attr} | tx_bytes | ${tx_bytes}
258 | | Set To Dictionary
259 | | ... | ${vpp_echo_server_attr} | rx_results_diff | ${rx_results_diff}
260 | | Set To Dictionary
261 | | ... | ${vpp_echo_server_attr} | tx_results_diff | ${tx_results_diff}
262 | | Set To Dictionary
263 | | ... | ${vpp_echo_server_attr} | use_app_socket_api | ${use_app_socket_api}
264
265 | Set VPP Echo Client Attributes
266 | | [Documentation]
267 | | ... | Set the HostStack vpp_echo test program attributes
268 | | ... | in the vpp_echo_client_attr dictionary.
269 | |
270 | | ... | *Arguments:*
271 | | ... | - ${cfg_vpp_feature} - VPP Feature requiring config Type: string
272 | | ... | - ${namespace} - Namespace Type: string
273 | | ... | - ${nthreads} - Number of threads Type: string
274 | | ... | - ${mq_size} - Number of threads Type: string
275 | | ... | - ${nclients} - Number of clients Type: string
276 | | ... | - ${quic_streams} - Number of quic streams Type: string
277 | | ... | - ${fifo_size} - Session Fifo Size Type: integer
278 | | ... | - ${time} - Timing events (start:end) Type: string
279 | | ... | - ${rx_bytes} - Number of Bytes to receive Type: string
280 | | ... | - ${tx_bytes} - Number of Bytes to send Type: string
281 | | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
282 | | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
283 | | ... | - ${use_app_socket_api} - Use app socket API instead of VPP API
284 | |
285 | | ... | *Example:*
286 | |
287 | | ... | \| Set VPP Echo Client Attributes \| nclients=${nclients} \|
288 | | ... | \| tx_bytes=${tx_bytes} \|
289 | |
290 | | [Arguments]
291 | | ... | ${cfg_vpp_feature}=${vpp_echo_client_attr}[cfg_vpp_feature]
292 | | ... | ${namespace}=${vpp_echo_client_attr}[namespace]
293 | | ... | ${nthreads}=${vpp_echo_client_attr}[nthreads]
294 | | ... | ${mq_size}=${vpp_echo_client_attr}[mq_size]
295 | | ... | ${nclients}=${vpp_echo_client_attr}[nclients]
296 | | ... | ${quic_streams}=${vpp_echo_client_attr}[quic_streams]
297 | | ... | ${time}=${vpp_echo_client_attr}[time]
298 | | ... | ${fifo_size}=${vpp_echo_client_attr}[fifo_size]
299 | | ... | ${rx_bytes}=${vpp_echo_client_attr}[rx_bytes]
300 | | ... | ${tx_bytes}=${vpp_echo_client_attr}[tx_bytes]
301 | | ... | ${rx_results_diff}=${vpp_echo_client_attr}[rx_results_diff]
302 | | ... | ${tx_results_diff}=${vpp_echo_client_attr}[tx_results_diff]
303 | | ... | ${use_app_socket_api}=${vpp_echo_client_attr}[use_app_socket_api]
304 | |
305 | | Set To Dictionary | ${vpp_echo_client_attr} | cfg_vpp_feature
306 | | ... | ${cfg_vpp_feature}
307 | | Set To Dictionary | ${vpp_echo_client_attr} | namespace | ${namespace}
308 | | Set To Dictionary | ${vpp_echo_client_attr} | nthreads | ${nthreads}
309 | | Set To Dictionary | ${vpp_echo_client_attr} | mq_size | ${mq_size}
310 | | Set To Dictionary | ${vpp_echo_client_attr} | nclients | ${nclients}
311 | | Set To Dictionary | ${vpp_echo_client_attr} | quic_streams | ${quic_streams}
312 | | Set To Dictionary | ${vpp_echo_client_attr} | time | ${time}
313 | | Set To Dictionary | ${vpp_echo_client_attr} | fifo_size | ${fifo_size}
314 | | Set To Dictionary | ${vpp_echo_client_attr} | rx_bytes | ${rx_bytes}
315 | | Set To Dictionary | ${vpp_echo_client_attr} | tx_bytes | ${tx_bytes}
316 | | Set To Dictionary
317 | | ... | ${vpp_echo_client_attr} | rx_results_diff | ${rx_results_diff}
318 | | Set To Dictionary
319 | | ... | ${vpp_echo_client_attr} | tx_results_diff | ${tx_results_diff}
320 | | Set To Dictionary
321 | | ... | ${vpp_echo_client_attr} | use_app_socket_api | ${use_app_socket_api}
322
323 | Set Iperf3 Server Attributes
324 | | [Documentation]
325 | | ... | Set the HostStack iperf3 test program attributes
326 | | ... | in the iperf3_server_attr dictionary.
327 | |
328 | | ... | *Arguments:*
329 | | ... | - ${vcl_config} - VCL configuration file name Type: string
330 | | ... | - ${ld_preload} - Use the VCL LD_PRELOAD library Type: boolean
331 | | ... | - ${transparent_tls} - Use VCL Transparent-TLS mode Type: boolean
332 | | ... | - ${ip_version} - IP version (4 or 6) Type: int
333 | |
334 | | ... | *Example:*
335 | |
336 | | ... | \| Set Iperf3 Server Attributes \| vcl_config=${vcl_config} \|
337 | | ... | \| ip_version=${ip_version} \|
338 | |
339 | | [Arguments]
340 | | ... | ${vcl_config}=${iperf3_server_attr}[vcl_config]
341 | | ... | ${ld_preload}=${iperf3_server_attr}[ld_preload]
342 | | ... | ${transparent_tls}=${iperf3_server_attr}[transparent_tls]
343 | | ... | ${ip_version}=${iperf3_server_attr}[ip_version]
344 | |
345 | | Set To Dictionary | ${iperf3_server_attr} | vcl_config | ${vcl_config}
346 | | Set To Dictionary | ${iperf3_server_attr} | ld_preload | ${ld_preload}
347 | | Set To Dictionary | ${iperf3_server_attr} | transparent_tls
348 | | ... | ${transparent_tls}
349 | | Set To Dictionary | ${iperf3_server_attr} | ip_version | ${ip_version}
350
351 | Set Iperf3 Client Attributes
352 | | [Documentation]
353 | | ... | Set the HostStack iperf3 test program attributes
354 | | ... | in the iperf3_client_attr dictionary.
355 | |
356 | | ... | *Arguments:*
357 | | ... | - ${vcl_config} - VCL configuration file name Type: string
358 | | ... | - ${ld_preload} - Use the VCL LD_PRELOAD library Type: boolean
359 | | ... | - ${transparent_tls} - Use VCL Transparent-TLS mode Type: boolean
360 | | ... | - ${ip_version} - IP version (4 or 6) Type: int
361 | | ... | - ${parallel} - Number of parallel streams Type: int
362 | | ... | - ${bandwidth} - Target bandwidth in bits/sec Type: int
363 | | ... | - ${udp} - UDP or TCP protocol Type: boolean
364 | | ... | - ${length} - Packet Length Type: int
365 | |
366 | | ... | *Example:*
367 | |
368 | | ... | \| Set Iperf3 Client Attributes \| vcl_config=${vcl_config} \|
369 | | ... | \| ip_version=${ip_version} \| parallel=${streams} \|
370 | | ... | \| bandwidth=${bandwidth} | udp=${True} \|
371 | |
372 | | [Arguments]
373 | | ... | ${vcl_config}=${iperf3_client_attr}[vcl_config]
374 | | ... | ${ld_preload}=${iperf3_client_attr}[ld_preload]
375 | | ... | ${transparent_tls}=${iperf3_client_attr}[transparent_tls]
376 | | ... | ${ip_version}=${iperf3_client_attr}[ip_version]
377 | | ... | ${parallel}=${iperf3_client_attr}[parallel]
378 | | ... | ${bandwidth}=${iperf3_client_attr}[bandwidth]
379 | | ... | ${udp}=${iperf3_client_attr}[udp]
380 | | ... | ${length}=${iperf3_client_attr}[length]
381 | |
382 | | Set To Dictionary | ${iperf3_client_attr} | vcl_config | ${vcl_config}
383 | | Set To Dictionary | ${iperf3_client_attr} | ld_preload | ${ld_preload}
384 | | Set To Dictionary | ${iperf3_client_attr} | transparent_tls
385 | | ... | ${transparent_tls}
386 | | Set To Dictionary | ${iperf3_client_attr} | ip_version | ${ip_version}
387 | | Set To Dictionary | ${iperf3_client_attr} | parallel | ${parallel}
388 | | Set To Dictionary | ${iperf3_client_attr} | bandwidth | ${bandwidth}
389 | | Set To Dictionary | ${iperf3_client_attr} | udp | ${udp}
390 | | Set To Dictionary | ${iperf3_client_attr} | length | ${length}
391
392 | Run hoststack test program on DUT
393 | | [Documentation]
394 | | ... | Configure IP address on the port, set it up and start the specified
395 | | ... | HostStack test program on the specified DUT.
396 | |
397 | | ... | *Arguments:*
398 | | ... | - ${node} - VPP DUT node Type: Node
399 | | ... | - ${intf} - VPP DUT node interface key Type: string
400 | | ... | - ${ip4_addr} - VPP DUT node interface ip4 address Type: string
401 | | ... | - ${ip4_mask} - VPP DUT node interface ip4 network mask Type: string
402 | | ... | - ${namespace} - Network namespace to run test program in Type: string
403 | | ... | - ${cfg_vpp_feature} - VPP hoststack feature requiring
404 | | ... | additional VPP configuration Type: string
405 | | ... | - ${core_list} - Cpu core affinity list Type: string
406 | | ... | - ${test_program} - Host Stack test program Type: dict
407 | |
408 | | ... | *Example:*
409 | |
410 | | ... | \| Run hoststack test program on DUT \| ${dut1} \| ${dut1_if1} \|
411 | | ... | \| ${dut1_if1_ip4_addr} \| ${dut1_if1_ip4_mask} \| default \|
412 | | ... | \| quic \| ${vpp_echo_server} \|
413 | |
414 | | [Arguments] | ${node} | ${intf} | ${ip4_addr} | ${ip4_mask}
415 | | | ... | ${namespace} | ${core_list} | ${cfg_vpp_feature}
416 | | | ... | ${test_program}
417 | |
418 | | ${is_dut1}= | Run Keyword And Return Status
419 | | ... | Dictionaries should be equal | ${node} | ${dut1}
420 | | Run Keyword If
421 | | ... | ${is_dut1} and ${vpp_nsim_attr}[output_nsim_enable]
422 | | ... | Configure VPP NSIM | ${node} | ${vpp_nsim_attr} | ${intf}
423 | | Run Keyword If | '${cfg_vpp_feature}' != ''
424 | | ... | Additional VPP Config for Feature ${cfg_vpp_feature} | ${node}
425 | | VPP Get Interface Data | ${node}
426 | | Set Interface State | ${node} | ${intf} | up
427 | | VPP Interface Set IP Address | ${node} | ${intf} | ${ip4_addr}
428 | | ... | ${ip4_mask}
429 | | Vpp Node Interfaces Ready Wait | ${node}
430 | | ${hoststack_test_program_pid}= | Start Hoststack Test Program
431 | | ... | ${node} | ${namespace} | ${core_list} | ${test_program}
432 | | Return From Keyword | ${hoststack_test_program_pid}
433
434 | Additional VPP Config For Feature quic
435 | | [Documentation]
436 | | ... | Configure VPP quic attributes on the specified DUT.
437 | |
438 | | ... | *Arguments:*
439 | | ... | - ${node} - VPP DUT node Type: Node
440 | |
441 | | [Arguments] | ${node}
442 | |
443 | | Set hoststack quic fifo size | ${node} | ${quic_fifo_size}
444 | | Set hoststack quic crypto engine | ${node} | ${quic_crypto_engine}
445
446 | Configure VPP Hoststack Attributes on all DUTs
447 | | [Documentation]
448 | | ... | Configure VPP HostStack attributes on all DUTs.
449 | |
450 | | Set Max Rate And Jumbo
451 | | Add worker threads to all DUTs
452 | | ... | ${vpp_hoststack_attr}[phy_cores]
453 | | ... | rxd=${vpp_hoststack_attr}[rxd] | txd=${vpp_hoststack_attr}[txd]
454 | | Pre-initialize layer driver | ${nic_driver}
455 | | FOR | ${dut} | IN | @{duts}
456 | | | Import Library | resources.libraries.python.VppConfigGenerator
457 | | | ... | WITH NAME | ${dut}
458 | | | Run Keyword If
459 | | | ... | '${dut}' == 'DUT1' and ${vpp_nsim_attr}[output_nsim_enable]
460 | | | ... | ${dut}.Add Nsim poll main thread
461 | | | Run keyword | ${dut}.Add api segment gid | testuser
462 | | | Run keyword | ${dut}.Add tcp congestion control algorithm
463 | | | ... | ${vpp_hoststack_attr}[tcp_cc_algo]
464 | | | Run keyword | ${dut}.Add session enable
465 | | | Run keyword | ${dut}.Add session app socket api
466 | | | Run keyword | ${dut}.Add session event queue length
467 | | | ... | ${vpp_hoststack_attr}[sess_evt_q_length]
468 | | | Run keyword | ${dut}.Add session preallocated sessions
469 | | | ... | ${vpp_hoststack_attr}[sess_prealloc_sess]
470 | | | Run keyword | ${dut}.Add session v4 session table buckets
471 | | | ... | ${vpp_hoststack_attr}[sess_v4_tbl_buckets]
472 | | | Run keyword | ${dut}.Add session v4 session table memory
473 | | | ... | ${vpp_hoststack_attr}[sess_v4_tbl_mem]
474 | | | Run keyword | ${dut}.Add session v4 halfopen table buckets
475 | | | ... | ${vpp_hoststack_attr}[sess_v4_hopen_buckets]
476 | | | Run keyword | ${dut}.Add session v4 halfopen table memory
477 | | | ... | ${vpp_hoststack_attr}[sess_v4_hopen_mem]
478 | | | Run keyword | ${dut}.Add session local endpoints table buckets
479 | | | ... | ${vpp_hoststack_attr}[sess_lendpt_buckets]
480 | | | Run keyword | ${dut}.Add session local endpoints table memory
481 | | | ... | ${vpp_hoststack_attr}[sess_lendpt_mem]
482 | | END
483 | | Apply startup configuration on all VPP DUTs
484
485 | Get Test Results From Hoststack VPP Echo Test
486 | | [Documentation]
487 | | ... | Configure IP address on the port, set it up and start the specified
488 | | ... | HostStack test programs on the DUTs. Gather test program
489 | | ... | output and append JSON formatted test data in message.
490 | | ... | Return boolean indicating there was a defered failure of either the
491 | | ... | server and/or client test programs.
492 | |
493 | | Set To Dictionary | ${vpp_echo_server_attr} | uri_ip4_addr
494 | | ... | ${dut2_if1_ip4_addr}
495 | | Set To Dictionary | ${vpp_echo_client_attr} | uri_ip4_addr
496 | | ... | ${dut2_if1_ip4_addr}
497 | | Configure VPP Hoststack Attributes on all DUTs
498 | | ${vpp_echo_server}= | Get VPP Echo Command | ${vpp_echo_server_attr}
499 | | ${skip_cnt}= | Evaluate
500 | | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
501 | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
502 | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
503 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_server_attr}[cpu_cnt]
504 | | FOR | ${action} | IN | @{stat_pre_trial}
505 | | | Run Keyword | Additional Statistics Action For ${action}
506 | | END
507 | | ${server_pid}= | Run hoststack test program on DUT
508 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
509 | | ... | ${vpp_echo_server_attr}[namespace] | ${core_list}
510 | | ... | ${vpp_echo_server_attr}[cfg_vpp_feature] | ${vpp_echo_server}
511 | | ${vpp_echo_client}= | Get VPP Echo Command | ${vpp_echo_client_attr}
512 | | ${numa}= | Get interfaces numa node | ${dut1} | ${dut1_if1}
513 | | ${core_list}= | Cpu list per node str | ${dut1} | ${numa}
514 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_client_attr}[cpu_cnt]
515 | | ${client_pid}= | Run hoststack test program on DUT
516 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip4_addr} | ${dut1_if1_ip4_prefix}
517 | | ... | ${vpp_echo_client_attr}[namespace] | ${core_list}
518 | | ... | ${vpp_echo_client_attr}[cfg_vpp_feature] | ${vpp_echo_client}
519 | | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
520 | | ... | ${vpp_echo_client} | ${dut2} | ${vpp_echo_server}
521 | | ${client_defer_fail} | ${client_output}=
522 | | ... | Analyze hoststack test program output | ${dut1} | Client
523 | | ... | ${vpp_nsim_attr} | ${vpp_echo_client}
524 | | Then Set test message | ${client_output}
525 | | And Hoststack Test Program Finished | ${dut2} | ${server_pid}
526 | | ... | ${vpp_echo_server} | ${dut1} | ${vpp_echo_client}
527 | | ${server_defer_fail} | ${server_output}=
528 | | ... | Analyze hoststack test program output | ${dut2} | Server
529 | | ... | ${vpp_nsim_attr} | ${vpp_echo_server}
530 | | FOR | ${action} | IN | @{stat_post_trial}
531 | | | Run Keyword | Additional Statistics Action For ${action}
532 | | END
533 | | Set test message | ${server_output} | append=True
534 | | Run Keyword And Return | Hoststack Test Program Defer Fail
535 | | ... | ${server_defer_fail} | ${client_defer_fail}
536
537 | Get Test Results From Hoststack Iperf3 Test
538 | | [Documentation]
539 | | ... | Configure IP address on the port, set it up and start the specified
540 | | ... | HostStack test programs on the DUTs. Gather test program
541 | | ... | output and append JSON formatted test data in message.
542 | | ... | Return boolean indicating there was a defered failure of either the
543 | | ... | server and/or client test programs.
544 | |
545 | | Set To Dictionary | ${iperf3_client_attr} | ip_address
546 | | ... | ${dut2_if1_ip4_addr}
547 | | Configure VPP Hoststack Attributes on all DUTs
548 | | ${iperf3_server}= | Get Iperf3 Command | ${iperf3_server_attr}
549 | | ${skip_cnt}= | Evaluate
550 | | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
551 | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
552 | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
553 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_server_attr}[cpu_cnt]
554 | | FOR | ${action} | IN | @{stat_pre_trial}
555 | | | Run Keyword | Additional Statistics Action For ${action}
556 | | END
557 | | ${server_pid}= | Run hoststack test program on DUT
558 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
559 | | ... | ${iperf3_server_attr}[namespace] | ${core_list}
560 | | ... | ${iperf3_server_attr}[cfg_vpp_feature] | ${iperf3_server}
561 | | ${iperf3_client}= | Get Iperf3 Command | ${iperf3_client_attr}
562 | | ${numa}= | Get interfaces numa node | ${dut1} | ${dut1_if1}
563 | | ${core_list}= | Cpu list per node str | ${dut1} | ${numa}
564 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_client_attr}[cpu_cnt]
565 | | ${client_pid}= | Run hoststack test program on DUT
566 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip4_addr} | ${dut1_if1_ip4_prefix}
567 | | ... | ${iperf3_client_attr}[namespace] | ${core_list}
568 | | ... | ${iperf3_client_attr}[cfg_vpp_feature] | ${iperf3_client}
569 | | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
570 | | ... | ${iperf3_client} | ${dut2} | ${iperf3_server}
571 | | FOR | ${action} | IN | @{stat_post_trial}
572 | | | Run Keyword | Additional Statistics Action For ${action}
573 | | END
574 | | ${client_defer_fail} | ${client_output}=
575 | | ... | Analyze hoststack test program output | ${dut1} | Client
576 | | ... | ${vpp_nsim_attr} | ${iperf3_client}
577 | | Then Set test message | ${client_output}
578 | | Return From Keyword | ${client_defer_fail}
579
580 | Set up LDP or VCL Nginx on DUT1 node
581 | | [Documentation]
582 | | ... | Setup for suites which uses VCL or LDP Nginx on DUT1.
583 | |
584 | | ... | Currently hardcoded to work on DUT1, assuming its node dict
585 | | ... | and similar values like \${DUT1_cpu_alloc_str} are already defined.
586 | |
587 | | ... | *Arguments:*
588 | | ... | - mode - VCL Nginx or LDP Nginx. Type: string
589 | | ... | - rps_cps - Test rps or cps. Type: string
590 | | ... | - core_num - Nginx work processes number. Type: int
591 | | ... | - qat - Whether to use the qat engine. Type: string
592 | | ... | - tls_tcp - TLS or TCP. Type: string
593 | | ... | - use_dma - Whether to use DMA, Default: False. Type: bool
594 | |
595 | | ... | *Example:*
596 | |
597 | | ... | \| Set up LDP or VCL NGINX on DUT1 node \| ${mode}\
598 | | ... | \| ${rps_cps} \| ${phy_cores} \| ${qat} \| ${tls_tcp} \|
599 | |
600 | | [Arguments] | ${mode} | ${rps_cps} | ${phy_cores} | ${qat} | ${tls_tcp}
601 | | | ... | ${use_dma}=${False}
602 | |
603 | | Set Interface State | ${DUT1} | ${DUT1_${int}1}[0] | up
604 | | VPP Interface Set IP Address | ${DUT1} | ${DUT1_${int}1}[0]
605 | | ... | ${dut_ip_addrs}[0] | ${dut_ip_prefix}
606 | | Vpp Node Interfaces Ready Wait | ${DUT1}
607 | | ${skip_cnt}= | Evaluate
608 | | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
609 | | ${numa}= | Get interfaces numa node | ${DUT1} | ${DUT1_${int}1}[0]
610 | | Apply Nginx configuration on DUT | ${DUT1} | ${phy_cores}
611 | | ${attr}= | Run Keyword If | ${use_dma} == ${True}
612 | | ... | Set Variable | ${nginx_server_with_dma_attr}
613 | | ... | ELSE | Set Variable | ${nginx_server_attr}
614 | | Set To Dictionary | ${attr} | ip_address
615 | | ... | ${dut_ip_addrs}[0]
616 | | ${core_list}= | Cpu list per node str | ${DUT1} | ${numa}
617 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${attr}[cpu_cnt]
618 | | ... | smt_used=${smt_used}
619 | | ${cpu_idle}= | Cpu List per node | ${DUT1} | ${numa}
620 | | ${cpu_idle_list}= | Get Slice From List | ${cpu_idle}
621 | | ... | ${${skip_cnt} + ${attr}[cpu_cnt]}
622 | | ${nginx_server}= | Get Nginx Command | ${attr}
623 | | ... | ${nginx_version} | ${packages_dir}
624 | | Start Hoststack Test Program
625 | | ... | ${DUT1} | ${attr}[namespace] | ${core_list}
626 | | ... | ${nginx_server}
627 | | Get Hoststack Test Program Logs | ${DUT1} | ${nginx_server}
628 | | Taskset Nginx PID to idle cores | ${DUT1} | ${cpu_idle_list}
629
630 | Measure TLS requests or connections per second
631 | | [Documentation]
632 | | ... | Measure number of requests or connections per second using ab.
633 | |
634 | | ... | *Arguments:*
635 | | ... | - ${ciphers} - Specify SSL/TLS cipher suite
636 | | ... | - ${files} - Filename to be requested from the servers
637 | | ... | - ${tls_tcp} - Test TLS or TCP.
638 | | ... | - ${mode} - VCL Nginx or LDP Nginx.
639 | |
640 | | ... | *Example:*
641 | |
642 | | ... | \| Measure TLS requests or connections per second
643 | | ... | \| AES128-SHA \| 64 \| tls \| rps \|
644 | |
645 | | [Arguments] | ${ciphers} | ${files} | ${tls_tcp} | ${mode}
646 | |
647 | | ${dut_ip_addrs_str} | Evaluate | ','.join(${dut_ip_addrs})
648 | | ${ad_ip_addrs_str} | Evaluate | ','.join(${ab_ip_addrs})
649 | | FOR | ${action} | IN | @{stat_pre_trial}
650 | | | Run Keyword | Additional Statistics Action For ${action}
651 | | END
652 | | ${output}= | Run ab | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
653 | | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total}
654 | | ... | ${listen_port}
655 | | FOR | ${action} | IN | @{stat_post_trial}
656 | | | Run Keyword | Additional Statistics Action For ${action}
657 | | END
658 | | Set test message | ${output}
659
660 | Configure VPP startup configuration for NGINX
661 | | [Documentation]
662 | | ... | COnfigure VPP startup configuration for NGINX related tests
663 | |
664 | | [Arguments] | ${sess_prealloc_sess} | ${sess_evt_q_length}
665 | | ... | ${v4_sess_tbl_buckets} | ${v4_sess_tbl_mem} | ${local_endpts_tbl_buckets}
666 | | ... | ${local_endpts_tbl_mem} | ${tcp_prealloc_conns} | ${tcp_prealloc_ho_conns}
667 | |
668 | | FOR | ${dut} | IN | @{duts}
669 | | | Import Library | resources.libraries.python.VppConfigGenerator
670 | | | ... | WITH NAME | ${dut}
671 | | | Run keyword | ${dut}.Add session enable
672 | | | Run keyword | ${dut}.Add session app socket api
673 | | | Run keyword | ${dut}.Add session preallocated sessions
674 | | | ... | ${sess_prealloc_sess}
675 | | | Run keyword | ${dut}.Add session event queue length
676 | | | ... | ${sess_evt_q_length}
677 | | | Run keyword | ${dut}.Add session v4 session table buckets
678 | | | ... | ${v4_sess_tbl_buckets}
679 | | | Run keyword | ${dut}.Add session v4 session table memory
680 | | | ... | ${v4_sess_tbl_mem}
681 | | | Run keyword | ${dut}.Add session local endpoints table buckets
682 | | | ... | ${local_endpts_tbl_buckets}
683 | | | Run keyword | ${dut}.Add session local endpoints table memory
684 | | | ... | ${local_endpts_tbl_mem}
685 | | | Run keyword | ${dut}.Add tcp preallocated connections
686 | | | ... | ${tcp_prealloc_conns}
687 | | | Run keyword | ${dut}.Add tcp preallocated half open connections
688 | | | ... | ${tcp_prealloc_ho_conns}
689 | | END
690
691 | Add Additional Startup Configuration For DMA On All DUTs
692 | | [Documentation]
693 | | ... | Add additional startup configuration for DMA on all DUTs
694 | |
695 | | [Arguments] | ${use_dma}=${True}
696 | |
697 | | FOR | ${dut} | IN | @{duts}
698 | | | Import Library | resources.libraries.python.VppConfigGenerator
699 | | | ... | WITH NAME | ${dut}
700 | | | Run keyword | ${dut}.Add Session Event Queues Memfd Segment
701 | | | Run keyword | ${dut}.Add TCP Congestion Control Algorithm
702 | | | Run keyword | ${dut}.Add TCP Tso
703 | | | Run keyword | ${dut}.Add Session Enable
704 | | | Run keyword If | ${use_dma} == ${True}
705 | | | ... | ${dut}.Add Session Use Dma
706 | | | Run keyword If | ${use_dma} == ${True}
707 | | | ... | Enable DMA WQs on all DUTs
708 | | | Run keyword If | ${use_dma} == ${True}
709 | | | ... | ${dut}.Add DMA Dev | ${${dut}_dma_wqs}
710 | | | Run keyword If | '${nic_driver}' == 'vfio-pci'
711 | | | ... | ${dut}.Add DPDK Dev Default Tso
712 | | | Run keyword If | '${nic_driver}' == 'vfio-pci'
713 | | | ... | ${dut}.Add DPDK Enable Tcp Udp Checksum
714 | | END