From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2178A04A5; Thu, 18 Jun 2020 08:05:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 999401B75C; Thu, 18 Jun 2020 08:05:24 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 0767D5B3A for ; Thu, 18 Jun 2020 08:05:21 +0200 (CEST) IronPort-SDR: utIat2FE6KPHaZdvznW2k6U2fUG0eEIcC9PAIlmdL8VOCwmldbzXpG5kJPvNwc1sntOmj+V8B3 qq4k/FyQerpw== X-IronPort-AV: E=McAfee;i="6000,8403,9655"; a="207700811" X-IronPort-AV: E=Sophos;i="5.73,525,1583222400"; d="scan'208";a="207700811" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2020 23:05:21 -0700 IronPort-SDR: ag5Mbh3Ala/ffj7xZEUwlhNqPsFunU1ZSJ0OfYTm1IWtmisz/dWtUm35+RCtMNruFWJsnfRQKy m9xlcWiKlneA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,525,1583222400"; d="scan'208";a="291663150" Received: from unknown (HELO localhost.localdomain) ([10.240.183.103]) by orsmga002.jf.intel.com with ESMTP; 17 Jun 2020 23:05:20 -0700 From: Zeng Xiaoxiao To: dts@dpdk.org Cc: Zeng Xiaoxiao Date: Thu, 18 Jun 2020 14:45:17 +0000 Message-Id: <20200618144517.2201-3-xiaoxiaox.zeng@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200618144517.2201-1-xiaoxiaox.zeng@intel.com> References: <20200618144517.2201-1-xiaoxiaox.zeng@intel.com> Subject: [dts] [PATCH V1 2/2] optimize cvl_advanced_rss verify function X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Signed-off-by: Zeng Xiaoxiao --- 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