From patchwork Fri Dec 23 08:55:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 121355 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 83DEDA0093; Fri, 23 Dec 2022 09:57:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FAE341156; Fri, 23 Dec 2022 09:57:05 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id D7A9040698 for ; Fri, 23 Dec 2022 09:57:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671785824; x=1703321824; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B8ThAocNX9gA0wDFYR2gUarAQUgtRDjWQNXQGvG4ZWs=; b=oIuf4SIVkqVpeMJXJXitKAf4XLYvm6noPwD4gnH4uzVVuDVRsqCVAWcL rVARP6jwZnhEMK0lLa2Fyjdvf8pnqac5lMOgkXFqI6gfLJ1qbqocqL6Qy +fhuQQSjvL9rO5tawVnfJP7iwftS7lkCFlvA05JuzIf5eS4Su8sTUdKdx oin5/iEtt+LJEAaQmT4MN0OlrXe6rJUx/isau/lItI9hJzjDTvxlzGf/a WjS5YXB1S51R8DNio5yeZ4MTspqq0UL0j/9aNB2J0PeHN/iJ1rULvjL68 On8gjfmIkDskfEbs5J7Y36NnXrN/L7bScVOGPgQF7lP5evrodH09WxVfX A==; X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="303773496" X-IronPort-AV: E=Sophos;i="5.96,268,1665471600"; d="scan'208";a="303773496" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2022 00:57:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="776304486" X-IronPort-AV: E=Sophos;i="5.96,268,1665471600"; d="scan'208";a="776304486" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga004.jf.intel.com with ESMTP; 23 Dec 2022 00:57:01 -0800 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, weiyuanx.li@intel.com, qi.fu@intel.com, lijuan.tu@intel.com Subject: [DTS][PATCH V6 5/5] tests/vf_offload: fix and improve unstable implementations. Date: Fri, 23 Dec 2022 16:55:27 +0800 Message-Id: <20221223085527.29760-6-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221223085527.29760-1-ke1.xu@intel.com> References: <20221223085527.29760-1-ke1.xu@intel.com> MIME-Version: 1.0 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 Improved checksum validation part for tunnel cases, ensuring correctness under different scenarios. Abandoned the using of packet sprintf method in validation, fixing the possible wrong output under certain packet organizations. Branched bad checksum counting, ensuring the correctness under DCF enabled scenario. Signed-off-by: Weiyuan Li Signed-off-by: Ke Xu Tested-by: Weiyuan Li --- tests/TestSuite_vf_offload.py | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index 6765fcc5..62e74c33 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -461,20 +461,10 @@ class TestVfOffload(TestCase): p = self.tester.load_tcpdump_sniff_packets(inst) nr_packets = len(p) print(p) - packets_received = [ - p[i].sprintf( - "%IP.chksum%;%UDP.chksum%;%IP:2.chksum%;%UDP:2.chksum%;%TCP.chksum%;%SCTP.chksum%" - ) - for i in range(nr_packets) - ] - - packets_received = [ - item - for item in packets_received[0].replace("??", "").split(";") - if item != "" - ] - self.logger.debug(f"packets_received=>{packets_received}") - self.logger.debug(f"expected_chksum=>{expected_chksum}") + chksums = checksum_pattern.findall(p[0].show2(dump=True)) + packets_received = chksums + self.logger.debug(f"packets_received: {packets_received}") + self.logger.debug(f"expected_chksum: {expected_chksum}") self.verify( len(expected_chksum) == len(packets_received), f"The chksum type {packet_type} length of the actual result is inconsistent with the expected length!", @@ -609,10 +599,16 @@ class TestVfOffload(TestCase): bad_outer_l4csum = self.vm0_testpmd.get_pmd_value("Bad-outer-l4csum:", out) bad_inner_ipcsum = self.vm0_testpmd.get_pmd_value("Bad-ipcsum:", out) bad_inner_l4csum = self.vm0_testpmd.get_pmd_value("Bad-l4csum:", out) - self.verify(bad_outer_ipcsum == 42, "Bad-outer-ipcsum check error") - self.verify(bad_outer_l4csum == 66, "Bad-outer-l4csum check error") - self.verify(bad_inner_ipcsum == 42, "Bad-ipcsum check error") - self.verify(bad_inner_l4csum == 84, "Bad-l4csum check error") + if self.dcf_mode == "enable": + self.verify(bad_outer_ipcsum == 24, "Bad-outer-ipcsum check error") + self.verify(bad_outer_l4csum == 48, "Bad-outer-l4csum check error") + self.verify(bad_inner_ipcsum == 42, "Bad-ipcsum check error") + self.verify(bad_inner_l4csum == 84, "Bad-l4csum check error") + else: + self.verify(bad_outer_ipcsum == 24, "Bad-outer-ipcsum check error") + self.verify(bad_outer_l4csum == 36, "Bad-outer-l4csum check error") + self.verify(bad_inner_ipcsum == 36, "Bad-ipcsum check error") + self.verify(bad_inner_l4csum == 72, "Bad-l4csum check error") def test_checksum_offload_disable(self): """