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 9C029A04FD; Tue, 27 Dec 2022 11:25:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 968C741143; Tue, 27 Dec 2022 11:25:11 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 0D31740E2D for ; Tue, 27 Dec 2022 11:25:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672136710; x=1703672710; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ax8d1oOAJTnOexRBv0RMJgSkzPwyzjrYSDEbZorn7nQ=; b=GdIQEZn3GR0oK/G2es5GrJ24KRIovBy/RXM/bYyyhpWVb5E7x4hR+7MP 9DqnH3+q0zC4h9iSMu5LtVqM6Oc9uRdRoa1h+T9sHQ3MBzwy9x/PlPePE DPbRop+HfD4gY2EYz5ecy5pFWE/4UcwiCmGgmg+vakf6e4VlMoBcuVBGf JQzRRnx7gjOsPt7IuM9NusTae+uYvrX+LMV3yAl/ZOHsw1MA67AJO6knz AWyIFHokTDch+phEPVkiCjcCoem9DT0DO6u+y6Z3BpHY9elZm+UG8TO2j APgNMJxRCoKlA7vE/NaP6eMc/py87b9CwmV47ezrsijWIC4CaVaM0N+5q g==; X-IronPort-AV: E=McAfee;i="6500,9779,10572"; a="322656462" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="322656462" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 02:25:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10572"; a="760292185" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="760292185" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by fmsmga002.fm.intel.com with ESMTP; 27 Dec 2022 02:25:06 -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 V1 3/5] tests/vf_offload: Use modified checksum_validate to replace checksum_validate_tunnel. Date: Tue, 27 Dec 2022 18:21:33 +0800 Message-Id: <20221227102131.529684-4-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221227102131.529684-1-ke1.xu@intel.com> References: <20221227102131.529684-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 fa56578b..d6f2a134 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -394,64 +394,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"] ) @@ -570,7 +512,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) @@ -588,6 +530,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