From patchwork Thu Feb 9 10:34:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 123489 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 1CBAC41C48; Thu, 9 Feb 2023 03:15:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C580041611; Thu, 9 Feb 2023 03:15:23 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 92E984067B for ; Thu, 9 Feb 2023 03:15:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675908922; x=1707444922; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=qHUDwN23tBHlvdvPlCUTZDYZ4+gExhffyIKQeOjC9TM=; b=enCrNsIxKBdrpPAHuhivwN/VIWDzsYFdM1a5SIoJ9xW/G/243FN1in/a +60tvjDdinURqCsfOhrGuCB2+sRFWSS5fkBGDBjDBKGMCvF2R1g1reTq/ KgCfrdW9YIxXrTwuIkFphPpIWX7IwMsWcg9sepui+66mAmTh8nHh0tG5O Ytt4FKNwy5TDkF1TljSrRZJgarI6ufbiidLxar1mzUt2u+bST/hKb/Nlz VeromgE3ToGFXx9tOXFD1lwxnHBsHtn7IAFKvNo2c7Ed4xelSO1HUCH27 qujtBnBi2CQJ+Xoo5+BM7ruqz0o4bzxuHBRYCzoYQd2Rq1V0w0ecTYZfT A==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="332111751" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="332111751" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 18:15:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="669419480" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="669419480" Received: from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 18:15:13 -0800 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V1 2/2] tests/large_vf: modify script to adapt to changes in dpdk Date: Thu, 9 Feb 2023 18:34:35 +0800 Message-Id: <20230209103435.2106-2-hongbox.li@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230209103435.2106-1-hongbox.li@intel.com> References: <20230209103435.2106-1-hongbox.li@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 1.after dpdk is modified, if all ports fail to start, dpdk still allows testpmd to enter the command line, instead of unconditionally terminating testpmd. According to dpdk commit 7e40372522c("app/testpmd: fix interactive mode with no ports"). 2.after driver is modified, the default RX rings available decreased(now from SW4.2 default number of queues are created according to the single NUMA CPU cores), so modify script to adapt. Signed-off-by: Hongbo Li --- tests/TestSuite_large_vf.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_large_vf.py b/tests/TestSuite_large_vf.py index 4e2ff1d6..fb03145e 100644 --- a/tests/TestSuite_large_vf.py +++ b/tests/TestSuite_large_vf.py @@ -110,8 +110,7 @@ different_queues_switch = { pf_large_vf_fdir_coexist = { "name": "test_pf_large_vf_fdir_coexist", - "param": [21, 63], - "check_param": (54, 63), + "param": [21], "count": 1, } @@ -124,7 +123,7 @@ exceed_256_queues = { more_than_3_vfs_256_queues = { "name": "test_more_than_3_vfs_256_queues", "param": "--txq=256 --rxq=256", - "check_param": "Cause: Start ports failed", + "check_param": "Start ports failed", } max_vfs_256_queues_3 = [ @@ -296,6 +295,7 @@ class TestLargeVf(TestCase): def rte_flow_process(self, vectors): test_results = {} + self.rule_num = [] for tv in vectors: try: subcase_name = tv["name"] @@ -322,14 +322,14 @@ class TestLargeVf(TestCase): self.pmdout_list[0], self.pf0_intf, tv["param"][0], - tv["param"][1], + self.max_ring_num - 1, ) self.send_pkts_pf_check( self.pmdout_list[0], self.pf0_intf, self.pf0_mac, tv["param"][0], - tv["check_param"], + self.rule_num, tv["count"], ) self.create_fdir_rule(vectors[0]["rule"]) @@ -373,11 +373,14 @@ class TestLargeVf(TestCase): + "-- -i " + tv["param"] ) - out = self.pmd_output.execute_cmd(cmd, "#") + out = self.pmd_output.execute_cmd( + cmd, "testpmd> ", timeout=30 + ) self.verify( tv["check_param"] in out, "fail: testpmd start successfully", ) + self.pmd_output.quit() self.pmdout_list[0].execute_cmd("quit", "# ") break else: @@ -399,11 +402,12 @@ class TestLargeVf(TestCase): + "-- -i " + tv["param"] ) - out = self.pmd_output.execute_cmd(cmd, "#") + out = self.pmd_output.execute_cmd(cmd, "testpmd> ") self.verify( tv["check_param"] in out, "fail: testpmd start successfully", ) + self.pmd_output.quit() # quit all testpmd self.pmdout_list[0].execute_cmd("quit", "# ") self.pmdout_list[1].execute_cmd("quit", "# ") @@ -515,6 +519,7 @@ class TestLargeVf(TestCase): pf_intf, ip, action ) pmdout.execute_cmd(cmd, "#") + self.rule_num.append(action) ip += 1 action -= 1 self.validation_pf_rule(pmdout, pf_intf, 10) @@ -534,7 +539,7 @@ class TestLargeVf(TestCase): ip += 1 time.sleep(1) out = pmdout.execute_cmd("ethtool -S %s" % pf_intf, "# ") - for queue in range(check_param[0], check_param[1] + 1): + for queue in check_param: packet_str = "rx_queue_%d_packets: (\d+)" % queue packet = re.search(packet_str, out).group(1) self.verify( @@ -544,8 +549,10 @@ class TestLargeVf(TestCase): def destroy_pf_rule(self, pmdout, pf_intf): rule_str = "Filter:.*?(\d+)" + max_ring_str = "(\d+) RX rings available" out = pmdout.execute_cmd("ethtool -n %s" % pf_intf, "#") rule_list = re.findall(rule_str, out) + self.max_ring_num = int(re.search(max_ring_str, out).group(1)) if rule_list: for rule in rule_list: cmd = "ethtool -N {} delete {}".format(pf_intf, rule)