test suite reviews and discussions
 help / color / mirror / Atom feed
From: Weiyuan Li <weiyuanx.li@intel.com>
To: dts@dpdk.org
Cc: Weiyuan Li <weiyuanx.li@intel.com>
Subject: [dts][PATCH V1] tests/kernelpf_iavf: case vf_rss optimization test result check
Date: Thu, 22 Sep 2022 09:59:10 +0800	[thread overview]
Message-ID: <20220922015910.25797-1-weiyuanx.li@intel.com> (raw)

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


             reply	other threads:[~2022-09-22  1:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  1:59 Weiyuan Li [this message]
2022-09-22  2:35 ` Chen, LingliX
2022-09-30  5:41 ` Peng, Yuan
2022-10-10  3:20 ` lijuan.tu

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=20220922015910.25797-1-weiyuanx.li@intel.com \
    --to=weiyuanx.li@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).