test suite reviews and discussions
 help / color / mirror / Atom feed
From: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
To: dts@dpdk.org
Cc: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
Subject: [dts] [PATCH V2 2/2]tests/rte_flow_common: optimize cvl_advanced_rss verify function
Date: Thu, 18 Jun 2020 15:18:16 +0000	[thread overview]
Message-ID: <20200618151816.4816-3-xiaoxiaox.zeng@intel.com> (raw)
In-Reply-To: <20200618151816.4816-1-xiaoxiaox.zeng@intel.com>

Signed-off-by: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
---
 tests/rte_flow_common.py | 41 ++++++++++++++++++----------------------
 1 file changed, 18 insertions(+), 23 deletions(-)

diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py
index 5a45a7d..0574e49 100644
--- a/tests/rte_flow_common.py
+++ b/tests/rte_flow_common.py
@@ -525,31 +525,26 @@ def check_packets_of_each_queue(out):
     """
     check each queue has receive packets
     """
-    queue_result = re.findall(r"-------(.*)-------\s*(.*)", out)
-    queueid_rxpackets_list = []
-    log_msg = ""
-    for q in queue_result:
-        queue_id =get_queue_id(q[0])
-        rx_packets=get_rxpackets(q[1])
-        if (queue_id != -1):
-            queueid_rxpackets_list.append([queue_id, rx_packets])
-
-    if (len(queueid_rxpackets_list) == 10):
-        if (queueid_rxpackets_list > 0):
-            return True, log_msg
-        else :
-            log_msg = "The queue is rx-packets" % id
-            return False, log_msg
+    out = out.split("Forward statistics for port 0")[0]
+    lines = out.split("\r\n")
+    queue_flag = 0
 
-    p = re.compile("\sForward Stats for RX Port=(.*?)/Queue=(.*?)\s->")
-    li = re.findall(p, out)
-    queue_set = set([int(i[1].strip()) for i in li])
-    verify_set = set(range(64))
-    log_msg = ""
-    if queue_set.issubset(verify_set):
+    for line in lines:
+        line = line.strip()
+        if "Forward Stats" in line.strip():
+            result_scanner = r"RX Port= \d+/Queue=\s?([0-9]+)"
+            scanner = re.compile(result_scanner, re.DOTALL)
+            m = scanner.search(line)
+            queue_num = m.group(1)
+            if queue_num is not None:
+                queue_flag = queue_flag + 1
+
+    if queue_flag != 1:
+        log_msg = "packets goes to %s different queues" % queue_flag
         return True, log_msg
     else:
-        return False, "queue %s out of range %s" % (queue_set, verify_set)
+        log_msg = "packets not goes to different queues"
+        return False, log_msg
 
 def check_symmetric_queue(out):
     """
@@ -634,7 +629,7 @@ def check_iavf_packets_rss_queue(out, count, rss_match=True):
                 packet_sumnum = packet_sumnum + int(packet_num)
 
     if rss_match:
-        if queue_flag >= 10 and packet_sumnum == count:
+        if queue_flag == 16 and packet_sumnum == count:
             log_msg = "Packets has send to %s queues" % queue_flag
             return True, log_msg
         else:
-- 
2.17.1


  parent reply	other threads:[~2020-06-18  6:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 15:18 [dts] [PATCH V2 0/2]tests/cvl_advanced_rss Zeng Xiaoxiao
2020-06-18  6:42 ` Zeng, XiaoxiaoX
2020-06-18  6:45   ` He, Zhiwei
2020-06-18  6:54 ` He, Zhiwei
2020-06-18 15:18 ` [dts] [PATCH V2 1/2]tests/cvl_advanced_rss: optimize cvl_advanced_rss code Zeng Xiaoxiao
2020-06-18 15:18 ` Zeng Xiaoxiao [this message]
2020-06-19  6:26 ` [dts] [PATCH V2 0/2]tests/cvl_advanced_rss Tu, Lijuan

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=20200618151816.4816-3-xiaoxiaox.zeng@intel.com \
    --to=xiaoxiaox.zeng@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).