test suite reviews and discussions
 help / color / mirror / Atom feed
From: Song Jiale <songx.jiale@intel.com>
To: dts@dpdk.org
Cc: Song Jiale <songx.jiale@intel.com>
Subject: [dts] [PATCH V2] tests/ice_ecpri: optimize script to solve case random failed issue
Date: Fri, 18 Nov 2022 13:39:28 +0000	[thread overview]
Message-ID: <20221118133928.8516-1-songx.jiale@intel.com> (raw)

fix 2 issue that cause the case to fail randomly:
    1. when the hash value is different, the queue may be the same. the number of different queues deleted is equal to 
the number of different hash values.
    2. because the queue allocated by the packets hitting the fdir rule may be the same as the queue calculated by the 
hash, but the test is to check that the queue conforming to this rule is different from the queue calculated by the hash 
value, which causes the case test to fail. therefore, delete the hash value calculation check in this case.

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---

v2:
-modify patch description.

 tests/TestSuite_ice_ecpri.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_ice_ecpri.py b/tests/TestSuite_ice_ecpri.py
index 92d6aa4a..4b60478b 100644
--- a/tests/TestSuite_ice_ecpri.py
+++ b/tests/TestSuite_ice_ecpri.py
@@ -444,15 +444,13 @@ class TestICEEcpri(TestCase):
         data_lst = self.get_receive_lst(tag_lst, [pkt_str])
         hash_lst = [i.get("RSS hash") for i in data_lst]
         self.verify(
-            len(set(hash_lst))
-            == len(tag_lst)
-            == len(set([i.get("queue") for i in data_lst])),
+            len(set(hash_lst)) == len(tag_lst),
             "test fail, RSS hash is same.",
         )
         # destroy rule and test
         self.pmd_output.execute_cmd("flow destroy 1 rule 0")
         out = self.pmd_output.execute_cmd("flow list 1")
-        data_lst = self.get_receive_lst(tag_lst, [pkt_str], stats=False)
+        data_lst = self.get_receive_lst(tag_lst, [pkt_str], check_rss=False)
         hash_lst = [i.get("RSS hash") for i in data_lst]
         self.verify(
             len(hash_lst) == 0 or len(set(hash_lst)) == 1,
@@ -494,7 +492,7 @@ class TestICEEcpri(TestCase):
         # destroy rule and test
         self.pmd_output.execute_cmd("flow destroy 1 rule 0")
         self.pmd_output.execute_cmd("flow list 1")
-        data_lst = self.get_receive_lst(tag_lst, [pkt_str], stats=False)
+        data_lst = self.get_receive_lst(tag_lst, [pkt_str], check_rss=False)
         hash_lst = [i.get("RSS hash") for i in data_lst]
         self.verify(
             len(hash_lst) == 0 or len(set(hash_lst)) == 1,
@@ -544,7 +542,7 @@ class TestICEEcpri(TestCase):
         out_data = {}
         for dst_mac in dst_mac_lst:
             pkt_lst = [pkt.format(dst_mac) for pkt in module_pkt_lst]
-            reta_line = self.get_receive_lst(tag_lst[:1], pkt_lst, stats=False)
+            reta_line = self.get_receive_lst(tag_lst[:1], pkt_lst, check_rss=False)
             out_data.setdefault(dst_mac, reta_line)
         # verify
         for key in out_data.keys():
@@ -1031,7 +1029,7 @@ class TestICEEcpri(TestCase):
                 Mac_list[1]
             )
         ]
-        data_lst = self.get_receive_lst(tag_lst[:1], pkt_lst, stats=False)
+        data_lst = self.get_receive_lst(tag_lst[:1], pkt_lst, check_rss=False)
         queue = [data.get("queue") for data in data_lst]
         self.verify([i for i in queue if i in ["5", "6"]], "pkt go to wrong queue!")
         self.verify(
@@ -1048,7 +1046,7 @@ class TestICEEcpri(TestCase):
                 Mac_list[1]
             )
         ]
-        data_lst = self.get_receive_lst(tag_lst, pkt_lst, stats=False)
+        data_lst = self.get_receive_lst(tag_lst, pkt_lst, check_rss=False)
         self.verify(
             [data.get("queue") for data in data_lst] == [None, "1"],
             "pkt go to wrong queue!",
@@ -1207,13 +1205,16 @@ class TestICEEcpri(TestCase):
             "mark id or queue wrong!",
         )
 
-    def get_receive_lst(self, tag_lst=[], pkt_lst=[], pmd_output="", stats=True):
+    def get_receive_lst(self, tag_lst=[], pkt_lst=[], pmd_output="", check_rss=True):
         data_lst = []
         for tag in tag_lst:
             for pkt in pkt_lst:
                 pkt_str = pkt % tag
                 out = self.send_pkt(pkt_str=pkt_str, pmd_output=pmd_output)
-                rfc.verify_directed_by_rss(out, rxq=16, stats=stats)
+                # packets without hash or hitting the fdir rule whose action is to queue
+                # do not need to check the calculation of hash value.
+                if check_rss:
+                    rfc.verify_directed_by_rss(out, rxq=16, stats=check_rss)
                 reta_line = self.get_receive_data(out)
                 data_lst.append(reta_line)
         return data_lst
-- 
2.17.1


             reply	other threads:[~2022-11-18  5:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 13:39 Song Jiale [this message]
2022-11-19  8:16 ` 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=20221118133928.8516-1-songx.jiale@intel.com \
    --to=songx.jiale@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).