From patchwork Fri Jan 8 14:19:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sun, QinX" X-Patchwork-Id: 86170 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 624DAA0524; Fri, 8 Jan 2021 06:45:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D732140E0D; Fri, 8 Jan 2021 06:45:57 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id A7BE5140DFA for ; Fri, 8 Jan 2021 06:45:55 +0100 (CET) IronPort-SDR: cPug/v3G+H5SNxFU/TdIl8e50efZxJEcq8ZwZ3reuOScpMkJenADjoTZMpHBpOQHCP9QNQ+s04 TfgOdHvnemPQ== X-IronPort-AV: E=McAfee;i="6000,8403,9857"; a="174037265" X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="174037265" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 21:45:55 -0800 IronPort-SDR: yWIhGGIlu6hMgNgqo8FM5f+TqzHgbMg2+2TiSKwTt7FMewLErRoH/OxGAxb1AJ78w5Ntf4Vyxu W3YtDlAVFJ+Q== X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="422842649" Received: from unknown (HELO dpdk-wenjielx-tetser203.icx.intel.com) ([10.240.183.105]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 21:45:54 -0800 From: sunqin To: dts@dpdk.org Cc: sunqin Date: Fri, 8 Jan 2021 14:19:51 +0000 Message-Id: <20210108141953.8575-2-qinx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210108141953.8575-1-qinx.sun@intel.com> References: <20210108141953.8575-1-qinx.sun@intel.com> Subject: [dts] [PATCH V1 1/3] framework/pmd_output add method to get maximum number of rules 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 'get_max_rule_number' method Signed-off-by: sunqin --- framework/pmd_output.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/framework/pmd_output.py b/framework/pmd_output.py index 3418efe4..3daa86b6 100644 --- a/framework/pmd_output.py +++ b/framework/pmd_output.py @@ -299,3 +299,11 @@ class PmdOutput(): break sleep(1) return 'down' not in status + + def get_max_rule_number(self,obj,out): + res = re.search(r"fd_fltr_guar\s+=\s+(\d+).*fd_fltr_best_effort\s+=\s+(\d+)\.",out) + obj.verify(res,"'fd_fltr_guar' and 'fd_fltr_best_effort not found'") + fltr_guar,fltr_best = res.group(1),res.group(2) + max_rule = int(fltr_guar) + int(fltr_best) + obj.logger.info(f'this Card max rule number is :{max_rule}') + return max_rule From patchwork Fri Jan 8 14:19:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sun, QinX" X-Patchwork-Id: 86171 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8BEB4A0524; Fri, 8 Jan 2021 06:45:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86F73140E06; Fri, 8 Jan 2021 06:45:58 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 3C176140DFA for ; Fri, 8 Jan 2021 06:45:57 +0100 (CET) IronPort-SDR: tvFqrlltJlR3uxeJ+wPeEY9yIre3mYdkyfHda9wblOCye/f3zpUvWHf/ADcMS8Vb7sEt3HbeXg w2aY85TakzoA== X-IronPort-AV: E=McAfee;i="6000,8403,9857"; a="174037268" X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="174037268" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 21:45:56 -0800 IronPort-SDR: 8fJNlce4gRtR3VXBiE4KGj7JIEmXnpZL6qMGflFYWGSl8xNcJYWOc6l3MLqPIA2P9+3O3hZ4me 7yXfLTOJFI+A== X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="422842658" Received: from unknown (HELO dpdk-wenjielx-tetser203.icx.intel.com) ([10.240.183.105]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 21:45:55 -0800 From: sunqin To: dts@dpdk.org Cc: sunqin Date: Fri, 8 Jan 2021 14:19:52 +0000 Message-Id: <20210108141953.8575-3-qinx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210108141953.8575-1-qinx.sun@intel.com> References: <20210108141953.8575-1-qinx.sun@intel.com> Subject: [dts] [PATCH V1 2/3] tests/cvl_switch_filter change method to get maximum number of rules 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" Use 'get_max_rule_number' method to get maximum number of rules Signed-off-by: sunqin --- tests/TestSuite_cvl_switch_filter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_cvl_switch_filter.py b/tests/TestSuite_cvl_switch_filter.py index 02c9002f..1005f3a2 100644 --- a/tests/TestSuite_cvl_switch_filter.py +++ b/tests/TestSuite_cvl_switch_filter.py @@ -4525,6 +4525,7 @@ class CVLSwitchFilterTest(TestCase): #bind pf to vfio-pci self.dut.send_expect('modprobe vfio-pci', '#') self.bind_nics_driver(self.dut_ports, driver="vfio-pci") + self.pmd = PmdOutput(self.dut) self.generate_file_with_fdir_rules() self.path = self.dut.apps_name['test-pmd'] @@ -4547,7 +4548,10 @@ class CVLSwitchFilterTest(TestCase): """ generate file with fdir rules to make fdir table full, then test switch filter """ - self.fdir_rule_number = 14336 + int(2048/(len(self.dut_ports))) + pf_pci = self.dut.ports_info[0]['pci'] + out = self.pmd.start_testpmd('default', eal_param='-a %s --log-level=ice,7'%pf_pci) + self.dut.send_expect("quit", "# ") + self.fdir_rule_number = self.pmd.get_max_rule_number(self,out) src_file = 'dep/testpmd_cmds_rte_flow_fdir_rules' flows = open(src_file, mode='w') rule_count = 1 From patchwork Fri Jan 8 14:19:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sun, QinX" X-Patchwork-Id: 86172 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE69FA0524; Fri, 8 Jan 2021 06:45:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8D81140E1D; Fri, 8 Jan 2021 06:45:59 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id D8BAD140E1D for ; Fri, 8 Jan 2021 06:45:58 +0100 (CET) IronPort-SDR: O18BYBhHbKojZXdrZrDMLmYFdpcx5gXosfDV9oZ4e9HGf3AMx9Zep9doBvl35ps7WfWhc4pXBE P/CPQn15t05Q== X-IronPort-AV: E=McAfee;i="6000,8403,9857"; a="174037270" X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="174037270" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 21:45:58 -0800 IronPort-SDR: 1tQZiGNgGpeyTx1XDzD4R0juPQgobkp3wgIS5pMElLkRnx1bL+oqhMfzX4aeTabqou6hG7yrUH GxWGriJsfWwQ== X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="422842668" Received: from unknown (HELO dpdk-wenjielx-tetser203.icx.intel.com) ([10.240.183.105]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 21:45:57 -0800 From: sunqin To: dts@dpdk.org Cc: sunqin Date: Fri, 8 Jan 2021 14:19:53 +0000 Message-Id: <20210108141953.8575-4-qinx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210108141953.8575-1-qinx.sun@intel.com> References: <20210108141953.8575-1-qinx.sun@intel.com> Subject: [dts] [PATCH V1 3/3] tests/cvl_fdir change method to get maximum threshold of rules 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" Use 'get_max_rule_number' method to get maximum number of rules. Signed-off-by: sunqin --- tests/TestSuite_cvl_fdir.py | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tests/TestSuite_cvl_fdir.py b/tests/TestSuite_cvl_fdir.py index 31bdfc7d..ca16c137 100644 --- a/tests/TestSuite_cvl_fdir.py +++ b/tests/TestSuite_cvl_fdir.py @@ -2264,6 +2264,10 @@ class TestCVLFdir(TestCase): self.pkt = Packet() self.pmd_output = PmdOutput(self.dut) + pf_pci = self.dut.ports_info[0]['pci'] + out = self.pmd_output.start_testpmd('default', eal_param='-a %s --log-level=ice,7'%pf_pci) + self.dut.send_expect("quit", "# ") + self.max_rule_num = self.pmd_output.get_max_rule_number(self, out) self.launch_testpmd_with_mark() def set_up(self): @@ -3070,24 +3074,14 @@ class TestCVLFdir(TestCase): # and there are 14k rules shared by pfs and vfs # so 1 pf and 2 vfs can create 15360 rules at most on 2 ports card # 1 pf and 2 vfs can create 14848 rules at most on 4 ports card - if self.nic in ['columbiaville_100g']: - rule_li = list(map(str, range(15360))) - pkts = ['Ether(dst="00:11:22:33:44:55")/IP(src="192.168.100.20",dst="192.168.0.0")/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55")/IP(src="192.168.100.20",dst="192.168.59.255")/Raw("x" * 80)'] - for i in range(60): - for j in range(256): - rules.append(rule_pattern % (i, j)) - pkts2.append(pkt_pattern % (i, j)) - elif self.nic in ['columbiaville_25g']: - rule_li = list(map(str, range(14848))) - pkts = ['Ether(dst="00:11:22:33:44:55")/IP(src="192.168.100.20",dst="192.168.0.0")/Raw("x" * 80)', - 'Ether(dst="00:11:22:33:44:55")/IP(src="192.168.100.20",dst="192.168.57.255")/Raw("x" * 80)'] - for i in range(58): - for j in range(256): - rules.append(rule_pattern % (i, j)) - pkts2.append(pkt_pattern % (i, j)) - else: - raise Exception('%s not supported by this case' % self.nic) + count = int(self.max_rule_num/256) + rule_li = list(map(str, range(self.max_rule_num))) + pkts = ['Ether(dst="00:11:22:33:44:55")/IP(src="192.168.100.20",dst="192.168.0.0")/Raw("x" * 80)', + 'Ether(dst="00:11:22:33:44:55")/IP(src="192.168.100.20",dst="192.168.%s.255")/Raw("x" * 80)'%(count-1)] + for i in range(count): + for j in range(256): + rules.append(rule_pattern % (i, j)) + pkts2.append(pkt_pattern % (i, j)) cmd_path = '/tmp/test_max_rules' cmd_li = map(lambda x: x + os.linesep, rules) with open(cmd_path, 'w') as f: @@ -3104,7 +3098,7 @@ class TestCVLFdir(TestCase): self.verify('Failed to create flow' not in out, "create some rule failed") self.config_testpmd() self.pmd_output.execute_cmd('start') - rule = "flow create 0 ingress pattern eth / ipv4 src is 192.168.100.20 dst is 192.168.60.0 / end actions queue index 1 / mark / end" + rule = "flow create 0 ingress pattern eth / ipv4 src is 192.168.100.20 dst is 192.168.65.0 / end actions queue index 1 / mark / end" self.create_fdir_rule(rule=rule, check_stats=False, msg='Failed to create flow', validate=False) self.check_fdir_rule(port_id=0, stats=True, rule_list=rule_li) out1 = self.send_pkts_getouput(pkts=pkts, port_id=0, count=1)