From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) -- 2.17.1