test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1] tests/kernelpf_iavf: case vf_rss optimization test result check
@ 2022-09-22  1:59 Weiyuan Li
  2022-09-22  2:35 ` Chen, LingliX
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Weiyuan Li @ 2022-09-22  1:59 UTC (permalink / raw)
  To: dts; +Cc: Weiyuan Li

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(-)

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):
         """
-- 
2.27.0


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

end of thread, other threads:[~2022-10-10  3:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22  1:59 [dts][PATCH V1] tests/kernelpf_iavf: case vf_rss optimization test result check Weiyuan Li
2022-09-22  2:35 ` Chen, LingliX
2022-09-30  5:41 ` Peng, Yuan
2022-10-10  3:20 ` lijuan.tu

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).