From patchwork Fri Nov 18 12:53:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 119947 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7C08BA0544; Fri, 18 Nov 2022 05:35:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70C704067B; Fri, 18 Nov 2022 05:35:32 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 7F1E04021F for ; Fri, 18 Nov 2022 05:35:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668746130; x=1700282130; h=from:to:cc:subject:date:message-id; bh=yXYMm8TeCT7yGK6s+uc2h2AOxxcFFmx8q29pqZgs/nc=; b=llhooIOZXLecPi8nSn+JBhvtwsVa/vhSct/n0P9SE3179yeR+Punx0yp Ne8TEfeeKBVOc5G1L2kFv7OuwYNDOJ9DPsb8kbXMWda+1u4DcuGfmeakA AXubCQYAOHSzq9C1hiuYpMdF6IKnXn+N1KWKmWNNSOOhvftlichYUeT2w 3mQ2zKRUHak89rAA23oGgF+DYD5L8l/a9faljFTRZPZCA9Fl6pugHM0GZ SmO8oc6fYzrqyONGQUhpzVOypjD+g5ph8BDlRAvPtsH14iFBzRFyCbALo efef8mzyjiR1UK0CBeqL0/+GtFHRpb2jNliaFw4e7YfTuWlap9hjkgokD w==; X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="339888575" X-IronPort-AV: E=Sophos;i="5.96,173,1665471600"; d="scan'208";a="339888575" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 20:35:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="642372322" X-IronPort-AV: E=Sophos;i="5.96,173,1665471600"; d="scan'208";a="642372322" Received: from unknown (HELO localhost.localdomain) ([10.239.252.94]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 20:35:28 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1] tests/ice_ecpri: optimize script to solve case random failed issue Date: Fri, 18 Nov 2022 12:53:32 +0000 Message-Id: <20221118125332.8355-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 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. The queue allocated by data packets conforming to the fdir rule (the operation is queuing) may be the same as the queue calculated by the hash, but the test checks that the queue conforming to this rule is different from the hash, which causes the case test to fail. So delete the hash value calculation check in this case. Signed-off-by: Song Jiale --- 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