From d79b753c1fde3cd831f60ac5cc0034f613c44b43 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Wed, 15 Jan 2020 06:29:16 +0000 Subject: [PATCH] perf: Add hoststack NSIM+LDPRELOAD+IPERF3 test suite Change-Id: Ia7a876b1aa240676e1f2d23618c1d4e09ead14f0 Signed-off-by: Dave Wallace --- resources/api/vpp/supported_crcs.yaml | 4 ++ resources/libraries/python/NsimUtil.py | 17 +++--- resources/libraries/python/VppConfigGenerator.py | 5 ++ resources/libraries/python/autogen/Regenerator.py | 10 ++-- .../libraries/robot/hoststack/hoststack.robot | 8 ++- ...x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot | 66 ++++++++++++++++++++++ 6 files changed, 95 insertions(+), 15 deletions(-) create mode 100644 tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot diff --git a/resources/api/vpp/supported_crcs.yaml b/resources/api/vpp/supported_crcs.yaml index ea4358e844..f7a943b371 100644 --- a/resources/api/vpp/supported_crcs.yaml +++ b/resources/api/vpp/supported_crcs.yaml @@ -186,6 +186,10 @@ nat_show_config_reply: '0x006a0786' # perf teardown # 6x^ tc01-64B-1c-ethip4udp-ip4base-nat44-mrr # ^ nat44NOTscaleNOTsrc_user_1 + nsim_configure: '0x16ed400f' # perf + nsim_configure_reply: '0xe8d4e804' # perf + nsim_output_feature_enable_disable: '0x3865946c' # perf + nsim_output_feature_enable_disable_reply: '0xe8d4e804' # perf policer_add_del: '0xdfea2be8' # dev policer_add_del_reply: '0xa177cef2' # dev policer_classify_set_interface: '0xde7ad708' # dev diff --git a/resources/libraries/python/NsimUtil.py b/resources/libraries/python/NsimUtil.py index 9d60a911b1..bd319e668e 100644 --- a/resources/libraries/python/NsimUtil.py +++ b/resources/libraries/python/NsimUtil.py @@ -13,14 +13,11 @@ """VPP Network Simulator Plugin util library.""" -from robot.api import logger - -from resources.libraries.python.Constants import Constants from resources.libraries.python.PapiExecutor import PapiSocketExecutor from resources.libraries.python.InterfaceUtil import InterfaceUtil -class NsimUtil(object): +class NsimUtil(): """VPP NSIM Plugin Keywords.""" @staticmethod @@ -33,14 +30,14 @@ class NsimUtil(object): :param interface1: 2nd Interface name for cross-connect feature :type node: dict :type vpp_nsim_attr: dict - :type interface0: string or int - :type interface1: string or int + :type interface0: str or int + :type interface1: str or int :raises RuntimeError: if no NSIM features are enabled or vpp papi command fails. """ host = node[u"host"] - if vpp_nsim_attr[u"output_feature_enable"] == False \ - and vpp_nsim_attr[u"cross_connect_feature_enable"] == False: + if not vpp_nsim_attr[u"output_feature_enable"] \ + and not vpp_nsim_attr[u"cross_connect_feature_enable"]: raise RuntimeError(f"No NSIM features enabled on host {host}:\n" f"vpp_nsim_attr = {vpp_nsim_attr}") cmd = u"nsim_configure" @@ -56,7 +53,7 @@ class NsimUtil(object): with PapiSocketExecutor(node) as papi_exec: papi_exec.add(cmd, **args).get_reply(err_msg) - if vpp_nsim_attr[u"output_feature_enable"] == True: + if vpp_nsim_attr[u"output_feature_enable"]: cmd = u"nsim_output_feature_enable_disable" args = dict( enable_disable=vpp_nsim_attr[u"output_feature_enable"], @@ -67,7 +64,7 @@ class NsimUtil(object): with PapiSocketExecutor(node) as papi_exec: papi_exec.add(cmd, **args).get_reply(err_msg) - elif vpp_nsim_attr[u"cross_connect_feature_enable"] == True: + elif vpp_nsim_attr[u"cross_connect_feature_enable"]: cmd = u"nsim_cross_connect_feature_enable_disable" args = dict( enable_disable=vpp_nsim_attr[u"cross_connect_feature_enable"], diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index 7a687ae200..b769b89acd 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -495,6 +495,11 @@ class VppConfigGenerator: path = [u"nat"] self.add_config_item(self._nodeconfig, value, path) + def add_nsim_poll_main_thread(self): + """Add NSIM poll-main-thread configuration.""" + path = [u"nsim", u"poll-main-thread"] + self.add_config_item(self._nodeconfig, u"", path) + def add_tcp_congestion_control_algorithm(self, value=u"cubic"): """Add TCP congestion control algorithm. diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py index f065887da0..3ef4e8554d 100644 --- a/resources/libraries/python/autogen/Regenerator.py +++ b/resources/libraries/python/autogen/Regenerator.py @@ -512,10 +512,12 @@ class Regenerator: elif in_filename[-10:] in (u"-cps.robot", u"-rps.robot"): write_tcp_files(in_filename, in_prolog, hoststack_wrk_kwargs_list) - elif in_filename[-10:] in u"-bps.robot": - write_tcp_files(in_filename, in_prolog, - hoststack_iperf3_kwargs_list if u"iperf3" - in in_filename else hoststack_quic_kwargs_list) + elif in_filename[-10:] in (u"-bps.robot"): + if u"ldpreload-iperf3" in in_filename: + hoststack_kwargs_list = hoststack_iperf3_kwargs_list + else: + hoststack_kwargs_list = hoststack_quic_kwargs_list + write_tcp_files(in_filename, in_prolog, hoststack_kwargs_list) else: raise RuntimeError( f"Error in {in_filename}: non-primary suite type found." diff --git a/resources/libraries/robot/hoststack/hoststack.robot b/resources/libraries/robot/hoststack/hoststack.robot index e765169e32..16a390aeb8 100644 --- a/resources/libraries/robot/hoststack/hoststack.robot +++ b/resources/libraries/robot/hoststack/hoststack.robot @@ -386,7 +386,10 @@ | | | ... | ${namespace} | ${core_list} | ${cfg_vpp_feature} | | | ... | ${test_program} | | -| | Run Keyword If | ${vpp_nsim_attr}[output_feature_enable] +| | ${is_dut1}= | Run Keyword And Return Status +| | ... | Dictionaries should be equal | ${node} | ${dut1} +| | Run Keyword If +| | ... | ${is_dut1} and ${vpp_nsim_attr}[output_feature_enable] | | ... | Configure VPP NSIM | ${node} | ${vpp_nsim_attr} | ${intf} | | Run Keyword If | '${cfg_vpp_feature}' != '' | | ... | Additional VPP Config for Feature ${cfg_vpp_feature} | ${node} @@ -428,6 +431,9 @@ | | | ... | ${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_feature_enable] +| | | ... | ${dut}.Add Nsim poll main thread | | | Run keyword | ${dut}.Add api segment gid | testuser | | | Run keyword | ${dut}.Add tcp congestion control algorithm | | | ... | ${vpp_hoststack_attr}[tcp_cc_algo] diff --git a/tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot b/tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot new file mode 100644 index 0000000000..0a98ee3acd --- /dev/null +++ b/tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot @@ -0,0 +1,66 @@ +# Copyright (c) 2020 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: +# +# 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 *** +| Library | resources.libraries.python.HoststackUtil +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/hoststack/hoststack.robot +| +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV +| ... | TCP | NIC_Intel-X710 | DRV_VFIO_PCI | HOSTSTACK +| ... | NSIM | LDPRELOAD | IPERF3 | eth-ip4tcp-nsim-ldpreload-iperf3 +| +| Suite Setup | Setup suite single link no tg +| Suite Teardown | Tear down suite +| Test Setup | Setup test +| Test Teardown | Tear down test +| +| Test Template | Local template +| +| Documentation | *Iperf3 client -> Iperf3 server throughput. +| +| ... | *[Top] Network Topologies:* DUT-DUT 2-node topology +| ... | with single link between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-TCP +| ... | *[Cfg] DUT configuration:* +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| @{plugins_to_enable}= | dpdk_plugin.so | nsim_plugin.so +| ${nic_name}= | Intel-X710 +| ${nic_driver}= | vfio-pci +| ${overhead}= | ${0} +| ${frame_size}= | ${9000} +| ${crypto_type}= | ${None} +| ${pkts_per_drop}= | ${100} + +*** Keywords *** +| Local template +| | [Arguments] | ${phy_cores} | ${clients} | ${streams} +| | +| | Set VPP Hoststack Attributes | phy_cores=${phy_cores} +| | Set Iperf3 Client Attributes | parallel=${streams} +| | Set VPP NSIM Attributes | output_feature_enable=${True} | +| | ... | packets_per_drop=${pkts_per_drop} +| | ${no_results}= | Get Test Results From Hoststack Iperf3 Test +| | Run Keyword If | ${no_results}==True | FAIL +| | ... | No Test Results From Iperf3 client + +*** Test Cases *** +| tc01-9000B-1c-eth-ip4tcp-nsim-ldpreload-iperf3-bps +| | [Tags] | 1C | 1CLIENT | 1STREAM +| | phy_cores=${1} | clients=${1} | streams=${1} + +| tc02-9000B-1c-eth-ip4tcp-nsim-ldpreload-iperf3-bps +| | [Tags] | 1C | 1CLIENT | 10STREAM +| | phy_cores=${1} | clients=${1} | streams=${10} -- 2.16.6