[V1] tests/kernelpf_iavf: case vf_rss optimization test result check

Message ID 20220922015910.25797-1-weiyuanx.li@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/kernelpf_iavf: case vf_rss optimization test result check |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test fail Testing issues

Commit Message

Weiyuan Li Sept. 22, 2022, 1:59 a.m. UTC
  Optimize test result inspection according to test plan.
Calculate whether the allocated queue result is correct according to the
returned hash.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
 tests/TestSuite_kernelpf_iavf.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
  

Comments

Lingli Chen Sept. 22, 2022, 2:35 a.m. UTC | #1
> -----Original Message-----
> From: Weiyuan Li <weiyuanx.li@intel.com>
> Sent: Thursday, September 22, 2022 9:59 AM
> To: dts@dpdk.org
> Cc: Li, WeiyuanX <weiyuanx.li@intel.com>
> Subject: [dts][PATCH V1] tests/kernelpf_iavf: case vf_rss optimization test
> result check
> 
> Optimize test result inspection according to test plan.
> Calculate whether the allocated queue result is correct according to the
> returned hash.
> 
> Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
> ---

Tested-by: Lingli Chen <linglix.chen@intel.com>
  
Peng, Yuan Sept. 30, 2022, 5:41 a.m. UTC | #2
Acked-by: Peng, Yuan <yuan.peng@intel.com>

-----Original Message-----
From: Weiyuan Li <weiyuanx.li@intel.com> 
Sent: Thursday, September 22, 2022 9:59 AM
To: dts@dpdk.org
Cc: Li, WeiyuanX <weiyuanx.li@intel.com>
Subject: [dts][PATCH V1] tests/kernelpf_iavf: case vf_rss optimization test result check

Optimize test result inspection according to test plan.
Calculate whether the allocated queue result is correct according to the returned hash.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
  
Tu, Lijuan Oct. 10, 2022, 3:20 a.m. UTC | #3
On Thu, 22 Sep 2022 09:59:10 +0800, Weiyuan Li <weiyuanx.li@intel.com> wrote:
> Optimize test result inspection according to test plan.
> Calculate whether the allocated queue result is correct according to the
> returned hash.
> 
> Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks
  

Patch

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index a6d4d016..a8cc468a 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -528,11 +528,7 @@  class TestKernelpfIavf(TestCase):
         return pkt_info
 
     def verify_packet_number(self, out):
-        queue0_number = len(re.findall("port 0/queue 0", out))
-        queue1_number = len(re.findall("port 0/queue 1", out))
-        queue2_number = len(re.findall("port 0/queue 2", out))
-        queue3_number = len(re.findall("port 0/queue 3", out))
-        queue_numbers = [queue0_number, queue1_number, queue2_number, queue3_number]
+        queue_number = len(re.findall("port 0", out))
         self.verify(
             "queue 0" in out
             and "queue 1" in out
@@ -540,10 +536,19 @@  class TestKernelpfIavf(TestCase):
             and "queue 3" in out,
             "some queue can't receive packet when send ip packet",
         )
-        self.verify(
-            max(queue_numbers) - min(queue_numbers) <= 3,
-            "packet number on each queue should be similar",
-        )
+        p = re.compile("RSS\shash=(\w+)\s-\sRSS\squeue=(\w+)")
+        pkt_info = p.findall(out)
+        self.verify(len(pkt_info) == queue_number, "some packets no hash:{}".format(p.pattern))
+        hit_rssHash = False
+        for rss_hash, rss_queue in pkt_info:
+            for i, j in zip(list(range(64)), [3, 2, 1, 0] * 16):
+                if int(rss_hash, 16) % 64 == i and int(rss_queue, 16) == j:
+                    hit_rssHash = True
+                    break
+                else:
+                    hit_rssHash = False
+            self.verify(hit_rssHash, "some pkt not directed by rss.")
+
 
     def send_packet(self, itf, tran_type):
         """