test suite reviews and discussions
 help / color / mirror / Atom feed
From: sunqin <qinx.sun@intel.com>
To: dts@dpdk.org
Cc: sunqin <qinx.sun@intel.com>
Subject: [dts] [PATCH V1 3/3] tests/cvl_fdir change method to get maximum threshold of rules
Date: Fri,  8 Jan 2021 14:19:53 +0000	[thread overview]
Message-ID: <20210108141953.8575-4-qinx.sun@intel.com> (raw)
In-Reply-To: <20210108141953.8575-1-qinx.sun@intel.com>

Use 'get_max_rule_number' method to get maximum number of rules.

Signed-off-by: sunqin <qinx.sun@intel.com>
---
 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


  parent reply	other threads:[~2021-01-08  5:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number " sunqin
2021-01-08  6:43 ` Zhao, HaiyangX
2021-01-08  7:11 ` Sun, QinX
2021-01-08 14:19 ` [dts] [PATCH V1 1/3] framework/pmd_output add " sunqin
2021-01-08 14:19 ` [dts] [PATCH V1 2/3] tests/cvl_switch_filter change " sunqin
2021-01-08 14:19 ` sunqin [this message]
2021-01-13  7:10 ` [dts] [PATCH V1 0/3] " Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210108141953.8575-4-qinx.sun@intel.com \
    --to=qinx.sun@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).