test suite reviews and discussions
 help / color / mirror / Atom feed
* Re: [dts] [PATCH V1 0/3] change method to get maximum number of rules
  2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number of rules sunqin
@ 2021-01-08  6:43 ` Zhao, HaiyangX
  2021-01-08  7:11 ` Sun, QinX
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Zhao, HaiyangX @ 2021-01-08  6:43 UTC (permalink / raw)
  To: Sun, QinX, dts; +Cc: Sun, QinX

Acked-by: Haiyang Zhao <haiyangx.zhao@intel.com>

Best Regards,
Zhao Haiyang

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of sunqin
> Sent: Friday, January 8, 2021 22:20
> To: dts@dpdk.org
> Cc: Sun, QinX <qinx.sun@intel.com>
> Subject: [dts] [PATCH V1 0/3] change method to get maximum number of
> rules

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dts] [PATCH V1 0/3] change method to get maximum number of rules
  2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number of rules 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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Sun, QinX @ 2021-01-08  7:11 UTC (permalink / raw)
  To: Sun, QinX, dts

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Tested-by: Sun, QinX <qinx.sun@intel.com>
 
Regards,
Sun Qin

> -----Original Message-----
> From: sunqin <qinx.sun@intel.com>
> Sent: Friday, January 8, 2021 10:20 PM
> To: dts@dpdk.org
> Cc: Sun, QinX <qinx.sun@intel.com>
> Subject: [dts] [PATCH V1 0/3] change method to get maximum number of rules

[-- Attachment #2: CVLSwitchFilterTest.log --]
[-- Type: application/octet-stream, Size: 2899950 bytes --]

[-- Attachment #3: TestCVLFdir.log --]
[-- Type: application/octet-stream, Size: 2342328 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dts] [PATCH V1 0/3] change method to get maximum number of rules
@ 2021-01-08 14:19 sunqin
  2021-01-08  6:43 ` Zhao, HaiyangX
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sunqin @ 2021-01-08 14:19 UTC (permalink / raw)
  To: dts; +Cc: sunqin

As the addition of CVL Island card, the original method of calculating the 

maximum number of rules is not suitable for all cards.

It needs to start testpmd with log-level=7 to query and calculate.

sunqin (3):
  framework/pmd_output add method to get maximum number of rules
  tests/cvl_switch_filter change method to get maximum number of rules
  tests/cvl_fdir change method to get maximum threshold of rules

 framework/pmd_output.py              |  8 +++++++
 tests/TestSuite_cvl_fdir.py          | 32 +++++++++++-----------------
 tests/TestSuite_cvl_switch_filter.py |  6 +++++-
 3 files changed, 26 insertions(+), 20 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dts] [PATCH V1 1/3] framework/pmd_output add method to get maximum number of rules
  2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number of rules sunqin
  2021-01-08  6:43 ` Zhao, HaiyangX
  2021-01-08  7:11 ` Sun, QinX
@ 2021-01-08 14:19 ` sunqin
  2021-01-08 14:19 ` [dts] [PATCH V1 2/3] tests/cvl_switch_filter change " sunqin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sunqin @ 2021-01-08 14:19 UTC (permalink / raw)
  To: dts; +Cc: sunqin

Add 'get_max_rule_number' method

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dts] [PATCH V1 2/3] tests/cvl_switch_filter change method to get maximum number of rules
  2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number of rules sunqin
                   ` (2 preceding siblings ...)
  2021-01-08 14:19 ` [dts] [PATCH V1 1/3] framework/pmd_output add " sunqin
@ 2021-01-08 14:19 ` sunqin
  2021-01-08 14:19 ` [dts] [PATCH V1 3/3] tests/cvl_fdir change method to get maximum threshold " sunqin
  2021-01-13  7:10 ` [dts] [PATCH V1 0/3] change method to get maximum number " Tu, Lijuan
  5 siblings, 0 replies; 7+ messages in thread
From: sunqin @ 2021-01-08 14:19 UTC (permalink / raw)
  To: dts; +Cc: sunqin

Use 'get_max_rule_number' method to get maximum number of rules

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dts] [PATCH V1 3/3] tests/cvl_fdir change method to get maximum threshold of rules
  2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number of rules sunqin
                   ` (3 preceding siblings ...)
  2021-01-08 14:19 ` [dts] [PATCH V1 2/3] tests/cvl_switch_filter change " sunqin
@ 2021-01-08 14:19 ` sunqin
  2021-01-13  7:10 ` [dts] [PATCH V1 0/3] change method to get maximum number " Tu, Lijuan
  5 siblings, 0 replies; 7+ messages in thread
From: sunqin @ 2021-01-08 14:19 UTC (permalink / raw)
  To: dts; +Cc: sunqin

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dts] [PATCH V1 0/3] change method to get maximum number of rules
  2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number of rules sunqin
                   ` (4 preceding siblings ...)
  2021-01-08 14:19 ` [dts] [PATCH V1 3/3] tests/cvl_fdir change method to get maximum threshold " sunqin
@ 2021-01-13  7:10 ` Tu, Lijuan
  5 siblings, 0 replies; 7+ messages in thread
From: Tu, Lijuan @ 2021-01-13  7:10 UTC (permalink / raw)
  To: Sun, QinX, dts; +Cc: Sun, QinX

> 
> As the addition of CVL Island card, the original method of calculating the
> 
> maximum number of rules is not suitable for all cards.
> 
> It needs to start testpmd with log-level=7 to query and calculate.
> 
> sunqin (3):
>   framework/pmd_output add method to get maximum number of rules
>   tests/cvl_switch_filter change method to get maximum number of rules
>   tests/cvl_fdir change method to get maximum threshold of rules

Applied, please add ":" between prefix and context, e.g. framework/pmd_output: add method to get maximum number of rules

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-13  7:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 14:19 [dts] [PATCH V1 0/3] change method to get maximum number of rules 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 ` [dts] [PATCH V1 3/3] tests/cvl_fdir change method to get maximum threshold " sunqin
2021-01-13  7:10 ` [dts] [PATCH V1 0/3] change method to get maximum number " Tu, Lijuan

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git