aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot/hoststack/hoststack.robot
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/robot/hoststack/hoststack.robot')
-rw-r--r--resources/libraries/robot/hoststack/hoststack.robot224
1 files changed, 192 insertions, 32 deletions
diff --git a/resources/libraries/robot/hoststack/hoststack.robot b/resources/libraries/robot/hoststack/hoststack.robot
index 075cc2b8bf..20c071dc2d 100644
--- a/resources/libraries/robot/hoststack/hoststack.robot
+++ b/resources/libraries/robot/hoststack/hoststack.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -15,12 +15,17 @@
| Library | resources.libraries.python.InterfaceUtil
| Library | resources.libraries.python.IPUtil
| Library | resources.libraries.python.HoststackUtil
+| Library | resources.libraries.python.NginxUtil
| Library | resources.libraries.python.NsimUtil
+| Library | resources.libraries.python.DMAUtil
+| Library | resources.tools.ab.ABTools
| Variables | resources/libraries/python/Constants.py
+| Resource | resources/libraries/robot/features/dma.robot
| Resource | resources/libraries/robot/ip/ip4.robot
| Resource | resources/libraries/robot/nsim/nsim.robot
+| Resource | resources/libraries/robot/nginx/default.robot
|
-| Documentation | L2 keywords to set up VPP to test hoststack.
+| Documentation | *L2 keywords to set up VPP to test hoststack.*
*** Variables ***
| ${quic_crypto_engine}= | nocrypto
@@ -30,11 +35,8 @@
| ... | rxd=${256}
| ... | txd=${256}
| ... | phy_cores=${1}
-| ... | vpp_api_socket=${SOCKSVR_PATH}
-| ... | api_seg_global_size=2G
-| ... | api_seg_api_size=1G
+| ... | app_api_socket=/run/vpp/app_ns_sockets/default
| ... | tcp_cc_algo=cubic
-| ... | sess_evt_q_seg_size=64M
| ... | sess_evt_q_length=16384
| ... | sess_prealloc_sess=1024
| ... | sess_v4_tbl_buckets=20000
@@ -48,7 +50,7 @@
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${None}
| ... | namespace=default
-| ... | vpp_api_socket=${vpp_hoststack_attr}[vpp_api_socket]
+| ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket]
| ... | json_output=json
| ... | uri_protocol=quic
| ... | uri_ip4_addr=${EMPTY}
@@ -63,12 +65,13 @@
| ... | tx_bytes=0
| ... | rx_results_diff=${False}
| ... | tx_results_diff=${False}
+| ... | use_app_socket_api=${True}
| &{vpp_echo_client_attr}=
| ... | role=client
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${None}
| ... | namespace=default
-| ... | vpp_api_socket=${vpp_hoststack_attr}[vpp_api_socket]
+| ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket]
| ... | json_output=json
| ... | uri_protocol=quic
| ... | uri_ip4_addr=${EMPTY}
@@ -83,6 +86,7 @@
| ... | tx_bytes=0
| ... | rx_results_diff=${False}
| ... | tx_results_diff=${False}
+| ... | use_app_socket_api=${True}
| &{iperf3_server_attr}=
| ... | role=server
| ... | cpu_cnt=${1}
@@ -106,6 +110,29 @@
| ... | ip_address=${EMPTY}
| ... | parallel=${1}
| ... | time=${20}
+| ... | udp=${False}
+| ... | bandwidth=10000000
+| ... | length=${0}
+| &{nginx_server_attr}=
+| ... | role=server
+| ... | cpu_cnt=${1}
+| ... | cfg_vpp_feature=${Empty}
+| ... | namespace=default
+| ... | vcl_config=vcl_nginx.conf
+| ... | ld_preload=${True}
+| ... | transparent_tls=${False}
+| ... | json=${True}
+| ... | ip_version=${4}
+| &{nginx_server_with_dma_attr}=
+| ... | role=server
+| ... | cpu_cnt=${1}
+| ... | cfg_vpp_feature=${Empty}
+| ... | namespace=default
+| ... | vcl_config=vcl_dma.conf
+| ... | ld_preload=${True}
+| ... | transparent_tls=${False}
+| ... | json=${True}
+| ... | ip_version=${4}
*** Keywords ***
| Set VPP Hoststack Attributes
@@ -117,11 +144,8 @@
| | ... | - ${rxd} - Number of Rx Descriptors Type: int
| | ... | - ${txd} - Number of Tx Descriptors Type: int
| | ... | - ${phy_cores} - Number of cores for workers Type: int
-| | ... | - ${vpp_api_socket} - Path to VPP api socket file Type: string
-| | ... | - ${api_seg_global_size} - Global API segment size Type: string
-| | ... | - ${api_seg_api_size} - API segment API fifo size Type: string
+| | ... | - ${app_api_socket} - Path to application api socket file Type: string
| | ... | - ${tcp_cc_algo} - TCP congestion control algorithm Type: string
-| | ... | - ${sess_evt_q_seg_size} - Session event queue segment size
| | ... | Type: string
| | ... | - ${sess_evt_q_length} - Session event queue length Type: string
| | ... | - ${sess_prealloc_sess} - Number of sessions to preallocate
@@ -148,11 +172,8 @@
| | ... | ${rxd}=${vpp_hoststack_attr}[rxd]
| | ... | ${txd}=${vpp_hoststack_attr}[txd]
| | ... | ${phy_cores}=${vpp_hoststack_attr}[phy_cores]
-| | ... | ${vpp_api_socket}=${vpp_hoststack_attr}[vpp_api_socket]
-| | ... | ${api_seg_global_size}=${vpp_hoststack_attr}[api_seg_global_size]
-| | ... | ${api_seg_api_size}=${vpp_hoststack_attr}[api_seg_api_size]
+| | ... | ${app_api_socket}=${vpp_hoststack_attr}[app_api_socket]
| | ... | ${tcp_cc_algo}=${vpp_hoststack_attr}[tcp_cc_algo]
-| | ... | ${sess_evt_q_seg_size}=${vpp_hoststack_attr}[sess_evt_q_seg_size]
| | ... | ${sess_evt_q_length}=${vpp_hoststack_attr}[sess_evt_q_length]
| | ... | ${sess_prealloc_sess}=${vpp_hoststack_attr}[sess_prealloc_sess]
| | ... | ${sess_v4_tbl_buckets}=${vpp_hoststack_attr}[sess_v4_tbl_buckets]
@@ -167,16 +188,10 @@
| | Set To Dictionary | ${vpp_hoststack_attr} | txd | ${txd}
| | Set To Dictionary | ${vpp_hoststack_attr} | phy_cores | ${phy_cores}
| | Set To Dictionary | ${vpp_hoststack_attr}
-| | ... | vpp_api_socket | ${vpp_api_socket}
-| | Set To Dictionary | ${vpp_hoststack_attr}
-| | ... | api_seg_global_size | ${api_seg_global_size}
-| | Set To Dictionary | ${vpp_hoststack_attr}
-| | ... | api_seg_api_size | ${api_seg_api_size}
+| | ... | app_api_socket | ${app_api_socket}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | tcp_cc_algo | ${tcp_cc_algo}
| | Set To Dictionary | ${vpp_hoststack_attr}
-| | ... | sess_evt_q_seg_size | ${sess_evt_q_seg_size}
-| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_evt_q_length | ${sess_evt_q_length}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_prealloc_sess | ${sess_prealloc_sess}
@@ -211,6 +226,7 @@
| | ... | - ${tx_bytes} - Number of Bytes to send Type: string
| | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
| | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
+| | ... | - ${use_app_socket_api} - Use app socket API instead of VPP API
| |
| | ... | *Example:*
| |
@@ -230,6 +246,7 @@
| | ... | ${tx_bytes}=${vpp_echo_server_attr}[tx_bytes]
| | ... | ${rx_results_diff}=${vpp_echo_server_attr}[rx_results_diff]
| | ... | ${tx_results_diff}=${vpp_echo_server_attr}[tx_results_diff]
+| | ... | ${use_app_socket_api}=${vpp_echo_server_attr}[use_app_socket_api]
| |
| | Set To Dictionary | ${vpp_echo_server_attr} | cfg_vpp_feature
| | ... | ${cfg_vpp_feature}
@@ -246,6 +263,8 @@
| | ... | ${vpp_echo_server_attr} | rx_results_diff | ${rx_results_diff}
| | Set To Dictionary
| | ... | ${vpp_echo_server_attr} | tx_results_diff | ${tx_results_diff}
+| | Set To Dictionary
+| | ... | ${vpp_echo_server_attr} | use_app_socket_api | ${use_app_socket_api}
| Set VPP Echo Client Attributes
| | [Documentation]
@@ -265,6 +284,7 @@
| | ... | - ${tx_bytes} - Number of Bytes to send Type: string
| | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
| | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
+| | ... | - ${use_app_socket_api} - Use app socket API instead of VPP API
| |
| | ... | *Example:*
| |
@@ -284,6 +304,7 @@
| | ... | ${tx_bytes}=${vpp_echo_client_attr}[tx_bytes]
| | ... | ${rx_results_diff}=${vpp_echo_client_attr}[rx_results_diff]
| | ... | ${tx_results_diff}=${vpp_echo_client_attr}[tx_results_diff]
+| | ... | ${use_app_socket_api}=${vpp_echo_client_attr}[use_app_socket_api]
| |
| | Set To Dictionary | ${vpp_echo_client_attr} | cfg_vpp_feature
| | ... | ${cfg_vpp_feature}
@@ -300,6 +321,8 @@
| | ... | ${vpp_echo_client_attr} | rx_results_diff | ${rx_results_diff}
| | Set To Dictionary
| | ... | ${vpp_echo_client_attr} | tx_results_diff | ${tx_results_diff}
+| | Set To Dictionary
+| | ... | ${vpp_echo_client_attr} | use_app_socket_api | ${use_app_socket_api}
| Set Iperf3 Server Attributes
| | [Documentation]
@@ -340,11 +363,15 @@
| | ... | - ${transparent_tls} - Use VCL Transparent-TLS mode Type: boolean
| | ... | - ${ip_version} - IP version (4 or 6) Type: int
| | ... | - ${parallel} - Number of parallel streams Type: int
+| | ... | - ${bandwidth} - Target bandwidth in bits/sec Type: int
+| | ... | - ${udp} - UDP or TCP protocol Type: boolean
+| | ... | - ${length} - Packet Length Type: int
| |
| | ... | *Example:*
| |
| | ... | \| Set Iperf3 Client Attributes \| vcl_config=${vcl_config} \|
| | ... | \| ip_version=${ip_version} \| parallel=${streams} \|
+| | ... | \| bandwidth=${bandwidth} | udp=${True} \|
| |
| | [Arguments]
| | ... | ${vcl_config}=${iperf3_client_attr}[vcl_config]
@@ -352,6 +379,9 @@
| | ... | ${transparent_tls}=${iperf3_client_attr}[transparent_tls]
| | ... | ${ip_version}=${iperf3_client_attr}[ip_version]
| | ... | ${parallel}=${iperf3_client_attr}[parallel]
+| | ... | ${bandwidth}=${iperf3_client_attr}[bandwidth]
+| | ... | ${udp}=${iperf3_client_attr}[udp]
+| | ... | ${length}=${iperf3_client_attr}[length]
| |
| | Set To Dictionary | ${iperf3_client_attr} | vcl_config | ${vcl_config}
| | Set To Dictionary | ${iperf3_client_attr} | ld_preload | ${ld_preload}
@@ -359,6 +389,9 @@
| | ... | ${transparent_tls}
| | Set To Dictionary | ${iperf3_client_attr} | ip_version | ${ip_version}
| | Set To Dictionary | ${iperf3_client_attr} | parallel | ${parallel}
+| | Set To Dictionary | ${iperf3_client_attr} | bandwidth | ${bandwidth}
+| | Set To Dictionary | ${iperf3_client_attr} | udp | ${udp}
+| | Set To Dictionary | ${iperf3_client_attr} | length | ${length}
| Run hoststack test program on DUT
| | [Documentation]
@@ -414,7 +447,7 @@
| | Set hoststack quic fifo size | ${node} | ${quic_fifo_size}
| | Set hoststack quic crypto engine | ${node} | ${quic_crypto_engine}
-| Configure VPP hoststack attributes on all DUTs
+| Configure VPP Hoststack Attributes on all DUTs
| | [Documentation]
| | ... | Configure VPP HostStack attributes on all DUTs.
| |
@@ -426,11 +459,6 @@
| | FOR | ${dut} | IN | @{duts}
| | | Import Library | resources.libraries.python.VppConfigGenerator
| | | ... | WITH NAME | ${dut}
-| | | Run keyword | ${dut}.Add socksvr | ${vpp_hoststack_attr}[vpp_api_socket]
-| | | Run keyword | ${dut}.Add api segment global size
-| | | ... | ${vpp_hoststack_attr}[api_seg_global_size]
-| | | Run keyword | ${dut}.Add api segment api size
-| | | ... | ${vpp_hoststack_attr}[api_seg_api_size]
| | | Run Keyword If
| | | ... | '${dut}' == 'DUT1' and ${vpp_nsim_attr}[output_nsim_enable]
| | | ... | ${dut}.Add Nsim poll main thread
@@ -438,9 +466,7 @@
| | | Run keyword | ${dut}.Add tcp congestion control algorithm
| | | ... | ${vpp_hoststack_attr}[tcp_cc_algo]
| | | Run keyword | ${dut}.Add session enable
-| | | Run keyword | ${dut}.Add session event queues memfd segment
-| | | Run keyword | ${dut}.Add session event queues segment size
-| | | ... | ${vpp_hoststack_attr}[sess_evt_q_seg_size]
+| | | Run keyword | ${dut}.Add session app socket api
| | | Run keyword | ${dut}.Add session event queue length
| | | ... | ${vpp_hoststack_attr}[sess_evt_q_length]
| | | Run keyword | ${dut}.Add session preallocated sessions
@@ -492,11 +518,13 @@
| | ... | ${vpp_echo_client_attr}[namespace] | ${core_list}
| | ... | ${vpp_echo_client_attr}[cfg_vpp_feature] | ${vpp_echo_client}
| | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
+| | ... | ${vpp_echo_client} | ${dut2} | ${vpp_echo_server}
| | ${client_defer_fail} | ${client_output}=
| | ... | Analyze hoststack test program output | ${dut1} | Client
| | ... | ${vpp_nsim_attr} | ${vpp_echo_client}
| | Then Set test message | ${client_output}
| | And Hoststack Test Program Finished | ${dut2} | ${server_pid}
+| | ... | ${vpp_echo_server} | ${dut1} | ${vpp_echo_client}
| | ${server_defer_fail} | ${server_output}=
| | ... | Analyze hoststack test program output | ${dut2} | Server
| | ... | ${vpp_nsim_attr} | ${vpp_echo_server}
@@ -534,8 +562,140 @@
| | ... | ${iperf3_client_attr}[namespace] | ${core_list}
| | ... | ${iperf3_client_attr}[cfg_vpp_feature] | ${iperf3_client}
| | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
+| | ... | ${iperf3_client} | ${dut2} | ${iperf3_server}
| | ${client_defer_fail} | ${client_output}=
| | ... | Analyze hoststack test program output | ${dut1} | Client
| | ... | ${vpp_nsim_attr} | ${iperf3_client}
| | Then Set test message | ${client_output}
| | Return From Keyword | ${client_defer_fail}
+
+| Set up LDP or VCL Nginx on DUT1 node
+| | [Documentation]
+| | ... | Setup for suites which uses VCL or LDP Nginx on DUT1.
+| |
+| | ... | Currently hardcoded to work on DUT1, assuming its node dict
+| | ... | and similar values like \${DUT1_cpu_alloc_str} are already defined.
+| |
+| | ... | *Arguments:*
+| | ... | - mode - VCL Nginx or LDP Nginx. Type: string
+| | ... | - rps_cps - Test rps or cps. Type: string
+| | ... | - core_num - Nginx work processes number. Type: int
+| | ... | - qat - Whether to use the qat engine. Type: string
+| | ... | - tls_tcp - TLS or TCP. Type: string
+| | ... | - use_dma - Whether to use DMA, Default: False. Type: bool
+| |
+| | ... | *Example:*
+| |
+| | ... | \| Set up LDP or VCL NGINX on DUT1 node \| ${mode}\
+| | ... | \| ${rps_cps} \| ${phy_cores} \| ${qat} \| ${tls_tcp} \|
+| |
+| | [Arguments] | ${mode} | ${rps_cps} | ${phy_cores} | ${qat} | ${tls_tcp}
+| | | ... | ${use_dma}=${False}
+| |
+| | Set Interface State | ${DUT1} | ${DUT1_${int}1}[0] | up
+| | VPP Interface Set IP Address | ${DUT1} | ${DUT1_${int}1}[0]
+| | ... | ${dut_ip_addrs}[0] | ${dut_ip_prefix}
+| | Vpp Node Interfaces Ready Wait | ${DUT1}
+| | ${skip_cnt}= | Evaluate
+| | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
+| | ${numa}= | Get interfaces numa node | ${DUT1} | ${DUT1_${int}1}[0]
+| | Apply Nginx configuration on DUT | ${DUT1} | ${phy_cores}
+| | ${attr}= | Run Keyword If | ${use_dma} == ${True}
+| | ... | Set Variable | ${nginx_server_with_dma_attr}
+| | ... | ELSE | Set Variable | ${nginx_server_attr}
+| | Set To Dictionary | ${attr} | ip_address
+| | ... | ${dut_ip_addrs}[0]
+| | ${core_list}= | Cpu list per node str | ${DUT1} | ${numa}
+| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${attr}[cpu_cnt]
+| | ... | smt_used=${smt_used}
+| | ${cpu_idle}= | Cpu List per node | ${DUT1} | ${numa}
+| | ${cpu_idle_list}= | Get Slice From List | ${cpu_idle}
+| | ... | ${${skip_cnt} + ${attr}[cpu_cnt]}
+| | ${nginx_server}= | Get Nginx Command | ${attr}
+| | ... | ${nginx_version} | ${packages_dir}
+| | Start Hoststack Test Program
+| | ... | ${DUT1} | ${attr}[namespace] | ${core_list}
+| | ... | ${nginx_server}
+| | Get Hoststack Test Program Logs | ${DUT1} | ${nginx_server}
+| | Taskset Nginx PID to idle cores | ${DUT1} | ${cpu_idle_list}
+
+| Measure TLS requests or connections per second
+| | [Documentation]
+| | ... | Measure number of requests or connections per second using ab.
+| |
+| | ... | *Arguments:*
+| | ... | - ${ciphers} - Specify SSL/TLS cipher suite
+| | ... | - ${files} - Filename to be requested from the servers
+| | ... | - ${tls_tcp} - Test TLS or TCP.
+| | ... | - ${mode} - VCL Nginx or LDP Nginx.
+| |
+| | ... | *Example:*
+| |
+| | ... | \| Measure TLS requests or connections per second
+| | ... | \| AES128-SHA \| 64 \| tls \| rps \|
+| |
+| | [Arguments] | ${ciphers} | ${files} | ${tls_tcp} | ${mode}
+| |
+| | ${dut_ip_addrs_str} | Evaluate | ','.join(${dut_ip_addrs})
+| | ${ad_ip_addrs_str} | Evaluate | ','.join(${ab_ip_addrs})
+| | ${output}= | Run ab | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
+| | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total}
+| | ... | ${listen_port}
+| | Set test message | ${output}
+| | Log VPP Hoststack data | ${dut1}
+
+| Configure VPP startup configuration for NGINX
+| | [Documentation]
+| | ... | COnfigure VPP startup configuration for NGINX related tests
+| |
+| | [Arguments] | ${sess_prealloc_sess} | ${sess_evt_q_length}
+| | ... | ${v4_sess_tbl_buckets} | ${v4_sess_tbl_mem} | ${local_endpts_tbl_buckets}
+| | ... | ${local_endpts_tbl_mem} | ${tcp_prealloc_conns} | ${tcp_prealloc_ho_conns}
+| |
+| | FOR | ${dut} | IN | @{duts}
+| | | Import Library | resources.libraries.python.VppConfigGenerator
+| | | ... | WITH NAME | ${dut}
+| | | Run keyword | ${dut}.Add session enable
+| | | Run keyword | ${dut}.Add session app socket api
+| | | Run keyword | ${dut}.Add session preallocated sessions
+| | | ... | ${sess_prealloc_sess}
+| | | Run keyword | ${dut}.Add session event queue length
+| | | ... | ${sess_evt_q_length}
+| | | Run keyword | ${dut}.Add session v4 session table buckets
+| | | ... | ${v4_sess_tbl_buckets}
+| | | Run keyword | ${dut}.Add session v4 session table memory
+| | | ... | ${v4_sess_tbl_mem}
+| | | Run keyword | ${dut}.Add session local endpoints table buckets
+| | | ... | ${local_endpts_tbl_buckets}
+| | | Run keyword | ${dut}.Add session local endpoints table memory
+| | | ... | ${local_endpts_tbl_mem}
+| | | Run keyword | ${dut}.Add tcp preallocated connections
+| | | ... | ${tcp_prealloc_conns}
+| | | Run keyword | ${dut}.Add tcp preallocated half open connections
+| | | ... | ${tcp_prealloc_ho_conns}
+| | END
+
+| Add Additional Startup Configuration For DMA On All DUTs
+| | [Documentation]
+| | ... | Add additional startup configuration for DMA on all DUTs
+| |
+| | [Arguments] | ${use_dma}=${True}
+| |
+| | FOR | ${dut} | IN | @{duts}
+| | | Import Library | resources.libraries.python.VppConfigGenerator
+| | | ... | WITH NAME | ${dut}
+| | | Run keyword | ${dut}.Add Session Event Queues Memfd Segment
+| | | Run keyword | ${dut}.Add TCP Congestion Control Algorithm
+| | | Run keyword | ${dut}.Add TCP Tso
+| | | Run keyword | ${dut}.Add Session Enable
+| | | Run keyword If | ${use_dma} == ${True}
+| | | ... | ${dut}.Add Session Use Dma
+| | | Run keyword If | ${use_dma} == ${True}
+| | | ... | Enable DMA WQs on all DUTs
+| | | Run keyword If | ${use_dma} == ${True}
+| | | ... | ${dut}.Add DMA Dev | ${${dut}_dma_wqs}
+| | | Run keyword If | '${nic_driver}' == 'vfio-pci'
+| | | ... | ${dut}.Add DPDK Dev Default Tso
+| | | Run keyword If | '${nic_driver}' == 'vfio-pci'
+| | | ... | ${dut}.Add DPDK Enable Tcp Udp Checksum
+| | END