From patchwork Fri Oct 7 00:31:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 117487 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5360DA00C4; Thu, 6 Oct 2022 18:20:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FCCD4114E; Thu, 6 Oct 2022 18:20:56 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id BACDB40042 for ; Thu, 6 Oct 2022 18:20:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665073254; x=1696609254; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9SRsMdr5m4U952m/LrJl0lBJ1G8fPZMJuMym6IU/Cq4=; b=hwRERfnWX8oXzRVMH0DNDOof70mJLt6cwJ9Cfd53LKIdWVBCOGE3qSaF JQ8f8hwCykl5/1RUV8c+zwXtTZnZBp+RG3pJ0Cd1PZd0qQWCWx0+WWEUt 98NqBOKf2lPL/Z113Dlzgexi4mKxVhQ2lCWS17kk3yeBRVAihLd/IKA+2 H5vl1k4Sy3cMBJc4ZONO652nnrJyvrPgCQvz4TfFynpo3rHhiQwwLLUWn byMcAaX1+RwYdUTSs/6nQgPjxpt6jSBOa/XLL1zxZil/097CbTAbsRKHx LvydZUD0cgT74SzpYBqr2dsf1mlvgOBiKOukhDcsKHjnQJ/TR3o7N+ctS A==; X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="303469899" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="303469899" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 09:20:53 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="575888450" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="575888450" Received: from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 09:20:52 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Subject: [dts][PATCH V6 1/3] framework/*:add config dcf mode in execution file Date: Fri, 7 Oct 2022 08:31:35 +0800 Message-Id: <20221007003137.12787-2-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007003137.12787-1-zhiminx.huang@intel.com> References: <20221007003137.12787-1-zhiminx.huang@intel.com> X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org add dcf_mode parm into execution file configuration to support start testpmd with dcf. if take dcf mode,add dcf_mode=enable into execution.cfg. Signed-off-by: Zhimin Huang Acked-by: Xueqin Lin --- v6: -optimize test script and testplan v5: -add more comments framework/dts.py | 6 ++++++ framework/settings.py | 1 + 2 files changed, 7 insertions(+) diff --git a/framework/dts.py b/framework/dts.py index a894c461..a8e670b5 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -141,7 +141,13 @@ def dts_parse_config(config, section): except: rx_mode = "default" + try: + dcf_mode = config.get(section, "dcf_mode").strip().lower() + except: + dcf_mode = "" + settings.save_global_setting(settings.DPDK_RXMODE_SETTING, rx_mode) + settings.save_global_setting(settings.DPDK_DCFMODE_SETTING, dcf_mode) for suite in test_suites: if suite == "": diff --git a/framework/settings.py b/framework/settings.py index 2e7bcfa5..65029668 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -235,6 +235,7 @@ HOST_SHARED_LIB_PATH = "DTS_HOST_SHARED_LIB_PATH" DEBUG_SETTING = "DTS_DEBUG_ENABLE" DEBUG_CASE_SETTING = "DTS_DEBUGCASE_ENABLE" DPDK_RXMODE_SETTING = "DTS_DPDK_RXMODE" +DPDK_DCFMODE_SETTING = "DTS_DPDK_DCFMODE" DTS_ERROR_ENV = "DTS_RUNNING_ERROR" DTS_CFG_FOLDER = "DTS_CFG_FOLDER" DTS_PARALLEL_SETTING = "DTS_PARALLEL_ENABLE" From patchwork Fri Oct 7 00:31:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 117489 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71BBCA00C2; Thu, 6 Oct 2022 18:20:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E294410D3; Thu, 6 Oct 2022 18:20:58 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E100E40042 for ; Thu, 6 Oct 2022 18:20:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665073256; x=1696609256; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=juTvJC+RwcQNsJwBUM0D2ZLfhOiQUr71WWwHfcKUMPo=; b=SmE/uLSU8h5oLqdW1xojW5mVcPiUcjdCLvmSOQ8zHqL0+j52yQbo6IPg v3MaU90IKm36ttz6j4vnExy41+7M4fpbn9825es0tqCsEmEaXw8nFhTr4 QNaozHMd6zVGw+flvdM5RWRxt0FmPyXUOmFtP9B1Gjj7JVFyEgc1gLana C5ZeL+4QazprhVWO+l5ijAK9DdXGrWFhtQVfI7XrIBvrE3OTYwme3jPed 7NBjwQJqAvQWj9Sva81jsGrpSp5P7ok4Y2TjXcMNFgjpbMG1T0faAsEY8 mSiHSzpiauKYIt5DBJh0H91YZd7D2isIKx0+thX3qR/x3QgJTNgxtvawQ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="303469908" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="303469908" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 09:20:55 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="575888456" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="575888456" Received: from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 09:20:54 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Subject: [dts][PATCH V6 2/3] test_plans/*:modify cases to check dcf as a full feature pmd Date: Fri, 7 Oct 2022 08:31:36 +0800 Message-Id: <20221007003137.12787-3-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007003137.12787-1-zhiminx.huang@intel.com> References: <20221007003137.12787-1-zhiminx.huang@intel.com> X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org the dcf mode support more pmd feature in dpdk22.07. modify cases to support dcf and check normal datapath in dcf mode. add description for support dcf case in testplan. 1.set vf trust on before start dcf 2.start up testpmd with dcf parm. Signed-off-by: Zhimin Huang Acked-by: Xueqin Lin --- v6: -optimize testplan, replace 'or' to 'if' v5: -detailed the subject and comments. test_plans/kernelpf_iavf_test_plan.rst | 14 +++++++++++++- test_plans/stats_checks_test_plan.rst | 16 +++++++++++++++- test_plans/vf_macfilter_test_plan.rst | 22 ++++++++++++++++++++++ test_plans/vf_offload_test_plan.rst | 18 +++++++++++++++++- test_plans/vf_rss_test_plan.rst | 15 ++++++++++++++- test_plans/vf_smoke_test_plan.rst | 17 ++++++++++++++++- test_plans/vf_vlan_test_plan.rst | 16 +++++++++++++++- 7 files changed, 112 insertions(+), 6 deletions(-) diff --git a/test_plans/kernelpf_iavf_test_plan.rst b/test_plans/kernelpf_iavf_test_plan.rst index d877bb90..4b797122 100644 --- a/test_plans/kernelpf_iavf_test_plan.rst +++ b/test_plans/kernelpf_iavf_test_plan.rst @@ -43,10 +43,22 @@ Test IAVF cases on host or in qemu Bind VF device to igb_uio or vfio-pci -Start up VF port:: +if test IAVF, start up VF port:: .//app/dpdk-testpmd -c f -n 4 -- -i +if test DCF, set VF port to dcf and start up:: + + Enable kernel trust mode: + + ip link set $PF_INTF vf 0 trust on + + .//app/dpdk-testpmd -c f -n 4 -a 0000:18:01.0,cap=dcf -- -i + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + Test case: VF basic RX/TX ========================= Set rxonly forward, start testpmd diff --git a/test_plans/stats_checks_test_plan.rst b/test_plans/stats_checks_test_plan.rst index 8c7e0add..1b7d722f 100644 --- a/test_plans/stats_checks_test_plan.rst +++ b/test_plans/stats_checks_test_plan.rst @@ -259,11 +259,25 @@ Test Case: VF xstats Checks ./usertools/dpdk-devbind.py -s ./usertools/dpdk-devbind.py -b vfio-pci vf_bus_id -2. Launch testpmd on the VF and enable RSS:: +2. Launch testpmd on the VF and enable RSS: + + if test IAVF, start up VF port:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c f -n 4 -- -i --rxq=4 --txq=4 testpmd> port config all rss all testpmd> set fwd mac + if test DCF, set VF port to dcf and start up:: + + Enable kernel trust mode: + + ip link set $PF_INTF vf 0 trust on + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c f -n 4 -a 0000:18:01.0,cap=dcf -- -i --rxq=4 --txq=4 + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + 3. Then run the same steps of PF xstats Checks, get same result. note: because one port forwarding packets, so check rx and tx both in port 0. diff --git a/test_plans/vf_macfilter_test_plan.rst b/test_plans/vf_macfilter_test_plan.rst index d623cf04..4c57f51f 100644 --- a/test_plans/vf_macfilter_test_plan.rst +++ b/test_plans/vf_macfilter_test_plan.rst @@ -68,6 +68,9 @@ Test Case 1: test_kernel_2pf_2vf_1vm_iplink_macfilter disable promisc mode,set it in mac forward mode:: ./usertools/dpdk-devbind.py --bind=igb_uio 00:06.0 00:07.0 + + if test IAVF, start up VF port:: + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0x0f -n 4 -a 00:06.0 -a 00:07.0 -- -i --portmask=0x3 testpmd> port stop all @@ -77,6 +80,14 @@ Test Case 1: test_kernel_2pf_2vf_1vm_iplink_macfilter testpmd> set fwd mac testpmd> start + if test DCF, set VF port to dcf and start up:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0x0f -n 4 -a 00:06.0,cap=dcf -a 00:07.0,cap=dcf -- -i --portmask=0x3 + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + 6. Use scapy to send 100 random packets with ip link set MAC to VF, verify the packets can be received by one VF and can be forwarded to another VF correctly. @@ -146,6 +157,9 @@ Test Case 2: test_kernel_2pf_2vf_1vm_mac_add_filter VF, disable promisc mode, add a new MAC to VF0 and then start:: ./usertools/dpdk-devbind.py --bind=igb_uio 00:06.0 00:07.0 + + if test IAVF, start up VF port:: + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0x0f -n 4 -a 00:06.0 -a 00:07.0 -- -i --portmask=0x3 testpmd> port stop all @@ -156,6 +170,14 @@ Test Case 2: test_kernel_2pf_2vf_1vm_mac_add_filter testpmd> set fwd mac testpmd> start + if test DCF, set VF port to dcf and start up:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0x0f -n 4 -a 00:06.0,cap=dcf -a 00:07.0,cap=dcf -- -i --portmask=0x3 + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + 6. Use scapy to send 100 random packets with current VF0's MAC, verify the packets can be received by one VF and can be forwarded to another VF correctly. diff --git a/test_plans/vf_offload_test_plan.rst b/test_plans/vf_offload_test_plan.rst index ba490e06..c5e720f2 100644 --- a/test_plans/vf_offload_test_plan.rst +++ b/test_plans/vf_offload_test_plan.rst @@ -24,12 +24,28 @@ IP link set VF trust on and spoofchk off on DUT:: Assuming that ports ``0`` and ``1`` are connected to a traffic generator, enable hardware rx checksum offload with "--enable-rx-cksum", -launch the ``testpmd`` with the following arguments:: +launch the ``testpmd`` with the following arguments: + + if test IAVF, start up VF port:: ./build/app/dpdk-testpmd -cffffff -n 1 -- -i --burst=1 --txpt`=32 \ --txht=8 --txwt=0 --txfreet=0 --rxfreet=64 --mbcache=250 --portmask=0x5 --enable-rx-cksum + if test DCF, set VF port to dcf and start up:: + + Enable kernel trust mode: + + ip link set $PF_INTF vf 0 trust on + + dpdk-testpmd -c 0x0f -n 4 -a 00:04.0,cap=dcf -a 00:05.0,cap=dcf -- -i --burst=1 --txpt=32 \ + --txht=8 --txwt=0 --txfreet=0 --rxfreet=64 --mbcache=250 --portmask=0x5 + --enable-rx-cksum + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + Set the verbose level to 1 to display information for each received packet:: testpmd> set verbose 1 diff --git a/test_plans/vf_rss_test_plan.rst b/test_plans/vf_rss_test_plan.rst index 846de2d7..92a417f4 100644 --- a/test_plans/vf_rss_test_plan.rst +++ b/test_plans/vf_rss_test_plan.rst @@ -50,10 +50,23 @@ The following RX Ports/Queues configurations have to be benchmarked: Testpmd configuration - 4 RX/TX queues per port ----------------------------------------------- -:: + if test IAVF, start up VF port:: dpdk-testpmd -c 1f -n 3 -- -i --rxq=4 --txq=4 + + if test DCF, set VF port to dcf and start up:: + + Enable kernel trust mode: + + ip link set $PF_INTF vf 0 trust on + + dpdk-testpmd -c 0x0f -n 4 -a 00:04.0,cap=dcf -a 00:05.0,cap=dcf -- -i --rxq=4 --txq=4 + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + Testpmd Configuration Options ----------------------------- diff --git a/test_plans/vf_smoke_test_plan.rst b/test_plans/vf_smoke_test_plan.rst index 33a3273c..40f7611d 100644 --- a/test_plans/vf_smoke_test_plan.rst +++ b/test_plans/vf_smoke_test_plan.rst @@ -51,7 +51,9 @@ Prerequisites modprobe vfio-pci ./usertools/dpdk-devbind.py -b vfio-pci 0000:86:01.0 -8. Launch dpdk on VF:: +8. Launch dpdk on VF: + + if test IAVF, start up VF port:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:86:01.0 --file-prefix=pf -- -i --rxq=4 --txq=4 testpmd> set fwd mac @@ -59,6 +61,19 @@ Prerequisites testpmd> start testpmd> show port info all + if test DCF, set VF port to dcf and start up:: + + Enable kernel trust mode: + + ip link set $PF_INTF vf 0 trust on + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:86:01.0,cap=dcf --file-prefix=pf -- -i --rxq=4 + --txq=4 + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + Test Case 1: test enable and disable jumbo frame ==================================================== diff --git a/test_plans/vf_vlan_test_plan.rst b/test_plans/vf_vlan_test_plan.rst index 2c38d4dd..24877c6c 100644 --- a/test_plans/vf_vlan_test_plan.rst +++ b/test_plans/vf_vlan_test_plan.rst @@ -59,13 +59,27 @@ Prerequisites ./tools/dpdk_nic_bind.py --bind=igb_uio 00:04.0 00:05.0 -5. Start testpmd, set it in rxonly mode and enable verbose output:: +5. Start testpmd, set it in rxonly mode and enable verbose output: + + if test IAVF, start up VF port:: dpdk-testpmd -c 0x0f -n 4 -a 00:04.0 -a 00:05.0 -- -i --portmask=0x3 testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start + if test DCF, set VF port to dcf and start up:: + + Enable kernel trust mode: + + ip link set $PF_INTF vf 0 trust on + + dpdk-testpmd -c 0x0f -n 4 -a 00:04.0,cap=dcf -a 00:05.0,cap=dcf -- -i --portmask=0x3 + +.. note:: + + make dcf as full feature pmd is dpdk22.07 feature, and only support E810 series nic. + Test Case 1: Add port based vlan on VF ====================================== From patchwork Fri Oct 7 00:31:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 117490 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 980D8A00C2; Thu, 6 Oct 2022 18:21:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 937B640DDC; Thu, 6 Oct 2022 18:21:00 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id ED95940042 for ; Thu, 6 Oct 2022 18:20:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665073258; x=1696609258; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=l6pN6pb0l35lwj49v30Ro2Gqg22fcRTqbBbnUS1y9jo=; b=hHZ/mbM2xWGtSm7lh9w/nN9cQ3VdFfi8vncmlaanC2aUEUNMYVb6fozK X4OTkxPp0Yw2XWk8CrZlrBznKe+2lhEgS65EbfOWcIepPKCeMg7HV3edU hH1Dmhf1WVBIbfkC/lGoCIy3tvX3IyaJvn0uyHgpglADF+XbiMumHIPf9 f72OvLUM0nw9WO233NfzHWCJVY874AVfx7LnIQ9XjNfznMQ0SRdX0ebIR FekFLztw4vns+8V3aVhTxNnUNQciPoFvKswMIXqGcV1fBol7gz35cGCUl 9CH7nl9gz66qmWKoor0snatgXjlfVrdsWJMoZuiFsjLrRrTlGX1Gp9lpp A==; X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="303469917" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="303469917" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 09:20:57 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="575888468" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="575888468" Received: from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 09:20:55 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Subject: [dts][PATCH V6 3/3] tests/*:modify cases to check dcf as a full feature pmd Date: Fri, 7 Oct 2022 08:31:37 +0800 Message-Id: <20221007003137.12787-4-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007003137.12787-1-zhiminx.huang@intel.com> References: <20221007003137.12787-1-zhiminx.huang@intel.com> X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org the dcf mode support more pmd feature in dpdk22.07. modify cases to support dcf and check normal datapath in dcf mode. Signed-off-by: Zhimin Huang Acked-by: Xueqin Lin Tested-by: Jiale Song < songx.jiale@intel.com> Acked-by: Lijuan Tu --- v6: -encapsulate the startup testpmd into a function. v5: -detailed the subject and comments. tests/TestSuite_kernelpf_iavf.py | 58 ++++++++++++++++++++++---------- tests/TestSuite_stats_checks.py | 23 +++++++++++-- tests/TestSuite_vf_macfilter.py | 30 +++++++++++++++-- tests/TestSuite_vf_offload.py | 42 +++++++++++++++++------ tests/TestSuite_vf_rss.py | 39 ++++++++++++++++----- tests/TestSuite_vf_smoke.py | 18 +++++++++- tests/TestSuite_vf_vlan.py | 45 +++++++++++++++++++------ 7 files changed, 203 insertions(+), 52 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index a6d4d016..348dc76e 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -16,7 +16,7 @@ import time import framework.utils as utils from framework.packet import Packet from framework.pmd_output import PmdOutput -from framework.settings import HEADER_SIZE +from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting from framework.test_case import TestCase from framework.utils import RED from framework.virt_common import VM @@ -74,6 +74,7 @@ class TestKernelpfIavf(TestCase): # get priv-flags default stats self.flag = "vf-vlan-pruning" self.default_stats = self.dut.get_priv_flags_state(self.host_intf, self.flag) + self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) def set_up(self): @@ -129,6 +130,10 @@ class TestKernelpfIavf(TestCase): self.dut.send_expect( "ip link set %s vf 0 mac %s" % (self.host_intf, self.vf_mac), "# " ) + if self.dcf_mode: + self.dut.send_expect( + "ip link set %s vf 0 trust on" % (self.host_intf), "# " + ) try: for port in self.sriov_vfs_port: @@ -145,6 +150,7 @@ class TestKernelpfIavf(TestCase): raise Exception("Set up VM ENV failed!") self.vm_testpmd = PmdOutput(self.vm_dut) + self.vf_guest_pci = self.vm.pci_maps[0]["guestpci"] except Exception as e: self.destroy_vm_env() raise Exception(e) @@ -195,11 +201,25 @@ class TestKernelpfIavf(TestCase): ) return result + def launch_testpmd(self, **kwargs): + dcf_flag = kwargs.get("dcf_flag") + param = kwargs.get("param") if kwargs.get("param") else "" + if dcf_flag == "enable": + out = self.vm_testpmd.start_testpmd( + "all", + param=param, + ports=[self.vf_guest_pci], + port_options={self.vf_guest_pci: "cap=dcf"}, + ) + else: + out = self.vm_testpmd.start_testpmd("all", param=param) + return out + def test_vf_basic_rxtx(self): """ Set rxonly forward,Send 100 random packets from tester, check packets can be received """ - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("set fwd rxonly") self.vm_testpmd.execute_cmd("set verbose 1") self.vm_testpmd.execute_cmd("start") @@ -234,7 +254,7 @@ class TestKernelpfIavf(TestCase): Not set VF MAC from kernel PF for this case, if set, will print "not permitted error" when add new MAC for VF. """ - out = self.vm_testpmd.start_testpmd("all") + out = self.launch_testpmd(dcf_flag=self.dcf_mode) self.testpmd_mac = self.get_testpmd_vf_mac(out) self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set promisc all off") @@ -282,7 +302,7 @@ class TestKernelpfIavf(TestCase): Enable kernel trust mode """ self.dut.send_expect("ip link set dev %s vf 0 trust on" % self.host_intf, "# ") - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set verbose 1") self.vm_testpmd.execute_cmd("start") @@ -321,7 +341,7 @@ class TestKernelpfIavf(TestCase): """ multicast_mac = "01:80:C2:00:00:08" self.dut.send_expect("ip link set dev %s vf 0 trust on" % self.host_intf, "# ") - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set promisc all off") self.vm_testpmd.execute_cmd("set allmulti all off") @@ -345,7 +365,7 @@ class TestKernelpfIavf(TestCase): def test_vf_broadcast(self): """ """ broadcast_mac = "ff:ff:ff:ff:ff:ff" - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set promisc all off") self.vm_testpmd.execute_cmd("set verbose 1") @@ -375,7 +395,7 @@ class TestKernelpfIavf(TestCase): return out def test_vf_vlan_insertion(self): - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) random_vlan = random.randint(1, MAX_VLAN) self.vm_testpmd.execute_cmd("vlan set strip off 0") self.vm_testpmd.execute_cmd("port stop all") @@ -396,7 +416,7 @@ class TestKernelpfIavf(TestCase): def test_vf_vlan_strip(self): random_vlan = random.randint(1, MAX_VLAN) - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("port stop all") self.vm_testpmd.execute_cmd("vlan set filter on 0") self.vm_testpmd.execute_cmd("rx_vlan add %s 0" % random_vlan) @@ -432,7 +452,7 @@ class TestKernelpfIavf(TestCase): def test_vf_vlan_filter(self): random_vlan = random.randint(2, MAX_VLAN) - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("port stop all") self.vm_testpmd.execute_cmd("set promisc all off") self.vm_testpmd.execute_cmd("vlan set filter on 0") @@ -473,7 +493,7 @@ class TestKernelpfIavf(TestCase): def test_vf_rss(self): rss_type = ["ip", "tcp", "udp"] - self.vm_testpmd.start_testpmd("all", "--txq=4 --rxq=4") + self.launch_testpmd(dcf_flag=self.dcf_mode, param="--txq=4 --rxq=4") self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set verbose 1") default_rss_reta = self.vm_testpmd.execute_cmd( @@ -496,7 +516,7 @@ class TestKernelpfIavf(TestCase): def test_vf_rss_hash_key(self): update_hash_key = "1b9d58a4b961d9cd1c56ad1621c3ad51632c16a5d16c21c3513d132c135d132c13ad1531c23a51d6ac49879c499d798a7d949c8a" - self.vm_testpmd.start_testpmd("all", "--txq=4 --rxq=4") + self.launch_testpmd(dcf_flag=self.dcf_mode, param="--txq=4 --rxq=4") self.vm_testpmd.execute_cmd("show port 0 rss-hash key") self.vm_testpmd.execute_cmd("set fwd rxonly") self.vm_testpmd.execute_cmd("set verbose 1") @@ -681,7 +701,7 @@ class TestKernelpfIavf(TestCase): self.tester.send_expect("^C", "#") def test_vf_port_start_stop(self): - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) for i in range(10): self.vm_testpmd.execute_cmd("port stop all") self.vm_testpmd.execute_cmd("port start all") @@ -700,7 +720,7 @@ class TestKernelpfIavf(TestCase): self.verify(vf0_tx_cnt == 100, "no packet was fwd by vm0_VF0") def test_vf_statistic_reset(self): - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set verbose 1") self.vm_testpmd.execute_cmd("start") @@ -722,7 +742,7 @@ class TestKernelpfIavf(TestCase): ) def test_vf_information(self): - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) out = self.vm_testpmd.execute_cmd("show port info 0") self.verify("Link status: up" in out, "link stats has error") self.verify("Link speed: %s" % self.speed in out, "link speed has error") @@ -791,7 +811,7 @@ class TestKernelpfIavf(TestCase): ) def test_vf_unicast(self): - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("set verbose 1") self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set promisc all off") @@ -809,7 +829,7 @@ class TestKernelpfIavf(TestCase): self.verify(packets == 10, "Not receive expected packet") def test_vf_vlan_promisc(self): - self.vm_testpmd.start_testpmd("all") + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm_testpmd.execute_cmd("port stop all") self.vm_testpmd.execute_cmd("set promisc all on") self.vm_testpmd.execute_cmd("set fwd mac") @@ -827,6 +847,7 @@ class TestKernelpfIavf(TestCase): (self.kdriver == "i40e" and self.driver_version < "2.13.10") or (self.kdriver == "i40e" and not self.default_stats) or (self.kdriver == "ice" and not self.default_stats) + or self.dcf_mode ): self.verify(packets == 10, "Not receive expected packet") else: @@ -899,7 +920,10 @@ class TestKernelpfIavf(TestCase): time.sleep(1) if self.running_case == "test_vf_mac_filter": self.destroy_vm_env() - self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") + if not self.dcf_mode: + self.dut.send_expect( + "ip link set dev %s vf 0 trust off" % self.host_intf, "# " + ) def tear_down_all(self): """ diff --git a/tests/TestSuite_stats_checks.py b/tests/TestSuite_stats_checks.py index 7ebb74d5..f81d284e 100644 --- a/tests/TestSuite_stats_checks.py +++ b/tests/TestSuite_stats_checks.py @@ -17,6 +17,7 @@ from typing import Iterator, List, Tuple import framework.packet as packet import framework.utils as utils from framework.pmd_output import PmdOutput +from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting from framework.test_case import TestCase ETHER_HEADER_LEN = 18 @@ -241,6 +242,7 @@ class TestStatsChecks(TestCase): self.verify(len(self.dut_ports) >= 2, "Insufficient ports") self.rx_port = self.dut_ports[0] self.tx_port = self.dut_ports[1] + self.rx_intf = self.dut.ports_info[self.rx_port]["intf"] cores = self.dut.get_core_list("1S/2C/1T") self.coremask = utils.create_mask(cores) @@ -248,6 +250,7 @@ class TestStatsChecks(TestCase): self.port_mask = utils.create_mask([self.rx_port, self.tx_port]) self.pmdout = PmdOutput(self.dut) + self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) def set_up(self): """ @@ -271,6 +274,20 @@ class TestStatsChecks(TestCase): """ self.dut.kill_all() + def launch_testpmd(self, **kwargs): + dcf_flag = kwargs.get("dcf_flag") + param = kwargs.get("param") if kwargs.get("param") else "" + if dcf_flag == "enable": + self.pmdout.start_testpmd( + "default", + param=param, + eal_param="-a %s,cap=dcf" % self.vf_port_pci, + ) + else: + self.pmdout.start_testpmd( + "default", param=param, eal_param="-a %s" % self.vf_port_pci + ) + def test_stats_checks(self): self.pmdout.start_testpmd("Default") self.exec("port start all") @@ -288,10 +305,10 @@ class TestStatsChecks(TestCase): def test_xstats_check_vf(self): self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1, self.kdriver) + if self.dcf_mode: + self.dut.send_expect("ip link set %s vf 0 trust on" % (self.rx_intf), "# ") self.vf_port = self.dut.ports_info[self.dut_ports[0]]["vfs_port"][0] self.vf_port.bind_driver(driver="vfio-pci") self.vf_port_pci = self.dut.ports_info[self.dut_ports[0]]["sriov_vfs_pci"][0] - self.pmdout.start_testpmd( - "default", "--rxq=4 --txq=4", eal_param="-a %s" % self.vf_port_pci - ) + self.launch_testpmd(dcf_flag=self.dcf_mode, param="--txq=4 --rxq=4") self.xstats_check(0, 0, if_vf=True) diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py index c2007999..dc4e1098 100644 --- a/tests/TestSuite_vf_macfilter.py +++ b/tests/TestSuite_vf_macfilter.py @@ -6,6 +6,7 @@ import re import time from framework.pmd_output import PmdOutput +from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting from framework.test_case import TestCase from framework.virt_common import VM @@ -34,6 +35,7 @@ class TestVfMacFilter(TestCase): else: self.vf_assign_method = "vfio-pci" self.dut.send_expect("modprobe vfio-pci", "#") + self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) def set_up(self): @@ -50,10 +52,15 @@ class TestVfMacFilter(TestCase): self.dut.send_expect( "ip link set %s vf 0 mac %s" % (pf_intf0, self.pf0_vf0_mac), "#" ) + if self.dcf_mode == "enable": + self.dut.send_expect("ip link set %s vf 0 trust on" % (pf_intf0), "# ") self.used_dut_port_1 = self.dut_ports[1] self.dut.generate_sriov_vfs_by_port(self.used_dut_port_1, 1, driver=driver) self.sriov_vfs_port_1 = self.dut.ports_info[self.used_dut_port_1]["vfs_port"] + pf_intf1 = self.dut.ports_info[1]["port"].get_interface_name() + if self.dcf_mode == "enable": + self.dut.send_expect("ip link set %s vf 0 trust on" % (pf_intf1), "# ") try: @@ -89,6 +96,9 @@ class TestVfMacFilter(TestCase): raise Exception("Set up VM0 ENV failed!") self.setup_2pf_2vf_1vm_env_flag = 1 + self.vf0_guest_pci = self.vm0.pci_maps[0]["guestpci"] + self.vf1_guest_pci = self.vm0.pci_maps[1]["guestpci"] + except Exception as e: self.destroy_2pf_2vf_1vm_env() raise Exception(e) @@ -128,6 +138,22 @@ class TestVfMacFilter(TestCase): self.setup_2pf_2vf_1vm_env_flag = 0 + def launch_testpmd(self, **kwargs): + dcf_flag = kwargs.get("dcf_flag") + param = kwargs.get("param") if kwargs.get("param") else "" + if dcf_flag == "enable": + self.vm0_testpmd.start_testpmd( + VM_CORES_MASK, + param=param, + ports=[self.vf0_guest_pci, self.vf1_guest_pci], + port_options={ + self.vf0_guest_pci: "cap=dcf", + self.vf1_guest_pci: "cap=dcf", + }, + ) + else: + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, param=param) + def test_kernel_2pf_2vf_1vm_iplink_macfilter(self): """ test case for kernel pf and dpdk vf 2pf_2vf_1vm MAC filter @@ -145,7 +171,7 @@ class TestVfMacFilter(TestCase): self.host_testpmd.execute_cmd("set vf mac addr 0 0 %s" % self.pf0_vf0_mac) self.vm0_dut_ports = self.vm_dut_0.get_ports("any") self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) # Get VF's MAC pmd_vf0_mac = self.vm0_testpmd.get_port_mac(0) self.vm0_testpmd.execute_cmd("set promisc all off") @@ -242,7 +268,7 @@ class TestVfMacFilter(TestCase): def send_packet_and_verify(self): self.vm0_dut_ports = self.vm_dut_0.get_ports("any") self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) # Get VF0 port MAC address pmd_vf0_mac = self.vm0_testpmd.get_port_mac(0) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index eee77c69..c70b24f4 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -9,7 +9,7 @@ import time import framework.utils as utils from framework.crb import Crb from framework.pmd_output import PmdOutput -from framework.settings import HEADER_SIZE +from framework.settings import DPDK_DCFMODE_SETTING, HEADER_SIZE, load_global_setting from framework.test_case import TestCase from framework.utils import GREEN, RED from framework.virt_common import VM @@ -39,6 +39,7 @@ class TestVfOffload(TestCase): else: self.vf_assign_method = "vfio-pci" self.dut.send_expect("modprobe vfio-pci", "#") + self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) self.setup_2pf_2vf_1vm_env_flag = 0 self.setup_2pf_2vf_1vm_env(driver="") @@ -131,6 +132,8 @@ class TestVfOffload(TestCase): self.vm_dut_0 = self.vm0.start() if self.vm_dut_0 is None: raise Exception("Set up VM0 ENV failed!") + self.vf0_guest_pci = self.vm0.pci_maps[0]["guestpci"] + self.vf1_guest_pci = self.vm0.pci_maps[1]["guestpci"] self.setup_2pf_2vf_1vm_env_flag = 1 except Exception as e: @@ -169,6 +172,22 @@ class TestVfOffload(TestCase): self.setup_2pf_2vf_1vm_env_flag = 0 + def launch_testpmd(self, **kwargs): + dcf_flag = kwargs.get("dcf_flag") + param = kwargs.get("param") if kwargs.get("param") else "" + if dcf_flag == "enable": + self.vm0_testpmd.start_testpmd( + VM_CORES_MASK, + param=param, + ports=[self.vf0_guest_pci, self.vf1_guest_pci], + port_options={ + self.vf0_guest_pci: "cap=dcf", + self.vf1_guest_pci: "cap=dcf", + }, + ) + else: + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, param=param) + def checksum_enablehw(self, port, dut): dut.send_expect("port stop all", "testpmd>") dut.send_expect("csum set ip hw %d" % port, "testpmd>") @@ -290,9 +309,9 @@ class TestVfOffload(TestCase): can rx it and report the checksum error, verify forwarded packets have correct checksum. """ - self.vm0_testpmd.start_testpmd( - VM_CORES_MASK, - "--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", ) self.vm0_testpmd.execute_cmd("set fwd csum") self.vm0_testpmd.execute_cmd("set promisc 1 on") @@ -351,9 +370,10 @@ class TestVfOffload(TestCase): Enable SW checksum offload. Send same packet with incorrect checksum and verify checksum is valid. """ - self.vm0_testpmd.start_testpmd( - VM_CORES_MASK, - "--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", ) self.vm0_testpmd.execute_cmd("set fwd csum") self.vm0_testpmd.execute_cmd("set promisc 1 on") @@ -491,9 +511,11 @@ class TestVfOffload(TestCase): ) self.portMask = utils.create_mask([self.vm0_dut_ports[0]]) - self.vm0_testpmd.start_testpmd( - VM_CORES_MASK, - "--portmask=0x3 " + "--enable-rx-cksum " + "--max-pkt-len=%s" % TSO_MTU, + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--portmask=0x3 " + + "--enable-rx-cksum " + + "--max-pkt-len=%s" % TSO_MTU, ) mac = self.vm0_testpmd.get_port_mac(0) diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py index 3c97e1fe..058d53db 100644 --- a/tests/TestSuite_vf_rss.py +++ b/tests/TestSuite_vf_rss.py @@ -15,6 +15,7 @@ reta_entries = [] reta_lines = [] from framework.pmd_output import PmdOutput +from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting # Use scapy to send packets with different source and dest ip. # and collect the hash result of five tuple and the queue id. @@ -289,6 +290,7 @@ class TestVfRss(TestCase): self.vm0 = None self.host_testpmd = None self.setup_1pf_1vf_1vm_env_flag = 0 + self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) self.setup_1pf_1vf_1vm_env(driver="") def set_up(self): @@ -302,6 +304,9 @@ class TestVfRss(TestCase): self.used_dut_port_0 = self.dut_ports[0] self.dut.generate_sriov_vfs_by_port(self.used_dut_port_0, 1, driver=driver) self.sriov_vfs_port_0 = self.dut.ports_info[self.used_dut_port_0]["vfs_port"] + pf_intf0 = self.dut.ports_info[0]["port"].get_interface_name() + if self.dcf_mode == "enable": + self.dut.send_expect("ip link set %s vf 0 trust on" % (pf_intf0), "# ") try: for port in self.sriov_vfs_port_0: @@ -322,6 +327,7 @@ class TestVfRss(TestCase): self.vm_dut_0 = self.vm0.start() if self.vm_dut_0 is None: raise Exception("Set up VM0 ENV failed!") + self.vf0_guest_pci = self.vm0.pci_maps[0]["guestpci"] self.vm0_testpmd = PmdOutput(self.vm_dut_0) @@ -357,6 +363,24 @@ class TestVfRss(TestCase): self.setup_1pf_2vf_1vm_env_flag = 0 + def launch_testpmd(self, **kwargs): + dcf_flag = kwargs.get("dcf_flag") + param = kwargs.get("param") if kwargs.get("param") else "" + if dcf_flag == "enable": + self.vm0_testpmd.start_testpmd( + "all", + param=param, + ports=[self.vf0_guest_pci], + port_options={self.vf0_guest_pci: "cap=dcf"}, + socket=self.vm0_ports_socket, + ) + else: + self.vm0_testpmd.start_testpmd( + "all", + param=param, + socket=self.vm0_ports_socket, + ) + def test_vf_pmdrss_reta(self): vm0dutPorts = self.vm_dut_0.get_ports("any") @@ -381,12 +405,10 @@ class TestVfRss(TestCase): eal_param = "" for queue in testQueues: - self.vm0_testpmd.start_testpmd( - "all", - "--rxq=%d --txq=%d %s" % (queue, queue, eal_param), - socket=self.vm0_ports_socket, + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--rxq=%d --txq=%d %s" % (queue, queue, eal_param), ) - for iptype, rss_type in list(iptypes.items()): self.vm_dut_0.send_expect("set verbose 8", "testpmd> ") self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ") @@ -453,10 +475,9 @@ class TestVfRss(TestCase): # test with different rss queues for queue in testQueues: - self.vm0_testpmd.start_testpmd( - "all", - "--rxq=%d --txq=%d %s" % (queue, queue, eal_param), - socket=self.vm0_ports_socket, + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--rxq=%d --txq=%d %s" % (queue, queue, eal_param), ) for iptype, rsstype in list(iptypes.items()): diff --git a/tests/TestSuite_vf_smoke.py b/tests/TestSuite_vf_smoke.py index b19160c6..9faba9dd 100644 --- a/tests/TestSuite_vf_smoke.py +++ b/tests/TestSuite_vf_smoke.py @@ -4,6 +4,7 @@ from framework.packet import Packet from framework.pmd_output import PmdOutput +from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting from framework.test_case import TestCase from .smoke_base import ( @@ -60,11 +61,16 @@ class TestVfSmoke(TestCase): self.vf0_prop = {"opt_host": self.vf_ports[0].pci} self.dut.send_expect("ifconfig %s up" % self.pf_interface, "# ") self.tester.send_expect("ifconfig %s up" % self.smoke_tester_nic, "# ") + self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) # set vf mac address self.dut.send_expect( "ip link set %s vf 0 mac %s" % (self.pf_interface, self.smoke_dut_mac), "# " ) + if self.dcf_mode == "enable": + self.dut.send_expect( + "ip link set %s vf 0 trust on" % (self.pf_interface), "# " + ) # set default app parameter if self.vf0_prop is not None: @@ -100,7 +106,17 @@ class TestVfSmoke(TestCase): self.vf_launch_dpdk_app() def vf_launch_dpdk_app(self): - self.pmd_out.start_testpmd(cores=self.cores, ports=self.ports, param=self.param) + if self.dcf_mode == "enable": + self.pmd_out.start_testpmd( + cores=self.cores, + ports=self.ports, + port_options={port: "cap=dcf" for port in self.ports}, + param=self.param, + ) + else: + self.pmd_out.start_testpmd( + cores=self.cores, ports=self.ports, param=self.param + ) # set default param self.dut.send_expect("set promisc all off", "testpmd> ") diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py index 31826db5..d5a29c04 100644 --- a/tests/TestSuite_vf_vlan.py +++ b/tests/TestSuite_vf_vlan.py @@ -9,7 +9,7 @@ import time import framework.utils as utils from framework.packet import Packet from framework.pmd_output import PmdOutput -from framework.settings import get_nic_name +from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting from framework.test_case import TestCase from framework.virt_common import VM @@ -48,6 +48,7 @@ class TestVfVlan(TestCase): # get priv-flags default stats self.flag = "vf-vlan-pruning" self.default_stats = self.dut.get_priv_flags_state(self.host_intf0, self.flag) + self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) def set_up(self): self.setup_vm_env() @@ -87,6 +88,10 @@ class TestVfVlan(TestCase): self.dut.send_expect( "ip link set %s vf 0 mac %s" % (self.host_intf0, self.vf0_mac), "# " ) + if self.dcf_mode: + self.dut.send_expect( + "ip link set %s vf 0 trust on" % (self.host_intf0), "# " + ) self.used_dut_port_1 = self.dut_ports[1] self.host_intf1 = self.dut.ports_info[self.used_dut_port_1]["intf"] @@ -103,6 +108,10 @@ class TestVfVlan(TestCase): self.dut.send_expect( "ip link set %s vf 0 mac %s" % (self.host_intf1, self.vf1_mac), "# " ) + if self.dcf_mode: + self.dut.send_expect( + "ip link set %s vf 0 trust on" % (self.host_intf1), "# " + ) try: @@ -123,6 +132,8 @@ class TestVfVlan(TestCase): self.vm_dut_0 = self.vm0.start() if self.vm_dut_0 is None: raise Exception("Set up VM0 ENV failed!") + self.vf0_guest_pci = self.vm0.pci_maps[0]["guestpci"] + self.vf1_guest_pci = self.vm0.pci_maps[1]["guestpci"] except Exception as e: self.destroy_vm_env() @@ -155,6 +166,22 @@ class TestVfVlan(TestCase): self.env_done = False + def launch_testpmd(self, **kwargs): + dcf_flag = kwargs.get("dcf_flag") + param = kwargs.get("param") if kwargs.get("param") else "" + if dcf_flag: + self.vm0_testpmd.start_testpmd( + VM_CORES_MASK, + ports=[self.vf0_guest_pci, self.vf1_guest_pci], + param=param, + port_options={ + self.vf0_guest_pci: "cap=dcf", + self.vf1_guest_pci: "cap=dcf", + }, + ) + else: + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, param=param) + def test_pvid_vf_tx(self): """ Add port based vlan on vf device and check vlan tx work @@ -170,7 +197,7 @@ class TestVfVlan(TestCase): self.vm0_dut_ports = self.vm_dut_0.get_ports("any") self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm0_testpmd.execute_cmd("set fwd mac") self.vm0_testpmd.execute_cmd("start") @@ -214,7 +241,7 @@ class TestVfVlan(TestCase): self.vm0_dut_ports = self.vm_dut_0.get_ports("any") self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm0_testpmd.execute_cmd("set fwd rxonly") self.vm0_testpmd.execute_cmd("set verbose 1") self.vm0_testpmd.execute_cmd("start") @@ -240,7 +267,7 @@ class TestVfVlan(TestCase): # restart testpmd self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm0_testpmd.execute_cmd("set fwd rxonly") self.vm0_testpmd.execute_cmd("set verbose 1") self.vm0_testpmd.execute_cmd("start") @@ -250,6 +277,7 @@ class TestVfVlan(TestCase): (self.kdriver == "i40e" and self.driver_version < "2.13.10") or (self.kdriver == "i40e" and not self.default_stats) or (self.kdriver == "ice" and not self.default_stats) + or self.dcf_mode ): self.verify("received" in out, "Failed to received vlan packet!!!") else: @@ -291,7 +319,7 @@ class TestVfVlan(TestCase): self.vm0_dut_ports = self.vm_dut_0.get_ports("any") self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm0_testpmd.execute_cmd("set verbose 1") for tx_vlan in tx_vlans: @@ -316,7 +344,7 @@ class TestVfVlan(TestCase): self.vm0_dut_ports = self.vm_dut_0.get_ports("any") self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm0_testpmd.execute_cmd("set fwd rxonly") self.vm0_testpmd.execute_cmd("set verbose 1") self.vm0_testpmd.execute_cmd("vlan set strip on 0") @@ -395,10 +423,7 @@ class TestVfVlan(TestCase): self.vm0_dut_ports = self.vm_dut_0.get_ports("any") self.vm0_testpmd = PmdOutput(self.vm_dut_0) - if self.kdriver == "i40e": - self.vm0_testpmd.start_testpmd(VM_CORES_MASK, "") - else: - self.vm0_testpmd.start_testpmd(VM_CORES_MASK) + self.launch_testpmd(dcf_flag=self.dcf_mode) self.vm0_testpmd.execute_cmd("set fwd rxonly") self.vm0_testpmd.execute_cmd("set verbose 1") self.vm0_testpmd.execute_cmd("start")