From patchwork Thu Jul 29 06:16:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 96366 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 50C62A0C43; Thu, 29 Jul 2021 08:16:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2101040DFB; Thu, 29 Jul 2021 08:16:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id DD90F40687 for ; Thu, 29 Jul 2021 08:16:56 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10059"; a="200028951" X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="200028951" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2021 23:16:55 -0700 X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="476213796" Received: from odcacrnlx2.sh.intel.com ([10.240.183.163]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 28 Jul 2021 23:16:51 -0700 From: Yu Jiang To: dts@dpdk.org Cc: Yu Jiang Date: Thu, 29 Jul 2021 14:16:22 +0800 Message-Id: <1627539383-26588-2-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1627539383-26588-1-git-send-email-yux.jiang@intel.com> References: <1627539383-26588-1-git-send-email-yux.jiang@intel.com> Subject: [dts] [PATCH V1 1/2] test_plans/rxtx_offload: add tx offload multi_segs setting 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 Sender: "dts" add tx offload multi_segs setting Signed-off-by: Yu Jiang Acked-by: Xueqin Lin --- test_plans/rxtx_offload_test_plan.rst | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/test_plans/rxtx_offload_test_plan.rst b/test_plans/rxtx_offload_test_plan.rst index 246e1e1..962ee9f 100644 --- a/test_plans/rxtx_offload_test_plan.rst +++ b/test_plans/rxtx_offload_test_plan.rst @@ -677,3 +677,59 @@ Test case: FVL Tx offload per-queue setting Note 1: there is no tx_offload per_queue parameter in ixgbe driver, so this case is just only for i40e. + +Test case: Tx offload multi_segs setting +====================================================== + +1. Start testpmd with "--tx-offloads=0x00008000" to enable tx_offload multi_segs :: + + ./testpmd -c 0xf -n 4 -- -i --tx-offloads==0x00008000 + testpmd> show port 0 tx_offload configuration + Tx Offloading Configuration of port 0 : + Port : MULTI_SEGS + Queue[ 0] : MULTI_SEGS + +2. Set fwd to txonly, Set the length of each segment of the TX-ONLY packets, Set the split policy for TX packets, then start to send pkgs:: + + testpmd> set fwd txonly + testpmd> set txpkts 64,64 + testpmd> set txsplit rand + testpmd> start + +3. Check TX-packets will not hang and continue to increase:: + Wait 15s or more, check TX-packets will continue to increase and can be more than 300K + + testpmd> show port stats all + testpmd> stop + testpmd> quit + +4. Start testpmd again without "--tx-offloads", check multi-segs is disabled by default:: + + ./testpmd -c 0xf -n 4 -- -i + testpmd> show port 0 tx_offload configuration + No MULTI_SEGS in Tx Offloading Configuration of ports + +5. Enable tx_offload multi_segs :: + testpmd> port stop all + testpmd> port config 0 tx_offload multi_segs on + testpmd> port config 1 tx_offload multi_segs on + testpmd> port start all + testpmd> show port 0 tx_offload configuration + Tx Offloading Configuration of port 0 : + Port : MULTI_SEGS + Queue[ 0] : MULTI_SEGS + +6. Set fwd to txonly, Set the length of each segment of the TX-ONLY packets, Set the split policy for TX packets, then start to send pkgs:: + + testpmd> set fwd txonly + testpmd> set txpkts 64,64 + testpmd> set txsplit rand + testpmd> start + testpmd> show port stats all + +7. Check TX-packets will not hang and continue to increase:: + Wait 15s or more, check TX-packets will continue to increase and can be more than 300K + + testpmd> show port stats all + testpmd> stop + testpmd> quit From patchwork Thu Jul 29 06:16:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 96367 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 A8F45A0C45; Thu, 29 Jul 2021 08:16:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C8AF410E3; Thu, 29 Jul 2021 08:16:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id A396940687 for ; Thu, 29 Jul 2021 08:16:57 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10059"; a="200028949" X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="200028949" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2021 23:16:55 -0700 X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="476213794" Received: from odcacrnlx2.sh.intel.com ([10.240.183.163]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 28 Jul 2021 23:16:53 -0700 From: Yu Jiang To: dts@dpdk.org Cc: Yu Jiang Date: Thu, 29 Jul 2021 14:16:23 +0800 Message-Id: <1627539383-26588-3-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1627539383-26588-1-git-send-email-yux.jiang@intel.com> References: <1627539383-26588-1-git-send-email-yux.jiang@intel.com> Subject: [dts] [PATCH V1 2/2] tests/rxtx_offload: add test case test_txoffload_port_multi_segs 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 Sender: "dts" add test case test_txoffload_port_multi_segs Signed-off-by: Yu Jiang Tested-by: Yu Jiang Acked-by: Xueqin Lin --- tests/TestSuite_rxtx_offload.py | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/TestSuite_rxtx_offload.py b/tests/TestSuite_rxtx_offload.py index 0e70526..48fb739 100644 --- a/tests/TestSuite_rxtx_offload.py +++ b/tests/TestSuite_rxtx_offload.py @@ -209,6 +209,26 @@ class TestRxTx_Offload(TestCase): acl_offload = offloads[offload[i]] self.verify(acl_offload in queue_line[i], "Fail to configure offload by queue.") i = i + 1 + + def verify_packets_increasing(self, rxtx="tx", count=2): + # Verify RXTX-packets increasing on each ports, check count < 20 + out1 = self.dut.send_expect("show port stats all", "testpmd> ") + i = 0 + while i < count: + if rxtx == "tx": + pks_l1 = re.findall(r'TX-packets: (\w+)', out1) + time.sleep(15) + out1 = self.dut.send_expect("show port stats all", "testpmd> ") + pks_l2 = re.findall(r'TX-packets: (\w+)', out1) + self.logger.info("Times="+ str(i) + ", count=" + str(count) + ", pks2_cur=" + str(pks_l2) + ", pks1_before=" + str(pks_l1)) + for index in range(len(pks_l2)): + self.verify(int(pks_l2[index]) > int(pks_l1[index]), "TX-packets hang") + if int(pks_l1[index]) < 300000000 or int(pks_l2[index]) < 300000000: + count += 1 + i += 1 + if count > 20: + self.verify(False, "Check count timeout") + break def get_queue_number(self, packet): """ @@ -716,6 +736,52 @@ class TestRxTx_Offload(TestCase): offload = ["mbuf_fast_free"] self.check_port_config("tx", offload) + def test_txoffload_port_multi_segs(self): + """ + Tx offload multi_segs setting. + """ + offload = ["multi_segs"] + # Start testpmd with "--tx-offloads=0x00008000" to enable multi_segs tx_offload + self.pmdout.start_testpmd("%s" % self.cores, "--tx-offloads=0x00008000") + for portid in range(len(self.dut_ports)): + self.check_port_config(rxtx="tx", offload=offload, port_id=portid) + + # Set fwd to txonly, Set the length of each segment of the TX-ONLY packets, Set the split policy for TX packets, then start to send pkgs + self.dut.send_expect("set fwd txonly", "testpmd> ") + self.dut.send_expect("set txpkts 64,64", "testpmd> ") + self.dut.send_expect("set txsplit rand", "testpmd> ") + self.dut.send_expect("start", "testpmd> ") + + # Check TX-packets will not hang and continue to increase + self.verify_packets_increasing(rxtx="tx") + self.dut.send_expect("stop", "testpmd> ") + self.dut.send_expect("quit", "# ") + + # Start testpmd again without "--tx-offloads", check multi-segs is disabled by default + self.pmdout.start_testpmd("%s" % self.cores, " ") + for portid in range(len(self.dut_ports)): + outstring = self.dut.send_expect("show port %d tx_offload configuration" % portid, "testpmd> ") + self.verify("MULTI_SEGS" not in outstring, "multi-segs is not disabled by default") + + self.dut.send_expect("port stop all", "testpmd> ") + for portid in range(len(self.dut_ports)): + cmd = "port config {} tx_offload multi_segs on".format(portid) + self.dut.send_expect(cmd, "testpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + for portid in range(len(self.dut_ports)): + self.check_port_config(rxtx="tx", offload=offload, port_id=portid) + + # Set fwd to txonly, Set the length of each segment of the TX-ONLY packets, Set the split policy for TX packets, then start to send pkgs + self.dut.send_expect("set fwd txonly", "testpmd> ") + self.dut.send_expect("set txpkts 64,64", "testpmd> ") + self.dut.send_expect("set txsplit rand", "testpmd> ") + self.dut.send_expect("start", "testpmd> ") + + # Check TX-packets will not hang and continue to increase + self.verify_packets_increasing(rxtx="tx") + self.dut.send_expect("stop", "testpmd> ") + self.dut.send_expect("quit", "# ") + def tear_down(self): """ Run after each test case.