From patchwork Fri Nov 18 13:39:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 119948 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 E8191A0544; Fri, 18 Nov 2022 06:21:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCD324067B; Fri, 18 Nov 2022 06:21:27 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 8F6314021F for ; Fri, 18 Nov 2022 06:21:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668748886; x=1700284886; h=from:to:cc:subject:date:message-id; bh=XZrXoNW4b9GS0CgXteIuxH9VoHQ0zw6n/hXJHUMNWJQ=; b=ltwMILznOTVKyiVnE8piuIn+yVK2dm/W+F3GoxukP63zIkzIdk2G4M87 bCDEvviI9Vf7ABMFasJ3dojpI2wzeVkyiyICpjdzimE1OzRF5ri0dAoKm cc/9fiQ0MEo2tDrP6qDHZOEwpFJZ9WHT/c/JNMCSJ9qmKYp1YofE+UzFS zSBh22tta0KYNEyskN41XRe3DAsw4N4grWGeM51Vc+/aOe7pOYaVpi6l6 2nFPDietz6Fn6FegF99XuXk6ZgjlNANz6TzdQ68hAX+ULw3GCi/V6V+gA l5qknawh/zJHt00OphLgUeLQrXCgrVWhEcXQzuVccPUieih/j6YvxZwZI w==; X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="313070704" X-IronPort-AV: E=Sophos;i="5.96,173,1665471600"; d="scan'208";a="313070704" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 21:21:25 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="642381702" X-IronPort-AV: E=Sophos;i="5.96,173,1665471600"; d="scan'208";a="642381702" 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 21:21:24 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V2] tests/ice_ecpri: optimize script to solve case random failed issue Date: Fri, 18 Nov 2022 13:39:28 +0000 Message-Id: <20221118133928.8516-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. 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 --- 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