X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fhoststack%2Fhoststack.robot;h=e16ad997dbd7324c236d2ccba5b71b9f9e937bac;hb=HEAD;hp=2661ea1eef5cd2ced332bb92eee89b963806f3f9;hpb=9c926fdd75cc1d65faa1ee50ce9133e754fdd498;p=csit.git diff --git a/resources/libraries/robot/hoststack/hoststack.robot b/resources/libraries/robot/hoststack/hoststack.robot index 2661ea1eef..ece1d8a1f4 100644 --- a/resources/libraries/robot/hoststack/hoststack.robot +++ b/resources/libraries/robot/hoststack/hoststack.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2023 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: @@ -17,8 +17,10 @@ | 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 @@ -29,7 +31,6 @@ | ${quic_crypto_engine}= | nocrypto | ${quic_fifo_size}= | 4M | &{vpp_hoststack_attr}= -| ... | rxq=${1} | ... | rxd=${256} | ... | txd=${256} | ... | phy_cores=${1} @@ -121,6 +122,16 @@ | ... | 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 @@ -128,7 +139,6 @@ | | ... | Set the VPP HostStack attributes in the vpp_hoststack_attr dictionary. | | | | ... | *Arguments:* -| | ... | - ${rxq} - Number of Rx Queues Type: int | | ... | - ${rxd} - Number of Rx Descriptors Type: int | | ... | - ${txd} - Number of Tx Descriptors Type: int | | ... | - ${phy_cores} - Number of cores for workers Type: int @@ -156,7 +166,6 @@ | | ... | \| Set VPP Hoststack Attributes \| phy_cores=${phy_cores} \| | | | | [Arguments] -| | ... | ${rxq}=${vpp_hoststack_attr}[rxq] | | ... | ${rxd}=${vpp_hoststack_attr}[rxd] | | ... | ${txd}=${vpp_hoststack_attr}[txd] | | ... | ${phy_cores}=${vpp_hoststack_attr}[phy_cores] @@ -171,7 +180,6 @@ | | ... | ${sess_lendpt_buckets}=${vpp_hoststack_attr}[sess_lendpt_buckets] | | ... | ${sess_lendpt_mem}=${vpp_hoststack_attr}[sess_lendpt_mem] | | -| | Set To Dictionary | ${vpp_hoststack_attr} | rxq | ${rxq} | | Set To Dictionary | ${vpp_hoststack_attr} | rxd | ${rxd} | | Set To Dictionary | ${vpp_hoststack_attr} | txd | ${txd} | | Set To Dictionary | ${vpp_hoststack_attr} | phy_cores | ${phy_cores} @@ -441,8 +449,8 @@ | | | | Set Max Rate And Jumbo | | Add worker threads to all DUTs -| | ... | ${vpp_hoststack_attr}[phy_cores] | ${vpp_hoststack_attr}[rxq] -| | ... | ${vpp_hoststack_attr}[rxd] | ${vpp_hoststack_attr}[txd] +| | ... | ${vpp_hoststack_attr}[phy_cores] +| | ... | rxd=${vpp_hoststack_attr}[rxd] | txd=${vpp_hoststack_attr}[txd] | | Pre-initialize layer driver | ${nic_driver} | | FOR | ${dut} | IN | @{duts} | | | Import Library | resources.libraries.python.VppConfigGenerator @@ -493,6 +501,9 @@ | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1} | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa} | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_server_attr}[cpu_cnt] +| | FOR | ${action} | IN | @{stat_pre_trial} +| | | Run Keyword | Additional Statistics Action For ${action} +| | END | | ${server_pid}= | Run hoststack test program on DUT | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix} | | ... | ${vpp_echo_server_attr}[namespace] | ${core_list} @@ -516,6 +527,9 @@ | | ${server_defer_fail} | ${server_output}= | | ... | Analyze hoststack test program output | ${dut2} | Server | | ... | ${vpp_nsim_attr} | ${vpp_echo_server} +| | FOR | ${action} | IN | @{stat_post_trial} +| | | Run Keyword | Additional Statistics Action For ${action} +| | END | | Set test message | ${server_output} | append=True | | Run Keyword And Return | Hoststack Test Program Defer Fail | | ... | ${server_defer_fail} | ${client_defer_fail} @@ -537,6 +551,9 @@ | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1} | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa} | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_server_attr}[cpu_cnt] +| | FOR | ${action} | IN | @{stat_pre_trial} +| | | Run Keyword | Additional Statistics Action For ${action} +| | END | | ${server_pid}= | Run hoststack test program on DUT | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix} | | ... | ${iperf3_server_attr}[namespace] | ${core_list} @@ -551,57 +568,64 @@ | | ... | ${iperf3_client_attr}[cfg_vpp_feature] | ${iperf3_client} | | When Hoststack Test Program Finished | ${dut1} | ${client_pid} | | ... | ${iperf3_client} | ${dut2} | ${iperf3_server} +| | FOR | ${action} | IN | @{stat_post_trial} +| | | Run Keyword | Additional Statistics Action For ${action} +| | END | | ${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 DUT node +| Set up LDP or VCL Nginx on DUT1 node | | [Documentation] -| | ... | Setup for suites which uses VCL or LDP Nginx on DUT. +| | ... | 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:* -| | ... | - dut - DUT node. -| | ... | Type: string -| | ... | - mode - VCL Nginx or LDP Nginx. -| | ... | Type: string -| | ... | - rps_cps - Test request or connect. -| | ... | Type: string -| | ... | - core_num - Nginx work processes number. -| | ... | Type: int -| | ... | - qat - Whether to use the qat engine. -| | ... | Type: string -| | ... | - tls_tcp - TLS or TCP. +| | ... | - 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 DUT node \| ${dut} |${mode}\ +| | ... | \| Set up LDP or VCL NGINX on DUT1 node \| ${mode}\ | | ... | \| ${rps_cps} \| ${phy_cores} \| ${qat} \| ${tls_tcp} \| | | -| | [Arguments] | ${dut} | ${mode} | ${rps_cps} | ${phy_cores} | ${qat} -| | ... | ${tls_tcp} +| | [Arguments] | ${mode} | ${rps_cps} | ${phy_cores} | ${qat} | ${tls_tcp} +| | | ... | ${use_dma}=${False} | | -| | Set Interface State | ${dut} | ${DUT1_${int}1}[0] | up -| | VPP Interface Set IP Address | ${dut} | ${DUT1_${int}1}[0] +| | 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 | ${dut} +| | 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 | ${dut} | ${DUT1_${int}1}[0] -| | Apply Nginx configuration on DUT | ${dut} | ${phy_cores} -| | Set To Dictionary | ${nginx_server_attr} | ip_address +| | ${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 | ${dut} | ${numa} -| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${nginx_server_attr}[cpu_cnt] -| | ${cpu_idle_list}= | Get cpu idle list | ${dut} | ${numa} -| | ... | ${smt_used} | ${${dut}_cpu_alloc_str} -| | ${nginx_server}= | Get Nginx Command | ${nginx_server_attr} +| | ${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} -| | ${server_pid}= | Start Hoststack Test Program -| | ... | ${dut} | ${nginx_server_attr}[namespace] | ${core_list} +| | Start Hoststack Test Program +| | ... | ${DUT1} | ${attr}[namespace] | ${core_list} | | ... | ${nginx_server} -| | Taskset Nginx PID to idle cores | ${dut} | ${cpu_idle_list} +| | 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] @@ -620,11 +644,18 @@ | | | | [Arguments] | ${ciphers} | ${files} | ${tls_tcp} | ${mode} | | -| | ${output}= | Run ab | ${tg} | ${dut_ip_addrs}[0] | ${ab_ip_addrs}[0] +| | ${dut_ip_addrs_str} | Evaluate | ','.join(${dut_ip_addrs}) +| | ${ad_ip_addrs_str} | Evaluate | ','.join(${ab_ip_addrs}) +| | FOR | ${action} | IN | @{stat_pre_trial} +| | | Run Keyword | Additional Statistics Action For ${action} +| | END +| | ${output}= | Run ab | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str} | | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total} | | ... | ${listen_port} +| | FOR | ${action} | IN | @{stat_post_trial} +| | | Run Keyword | Additional Statistics Action For ${action} +| | END | | Set test message | ${output} -| | Log VPP Hoststack data | ${dut1} | Configure VPP startup configuration for NGINX | | [Documentation] @@ -656,3 +687,28 @@ | | | 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