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 5F516A04F1; Thu, 18 Jun 2020 08:38:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 55FC01B91B; Thu, 18 Jun 2020 08:38:27 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C1FB014583 for ; Thu, 18 Jun 2020 08:38:25 +0200 (CEST) IronPort-SDR: 1bsMZ9pp37QvvtgIZgQ7dQfJn2f5YqjpZJY4GMN3+jOc5uRPndynUR67ZAVzSoVFImNWKUqN8U oI0iB4GD0FnQ== X-IronPort-AV: E=McAfee;i="6000,8403,9655"; a="160532132" X-IronPort-AV: E=Sophos;i="5.73,525,1583222400"; d="scan'208";a="160532132" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2020 23:38:25 -0700 IronPort-SDR: UmvQYd4l/HhTGBX/QHBvmoWQwD1FkHs67HOky/vVwcK1sF34Fjn5uCHOa/cItEG7DoHzpgL3tV daU2cC1pSUrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,525,1583222400"; d="scan'208";a="352325187" Received: from unknown (HELO dpdk-zhushuai-tetser.icx.intel.com) ([10.240.183.103]) by orsmga001.jf.intel.com with ESMTP; 17 Jun 2020 23:38:24 -0700 From: Zeng Xiaoxiao To: dts@dpdk.org Cc: Zeng Xiaoxiao Date: Thu, 18 Jun 2020 15:18:16 +0000 Message-Id: <20200618151816.4816-3-xiaoxiaox.zeng@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200618151816.4816-1-xiaoxiaox.zeng@intel.com> References: <20200618151816.4816-1-xiaoxiaox.zeng@intel.com> Subject: [dts] [PATCH V2 2/2]tests/rte_flow_common: 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