aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxinfengx <xinfengx.zhao@intel.com>2023-10-19 01:02:48 +0000
committerVratko Polak <vrpolak@cisco.com>2024-04-22 11:59:34 +0000
commitb29d3d6b0062820c18ea2aab9c250712a9dbe47a (patch)
tree61c93d68463c7532302d5b811a1b4c5129842a0a
parent92fbedc4cbd4376f4d43416401d3438ee923984b (diff)
Add hoststack with DMA test suites
Change-Id: Idef14bef816a04ca43ab9aced4b1441ef818e066 Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
-rw-r--r--resources/libraries/python/VppConfigGenerator.py20
-rw-r--r--resources/libraries/robot/hoststack/hoststack.robot80
-rw-r--r--resources/templates/vcl/vcl_dma.conf9
-rw-r--r--tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps.robot122
-rw-r--r--tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps.robot122
5 files changed, 335 insertions, 18 deletions
diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py
index 5b2e883b97..4191c0eed2 100644
--- a/resources/libraries/python/VppConfigGenerator.py
+++ b/resources/libraries/python/VppConfigGenerator.py
@@ -332,6 +332,11 @@ class VppConfigGenerator:
path = ["dpdk", "dev default", "num-tx-desc"]
self.add_config_item(self._nodeconfig, value, path)
+ def add_dpdk_dev_default_tso(self):
+ """Add DPDK dev default tso configuration."""
+ path = [u"dpdk", u"dev default", u"tso"]
+ self.add_config_item(self._nodeconfig, "on", path)
+
def add_dpdk_log_level(self, value):
"""Add DPDK log-level configuration.
@@ -375,6 +380,11 @@ class VppConfigGenerator:
path = ["dpdk", "max-simd-bitwidth"]
self.add_config_item(self._nodeconfig, value, path)
+ def add_dpdk_enable_tcp_udp_checksum(self):
+ """Add DPDK enable-tcp-udp-checksum configuration."""
+ path = [u"dpdk", u"enable-tcp-udp-checksum"]
+ self.add_config_item(self._nodeconfig, u"", path)
+
def add_cpu_main_core(self, value):
"""Add CPU main core configuration.
@@ -587,6 +597,11 @@ class VppConfigGenerator:
path = ["tcp", "preallocated-half-open-connections"]
self.add_config_item(self._nodeconfig, value, path)
+ def add_tcp_tso(self):
+ """Add TCP tso configuration."""
+ path = [u"tcp", u"tso"]
+ self.add_config_item(self._nodeconfig, u"", path)
+
def add_session_enable(self):
"""Add session enable."""
path = ["session", "enable"]
@@ -683,6 +698,11 @@ class VppConfigGenerator:
path = ["session", "local-endpoints-table-memory"]
self.add_config_item(self._nodeconfig, value, path)
+ def add_session_use_dma(self):
+ """Add session use-dma configuration."""
+ path = [u"session", u"use-dma"]
+ self.add_config_item(self._nodeconfig, u"", path)
+
def add_dma_dev(self, devices):
"""Add DMA devices configuration.
diff --git a/resources/libraries/robot/hoststack/hoststack.robot b/resources/libraries/robot/hoststack/hoststack.robot
index 34e34b056c..1033c1c008 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
@@ -121,6 +123,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
@@ -565,15 +577,12 @@
| | ... | and similar values like \${DUT1_cpu_alloc_str} are already defined.
| |
| | ... | *Arguments:*
-| | ... | - 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:*
| |
@@ -581,6 +590,7 @@
| | ... | \| ${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]
@@ -590,17 +600,23 @@
| | ... | ${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}
-| | Set To Dictionary | ${nginx_server_attr} | ip_address
+| | ${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=${nginx_server_attr}[cpu_cnt]
-| | ${cpu_idle_list}= | Get cpu idle list | ${DUT1} | ${numa}
-| | ... | ${smt_used} | ${DUT1_cpu_alloc_str}
-| | ${nginx_server}= | Get Nginx Command | ${nginx_server_attr}
+| | ... | 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
-| | ... | ${DUT1} | ${nginx_server_attr}[namespace] | ${core_list}
+| | 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
@@ -620,7 +636,9 @@
| |
| | [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})
+| | ${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}
@@ -656,3 +674,29 @@
| | | 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
+| | | Run keyword | ${dut}.Add Api Trace
+| | END
diff --git a/resources/templates/vcl/vcl_dma.conf b/resources/templates/vcl/vcl_dma.conf
new file mode 100644
index 0000000000..46c578b770
--- /dev/null
+++ b/resources/templates/vcl/vcl_dma.conf
@@ -0,0 +1,9 @@
+vcl {
+ segment-size 4000000000
+ add-segment-size 4000000000
+ rx-fifo-size 4000000
+ tx-fifo-size 4000000
+ use-mq-eventfd
+ event-queue-size 500000
+ api-socket-name /run/vpp/api.sock
+}
diff --git a/tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps.robot b/tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps.robot
new file mode 100644
index 0000000000..1d3d9f91bd
--- /dev/null
+++ b/tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps.robot
@@ -0,0 +1,122 @@
+# Copyright (c) 2024 Intel 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:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+| Resource | resources/libraries/robot/shared/default.robot
+| Resource | resources/libraries/robot/hoststack/hoststack.robot
+|
+| Force Tags | 2_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV
+| ... | HOSTSTACK | LDP_NGINX | TCP | NIC_Intel-X710 | DRV_VFIO_PCI
+| ... | TCP_CPS | DMA
+| ... | eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5
+|
+| Suite Setup | Setup suite topology interfaces | ab | nginx
+| Suite Teardown | Tear down suite | ab
+| Test Setup | Setup test
+| Test Teardown | Tear down test | nginx
+|
+| Test Template | Local Template
+|
+| Documentation | **TCP requests per second.**
+| ... |
+| ... | - **[Top] Network Topologies:** TG-DUT-TG 2-node topology \
+| ... | with single link between nodes.
+| ... |
+| ... | - **[Enc] Packet Encapsulations:** Eth-IPv4-TCP-HTTP for TCP
+| ... |
+| ... | - **[Cfg] DUT configuration:**
+| ... |
+| ... | - **[Ver] TG verification:**
+| ... |
+| ... | - **[Ref] Applicable standard specifications:**
+
+*** Variables ***
+| @{plugins_to_enable}= | dpdk_plugin.so | perfmon_plugin.so
+| ... | dma_intel_plugin.so | ping_plugin.so
+| ${nic_name}= | Intel-X710
+| ${crypto_type}= | ${None}
+| ${nic_driver}= | vfio-pci
+| ${nic_rxq_size}= | 0
+| ${nic_txq_size}= | 0
+| ${nic_pfs}= | 2
+| ${nic_vfs}= | 0
+| ${overhead}= | ${0}
+#| ${page_size}= | 1G
+| ${ciphers}= | 0
+| ${rps_cps}= | cps
+| ${qat}= | ${0}
+| ${r_total}= | ${1000000}
+| ${c_total}= | ${2000}
+| ${listen_port}= | ${80}
+| ${mode}= | ldp
+| ${tls_tcp}= | tcp
+| ${keep_time}= | 0
+| ${ab_ip_prefix}= | 24
+| @{ab_ip_addrs}= | 192.168.10.2
+| ${dut_ip_prefix}= | 24
+| @{dut_ip_addrs}= | 192.168.10.1
+| ${nginx_version}= | 1.21.5
+| ${use_dma}= | ${True}
+
+*** Keywords ***
+| Local template
+| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
+| |
+| | Set Test Variable | \${frame_size}
+| | Set Test Variable | ${dpdk_no_tx_checksum_offload} | ${False}
+| | Given Set Max Rate And Jumbo
+| | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
+| | And Pre-initialize layer driver | ${nic_driver}
+| | And Add Additional Startup Configuration For DMA On All DUTs
+| | And Apply startup configuration on all VPP DUTs
+| | When Initialize layer driver | ${nic_driver}
+| | And Initialize layer interface
+| | And Set up LDP or VCL Nginx on DUT1 node | ${mode}
+| | ... | ${rps_cps} | ${phy_cores} | ${qat} | ${tls_tcp}
+| | ... | ${True}
+| | And Additional Suite Setup Action For ab
+| | Then Measure TLS requests or connections per second
+| | ... | ${ciphers} | ${frame_size} | ${tls_tcp} | ${rps_cps}
+
+*** Test Cases ***
+| 0B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 0B | 1C
+| | frame_size=${0} | phy_cores=${1}
+
+| 0B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 0B | 2C
+| | frame_size=${0} | phy_cores=${2}
+
+| 64B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 64B | 1C
+| | frame_size=${64} | phy_cores=${1}
+
+| 64B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 64B | 2C
+| | frame_size=${64} | phy_cores=${2}
+
+| 1024B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 1024B | 1C
+| | frame_size=${1024} | phy_cores=${1}
+
+| 1024B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 1024B | 2C
+| | frame_size=${1024} | phy_cores=${2}
+
+| 2048B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 2048B | 1C
+| | frame_size=${2048} | phy_cores=${1}
+
+| 2048B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-cps
+| | [Tags] | 2048B | 2C
+| | frame_size=${2048} | phy_cores=${2}
diff --git a/tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps.robot b/tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps.robot
new file mode 100644
index 0000000000..667ea038b6
--- /dev/null
+++ b/tests/vpp/perf/hoststack/2n1l-10ge2p1x710-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps.robot
@@ -0,0 +1,122 @@
+# Copyright (c) 2024 Intel 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:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+| Resource | resources/libraries/robot/shared/default.robot
+| Resource | resources/libraries/robot/hoststack/hoststack.robot
+|
+| Force Tags | 2_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV
+| ... | HOSTSTACK | LDP_NGINX | TCP | NIC_Intel-X710 | DRV_VFIO_PCI
+| ... | TCP_RPS | DMA
+| ... | eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5
+|
+| Suite Setup | Setup suite topology interfaces | ab | nginx
+| Suite Teardown | Tear down suite | ab
+| Test Setup | Setup test
+| Test Teardown | Tear down test | nginx
+|
+| Test Template | Local Template
+|
+| Documentation | **TCP requests per seconds.**
+| ... |
+| ... | - **[Top] Network Topologies:** TG-DUT-TG 2-node topology \
+| ... | with single link between nodes.
+| ... |
+| ... | - **[Enc] Packet Encapsulations:** Eth-IPv4-TCP-HTTP for TCP
+| ... |
+| ... | - **[Cfg] DUT configuration:**
+| ... |
+| ... | - **[Ver] TG verification:**
+| ... |
+| ... | - **[Ref] Applicable standard specifications:**
+
+*** Variables ***
+| @{plugins_to_enable}= | dpdk_plugin.so | perfmon_plugin.so
+| ... | dma_intel_plugin.so | ping_plugin.so
+| ${nic_name}= | Intel-X710
+| ${crypto_type}= | ${None}
+| ${nic_driver}= | vfio-pci
+| ${nic_rxq_size}= | 0
+| ${nic_txq_size}= | 0
+| ${nic_pfs}= | 2
+| ${nic_vfs}= | 0
+| ${overhead}= | ${0}
+#| ${page_size}= | 1G
+| ${ciphers}= | 0
+| ${rps_cps}= | rps
+| ${qat}= | ${0}
+| ${r_total}= | ${1000000}
+| ${c_total}= | ${2000}
+| ${listen_port}= | ${80}
+| ${mode}= | ldp
+| ${tls_tcp}= | tcp
+| ${keep_time}= | 300
+| ${ab_ip_prefix}= | 24
+| @{ab_ip_addrs}= | 192.168.10.2
+| ${dut_ip_prefix}= | 24
+| @{dut_ip_addrs}= | 192.168.10.1
+| ${nginx_version}= | 1.21.5
+| ${use_dma}= | ${True}
+
+*** Keywords ***
+| Local template
+| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
+| |
+| | Set Test Variable | \${frame_size}
+| | Set Test Variable | ${dpdk_no_tx_checksum_offload} | ${False}
+| | Given Set Max Rate And Jumbo
+| | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
+| | And Pre-initialize layer driver | ${nic_driver}
+| | And Add Additional Startup Configuration For DMA On All DUTs
+| | And Apply startup configuration on all VPP DUTs
+| | When Initialize layer driver | ${nic_driver}
+| | And Initialize layer interface
+| | And Set up LDP or VCL Nginx on DUT1 node | ${mode}
+| | ... | ${rps_cps} | ${phy_cores} | ${qat} | ${tls_tcp}
+| | ... | ${True}
+| | And Additional Suite Setup Action For ab
+| | Then Measure TLS requests or connections per second
+| | ... | ${ciphers} | ${frame_size} | ${tls_tcp} | ${rps_cps}
+
+*** Test Cases ***
+| 0B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 0B | 1C
+| | frame_size=${0} | phy_cores=${1}
+
+| 0B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 0B | 2C
+| | frame_size=${0} | phy_cores=${2}
+
+| 64B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 64B | 1C
+| | frame_size=${64} | phy_cores=${1}
+
+| 64B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 64B | 2C
+| | frame_size=${64} | phy_cores=${2}
+
+| 1024B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 1024B | 1C
+| | frame_size=${1024} | phy_cores=${1}
+
+| 1024B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 1024B | 2C
+| | frame_size=${1024} | phy_cores=${2}
+
+| 2048B-1c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 2048B | 1C
+| | frame_size=${2048} | phy_cores=${1}
+
+| 2048B-2c-eth-ip4tcphttp-dma-ldpreload-nginx-1_21_5-rps
+| | [Tags] | 2048B | 2C
+| | frame_size=${2048} | phy_cores=${2}