From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33A4CA04FD; Wed, 28 Dec 2022 06:16:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B96542C24; Wed, 28 Dec 2022 06:16:42 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 0076540FDF for ; Wed, 28 Dec 2022 06:16:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672204600; x=1703740600; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SxPRFSK/v4IVdDtbL5ScCXbamMQPLZ6U83tu8fi/bE8=; b=UVhIGEWEaLg/4pOVvUJ35/F99HYpBCNdDVCfCRVOcAGsX2XwpXUVlUt/ iVfnr1x/cqdBQZxCeFqslHO3kZjaOFNsED+xOO25ZMH4sF5hTeEErCTC2 sAQFq8haDKJtYrtAoOFnHLs8R9b+D0cJwlck39i0i9ThzBOMpvVI2+WsK CX+BnTbX9YoyrNMZ9luW8ls4sPMSqU4GCUVo8qz/Raa9VPTavHjnCE5vJ iPeX3bfu0XueTY1TtsqhX6nAJMjQ1Qm+REmjPaPuQIorJWfDaQrOYvoo0 Uxf+NNbK1Opje75Wuqwn5ArIE2z8fCcyy+KUkGcEnz3tlibPhW2vuIY5u g==; X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="348008014" X-IronPort-AV: E=Sophos;i="5.96,280,1665471600"; d="scan'208";a="348008014" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 21:16:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="603234365" X-IronPort-AV: E=Sophos;i="5.96,280,1665471600"; d="scan'208";a="603234365" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga003.jf.intel.com with ESMTP; 27 Dec 2022 21:16:37 -0800 From: Ke Xu To: dts@dpdk.org Cc: qi.fu@intel.com, weiyuanx.li@intel.com, lijuan.tu@intel.com, ke1.xu@intel.com Subject: [DTS][PATCH V3 3/5] tests/vf_offload: Use modified checksum_validate to replace checksum_validate_tunnel. Date: Wed, 28 Dec 2022 13:15:01 +0800 Message-Id: <20221228051503.36747-4-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221228051503.36747-1-ke1.xu@intel.com> References: <20221228051503.36747-1-ke1.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Use checksum_validate method to validate and remove the tunnel one. The checksum_validate is updated to cover tunnel packet validation, the checksum_validate_tunnel is no longer necessary. Signed-off-by: Ke Xu --- tests/TestSuite_vf_offload.py | 62 ++--------------------------------- 1 file changed, 3 insertions(+), 59 deletions(-) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index f922b6d9..51313743 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -400,64 +400,6 @@ class TestVfOffload(TestCase): self.verify(len(result) == 0, ",".join(list(result.values()))) - def checksum_validate_tunnel(self, packets_sent, packets_expected): - """ - Validate the checksum. - """ - tx_interface = self.tester.get_interface( - self.tester.get_local_port(self.dut_ports[0]) - ) - rx_interface = self.tester.get_interface( - self.tester.get_local_port(self.dut_ports[1]) - ) - sniff_src = self.vm0_testpmd.get_port_mac(0) - checksum_pattern = re.compile("chksum.*=.*(0x[0-9a-z]+)") - sniff_src = "52:00:00:00:00:00" - chksum = dict() - # self.tester.send_expect("scapy", ">>> ") - - for packet_type in list(packets_expected.keys()): - self.tester.send_expect("scapy", ">>> ") - self.tester.send_expect("p = %s" % packets_expected[packet_type], ">>>") - out = self.tester.send_expect("p.show2()", ">>>") - chksums = checksum_pattern.findall(out) - expected_chksum = chksums - chksum[packet_type] = chksums - print(packet_type, ": ", chksums) - - self.tester.send_expect("exit()", "#") - - self.tester.scapy_background() - inst = self.tester.tcpdump_sniff_packets( - intf=rx_interface, - count=len(packets_sent), - filters=[{"layer": "ether", "config": {"src": sniff_src}}], - ) - - # Send packet. - self.tester.scapy_foreground() - - self.tester.scapy_append( - 'sendp([%s], iface="%s")' % (packets_sent[packet_type], tx_interface) - ) - self.tester.scapy_execute() - out = self.tester.scapy_get_result() - p = self.tester.load_tcpdump_sniff_packets(inst) - nr_packets = len(p) - print(p) - 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!", - ) - self.verify( - packets_received == expected_chksum, - f"The actually received chksum {packet_type} is inconsistent with the expectation", - ) - @check_supported_nic( ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"] ) @@ -576,7 +518,7 @@ class TestVfOffload(TestCase): self.vm0_testpmd.execute_cmd("start") self.vm0_testpmd.wait_link_status_up(0) self.vm0_testpmd.wait_link_status_up(1) - self.checksum_validate_tunnel(pkts, pkts_ref) + result = self.checksum_validate(pkts, pkts_ref) # Validate checksum on the receive packet out = self.vm0_testpmd.execute_cmd("stop") bad_outer_ipcsum = self.vm0_testpmd.get_pmd_value("Bad-outer-ipcsum:", out) @@ -594,6 +536,8 @@ class TestVfOffload(TestCase): self.verify(bad_inner_ipcsum == 36, "Bad-ipcsum check error") self.verify(bad_inner_l4csum == 72, "Bad-l4csum check error") + self.verify(len(result) == 0, ",".join(list(result.values()))) + def test_checksum_offload_disable(self): """ Enable SW checksum offload. -- 2.25.1