[V1] tests/kernelpf_iavf: case vf_rss optimization test result check
Checks
Commit Message
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
> -----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>
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>
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
@@ -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):
"""