From patchwork Tue Feb 14 06:28:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 123874 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 D80BF41C92; Tue, 14 Feb 2023 07:30:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F22642D29; Tue, 14 Feb 2023 07:30:56 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 109EF40E2D for ; Tue, 14 Feb 2023 07:30:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676356255; x=1707892255; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qt9LivxkUapxa5JcWK7qXmgPPEhyUUPl7F+/VKZcOtU=; b=ifRBkEqTmvhZ0yjGLrQvn/M6DvuZ5cbC7XLVLfxMkrvqNiNkwRwZRNGJ MEKlGGUpVYymgiykkL4Tx+n7n7AofJsjFnoL79UeOXAsp449HGwcn+4k9 8tFNbdBNSgmfPQsbsR6Zbjqb6gpD9hIeKG4i3gQotLot4DC1bfoY4z8WL MZxkV6efDKOe50wWW+GpE9h4rwG+zbU9TqF7cbqXNc7PcYd1NsYjqXSB0 YPK8M0R80GZD7KZ9iXW51hNeSm2NtGXQl/cNp6gpiy/978M260HcgSYIm H9sWLF7IjU2ju5pZwuVcwUi9uzzeJ8SckDevvQvxUgbvq+vZssU64CP26 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="333228296" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="333228296" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 22:30:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="843051819" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="843051819" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga005.jf.intel.com with ESMTP; 13 Feb 2023 22:30:52 -0800 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, qi.fu@intel.com, lijuan.tu@intel.com, yux.jiang@intel.com, zhiminx.huang@intel.com Subject: [DTS][PATCH V4 1/5] tests/vf_offload: add VLAN packets to test scope. Date: Tue, 14 Feb 2023 14:28:36 +0800 Message-Id: <20230214062840.2434213-2-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214062840.2434213-1-ke1.xu@intel.com> References: <20230214062840.2434213-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 Add VLAN Packets to ensure checksum offload works well on complex packets. Add VLAN to filter. Update checksum counting. Signed-off-by: Ke Xu --- tests/TestSuite_vf_offload.py | 252 +++++++++++++++++++++++++++++++--- 1 file changed, 233 insertions(+), 19 deletions(-) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index 5def34c1..4a4ee5e1 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -258,8 +258,8 @@ class TestVfOffload(TestCase): p for p in packets if len(p.layers()) >= 3 - and p.layers()[1] in {IP, IPv6} - and p.layers()[2] in {IP, IPv6, UDP, TCP, SCTP, GRE, MPLS} + and p.layers()[1] in {IP, IPv6, Dot1Q} + and p.layers()[2] in {IP, IPv6, Dot1Q, UDP, TCP, SCTP, GRE, MPLS} and Raw in p ] @@ -400,6 +400,70 @@ class TestVfOffload(TestCase): self.verify(len(result) == 0, ",".join(list(result.values()))) + def test_checksum_offload_vlan_enable(self): + """ + Enable HW checksum offload. + Send packet with incorrect checksum, + can rx it and report the checksum error, + verify forwarded packets have correct checksum. + """ + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + ) + self.vm0_testpmd.execute_cmd("set fwd csum") + self.vm0_testpmd.execute_cmd("csum mac-swap off 0", "testpmd>") + self.vm0_testpmd.execute_cmd("csum mac-swap off 1", "testpmd>") + self.vm0_testpmd.execute_cmd("set promisc 1 on") + self.vm0_testpmd.execute_cmd("set promisc 0 on") + + time.sleep(2) + mac = self.vm0_testpmd.get_port_mac(0) + sndIP = "10.0.0.1" + sndIPv6 = "::1" + pkts = { + "IP/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IP(src="%s", chksum=0xf)/UDP(chksum=0xf)/("X"*46)' + % (mac, sndIP), + "IP/TCP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IP(src="%s", chksum=0xf)/TCP(chksum=0xf)/("X"*46)' + % (mac, sndIP), + "IP/SCTP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IP(src="%s", chksum=0xf)/SCTP(chksum=0x0)/("X"*48)' + % (mac, sndIP), + "IPv6/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IPv6(src="%s")/UDP(chksum=0xf)/("X"*46)' + % (mac, sndIPv6), + "IPv6/TCP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IPv6(src="%s")/TCP(chksum=0xf)/("X"*46)' + % (mac, sndIPv6), + } + + expIP = sndIP + expIPv6 = sndIPv6 + pkts_ref = { + "IP/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IP(src="%s")/UDP()/("X"*46)' + % (mac, expIP), + "IP/TCP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IP(src="%s")/TCP()/("X"*46)' + % (mac, expIP), + "IP/SCTP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IP(src="%s")/SCTP()/("X"*48)' + % (mac, expIP), + "IPv6/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IPv6(src="%s")/UDP()/("X"*46)' + % (mac, expIPv6), + "IPv6/TCP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=100)/IPv6(src="%s")/TCP()/("X"*46)' + % (mac, expIPv6), + } + + self.checksum_enablehw(0, self.vm_dut_0) + self.checksum_enablehw(1, self.vm_dut_0) + + self.vm0_testpmd.execute_cmd("start") + result = self.checksum_validate(pkts, pkts_ref) + + # Validate checksum on the receive packet + out = self.vm0_testpmd.execute_cmd("stop") + bad_ipcsum = self.vm0_testpmd.get_pmd_value("Bad-ipcsum:", out) + bad_l4csum = self.vm0_testpmd.get_pmd_value("Bad-l4csum:", out) + self.verify(bad_ipcsum == 3, "Bad-ipcsum check error") + self.verify(bad_l4csum == 5, "Bad-l4csum check error") + + self.verify(len(result) == 0, ",".join(list(result.values()))) + @check_supported_nic( ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"] ) @@ -429,8 +493,8 @@ class TestVfOffload(TestCase): expIPv6 = sndIPv6 pkts_outer = { - "IP/UDP/VXLAN-GPE": f'IP(src = "{sndIP}") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN()', - "IP/UDP/VXLAN-GPE/ETH": f'IP(src = "{sndIP}") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN() / Ether()', + "IP/UDP/VXLAN-GPE": f'IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN()', + "IP/UDP/VXLAN-GPE/ETH": f'IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN() / Ether()', "IPv6/UDP/VXLAN-GPE": f'IPv6(src = "{sndIPv6}") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN()', "IPv6/UDP/VXLAN-GPE/ETH": f'IPv6(src = "{sndIPv6}") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN() / Ether()', "IP/GRE": f'IP(src = "{sndIP}", proto = 47, chksum = 0xff) / GRE()', @@ -452,13 +516,12 @@ class TestVfOffload(TestCase): } if self.dcf_mode == "enable": - pkts_outer[ - "IP/UDP/VXLAN/ETH" - ] = f'IP(src = "{sndIP}") / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()' - pkts_outer[ - "IPv6/UDP/VXLAN/ETH" - ] = f'IPv6(src = "{sndIPv6}") / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()' - + pkts_outer.update( + { + "IP/UDP/VXLAN/ETH": f'IP(src = "{sndIP}") / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()', + "IPv6/UDP/VXLAN/ETH": f'IPv6(src = "{sndIPv6}") / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()', + } + ) pkts = { key_outer + "/" @@ -494,13 +557,156 @@ class TestVfOffload(TestCase): } if self.dcf_mode == "enable": - pkts_outer_ref[ - "IP/UDP/VXLAN/ETH" - ] = f'IP(src = "{sndIP}") / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()' - pkts_outer_ref[ - "IPv6/UDP/VXLAN/ETH" - ] = f'IPv6(src = "{sndIPv6}") / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()' + pkts_outer.update( + { + "IP/UDP/VXLAN/ETH": f'IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()', + "IPv6/UDP/VXLAN/ETH": f'IPv6(src = "{sndIPv6}") / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()', + } + ) + pkts_ref = { + key_outer + + "/" + + key_inner: f'Ether(dst="{mac}", src="52:00:00:00:00:00") / ' + + p_outer + + " / " + + p_inner + for key_outer, p_outer in pkts_outer_ref.items() + for key_inner, p_inner in pkts_inner_ref.items() + } + + self.checksum_enablehw_tunnel(0, self.vm_dut_0) + self.checksum_enablehw_tunnel(1, self.vm_dut_0) + + self.vm0_testpmd.execute_cmd("start") + self.vm0_testpmd.wait_link_status_up(0) + self.vm0_testpmd.wait_link_status_up(1) + 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) + 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) + if self.dcf_mode == "enable": + # Outer IP checksum error = 7 (outer-ip) * 6 (inner packet) + self.verify(bad_outer_ipcsum == 42, "Bad-outer-ipcsum check error") + # Outer IP checksum error = 8 (outer-UDP) * 6 (inner packet) + self.verify(bad_outer_l4csum == 48, "Bad-outer-l4csum check error") + # Outer L4 checksum error = 14 (outer packets) * 3 (inner-IP) + self.verify(bad_inner_ipcsum == 42, "Bad-ipcsum check error") + # Outer L4 checksum error = 14 (outer packets) * 6 (inner-L4) + self.verify(bad_inner_l4csum == 84, "Bad-l4csum check error") + else: + # Outer IP checksum error = 6 (outer-ip) * 6 (inner packet) + self.verify(bad_outer_ipcsum == 36, "Bad-outer-ipcsum check error") + # Outer IP checksum error = 6 (outer-UDP) * 6 (inner packet) + self.verify(bad_outer_l4csum == 36, "Bad-outer-l4csum check error") + # Outer L4 checksum error = 12 (outer packets) * 3 (inner-IP) + self.verify(bad_inner_ipcsum == 36, "Bad-ipcsum check error") + # Outer L4 checksum error = 12 (outer packets) * 6 (inner-L4) + self.verify(bad_inner_l4csum == 72, "Bad-l4csum check error") + + self.verify(len(result) == 0, ",".join(list(result.values()))) + + @check_supported_nic( + ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"] + ) + @skip_unsupported_pkg(["os default"]) + def test_checksum_offload_vlan_tunnel_enable(self): + """ + Enable HW checksum offload. + Send packet with inner and outer incorrect checksum, + can rx it and report the checksum error, + verify forwarded packets have correct checksum. + """ + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + ) + self.vm0_testpmd.execute_cmd("set fwd csum") + self.vm0_testpmd.execute_cmd("set promisc 1 on") + self.vm0_testpmd.execute_cmd("set promisc 0 on") + self.vm0_testpmd.execute_cmd("csum mac-swap off 0", "testpmd>") + self.vm0_testpmd.execute_cmd("csum mac-swap off 1", "testpmd>") + time.sleep(2) + port_id_0 = 0 + mac = self.vm0_testpmd.get_port_mac(0) + sndIP = "10.0.0.1" + sndIPv6 = "::1" + expIP = sndIP + expIPv6 = sndIPv6 + + pkts_outer = { + "VLAN/IP/UDP/VXLAN-GPE": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN()', + "VLAN/IP/UDP/VXLAN-GPE/ETH": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN() / Ether()', + "VLAN/IPv6/UDP/VXLAN-GPE": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN()', + "VLAN/IPv6/UDP/VXLAN-GPE/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN() / Ether()', + "VLAN/IP/GRE": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", proto = 47, chksum = 0xff) / GRE()', + "VLAN/IP/GRE/ETH": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", proto = 47, chksum = 0xff) / GRE() / Ether()', + "VLAN/IP/NVGRE/ETH": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", proto = 47, chksum = 0xff) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()', + "VLAN/IPv6/GRE": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}", nh = 47) / GRE()', + "VLAN/IPv6/GRE/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}", nh = 47) / GRE() / Ether()', + "VLAN/IPv6/NVGRE/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}", nh = 47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()', + "VLAN/IP/UDP/GTPU": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", chksum = 0xff) / UDP(dport = 2152, chksum = 0xff) / GTP_U_Header(gtp_type=255, teid=0x123456)', + "VLAN/IPv6/UDP/GTPU": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}") / UDP(dport = 2152, chksum = 0xff) / GTP_U_Header(gtp_type=255, teid=0x123456)', + } + pkts_inner = { + "IP/UDP": f'IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 29999, dport = 30000, chksum = 0xff) / Raw("x" * 100)', + "IP/TCP": f'IP(src = "{sndIP}", chksum = 0xff) / TCP(sport = 29999, dport = 30000, chksum = 0xff) / Raw("x" * 100)', + "IP/SCTP": f'IP(src = "{sndIP}", chksum = 0xff) / SCTP(sport = 29999, dport = 30000, chksum = 0x0) / Raw("x" * 128)', + "IPv6/UDP": f'IPv6(src = "{sndIPv6}") / UDP(sport = 29999, dport = 30000, chksum = 0xff) / Raw("x" * 100)', + "IPv6/TCP": f'IPv6(src = "{sndIPv6}") / TCP(sport = 29999, dport = 30000, chksum = 0xff) / Raw("x" * 100)', + "IPv6/SCTP": f'IPv6(src = "{sndIPv6}") / SCTP(sport = 29999, dport = 30000, chksum = 0x0) / Raw("x" * 128)', + } + + if self.dcf_mode == "enable": + pkts_outer.update( + { + "VLAN/IP/UDP/VXLAN/ETH": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()', + "VLAN/IPv6/UDP/VXLAN/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}") / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()', + } + ) + pkts = { + key_outer + + "/" + + key_inner: f'Ether(dst="{mac}", src="52:00:00:00:00:00") / ' + + p_outer + + " / " + + p_inner + for key_outer, p_outer in pkts_outer.items() + for key_inner, p_inner in pkts_inner.items() + } + pkts_outer_ref = { + "VLAN/IP/UDP/VXLAN-GPE": f'Dot1Q(vlan=100) / IP(src = "{expIP}") / UDP(sport = 4790, dport = 4790) / VXLAN()', + "VLAN/IP/UDP/VXLAN-GPE/ETH": f'Dot1Q(vlan=100) / IP(src = "{expIP}") / UDP(sport = 4790, dport = 4790) / VXLAN() / Ether()', + "VLAN/IPv6/UDP/VXLAN-GPE": f'Dot1Q(vlan=100) / IPv6(src = "{expIPv6}") / UDP(sport = 4790, dport = 4790) / VXLAN()', + "VLAN/IPv6/UDP/VXLAN-GPE/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{expIPv6}") / UDP(sport = 4790, dport = 4790) / VXLAN() / Ether()', + "VLAN/IP/GRE": f'Dot1Q(vlan=100) / IP(src = "{expIP}", proto = 47) / GRE()', + "VLAN/IP/GRE/ETH": f'Dot1Q(vlan=100) / IP(src = "{expIP}", proto = 47) / GRE() / Ether()', + "VLAN/IP/NVGRE/ETH": f'Dot1Q(vlan=100) / IP(src = "{expIP}", proto = 47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()', + "VLAN/IPv6/GRE": f'Dot1Q(vlan=100) / IPv6(src = "{expIPv6}", nh = 47) / GRE()', + "VLAN/IPv6/GRE/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{expIPv6}", nh = 47) / GRE() / Ether()', + "VLAN/IPv6/NVGRE/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{expIPv6}", nh = 47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()', + "VLAN/IP/UDP/GTPU": f'Dot1Q(vlan=100) / IP(src = "{expIP}") / UDP(dport = 2152) / GTP_U_Header(gtp_type=255, teid=0x123456)', + "VLAN/IPv6/UDP/GTPU": f'Dot1Q(vlan=100) / IPv6(src = "{expIPv6}") / UDP(dport = 2152) / GTP_U_Header(gtp_type=255, teid=0x123456)', + } + pkts_inner_ref = { + "IP/UDP": f'IP(src = "{expIP}") / UDP(sport = 29999, dport = 30000) / Raw("x" * 100)', + "IP/TCP": f'IP(src = "{expIP}") / TCP(sport = 29999, dport = 30000) / Raw("x" * 100)', + "IP/SCTP": f'IP(src = "{expIP}") / SCTP(sport = 29999, dport = 30000) / Raw("x" * 128)', + "IPv6/UDP": f'IPv6(src = "{expIPv6}") / UDP(sport = 29999, dport = 30000) / Raw("x" * 100)', + "IPv6/TCP": f'IPv6(src = "{expIPv6}") / TCP(sport = 29999, dport = 30000) / Raw("x" * 100)', + "IPv6/SCTP": f'IPv6(src = "{expIPv6}") / SCTP(sport = 29999, dport = 30000) / Raw("x" * 128)', + } + + if self.dcf_mode == "enable": + pkts_outer.update( + { + "VLAN/IP/UDP/VXLAN/ETH": f'Dot1Q(vlan=100) / IP(src = "{sndIP}", chksum = 0xff) / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()', + "VLAN/IPv6/UDP/VXLAN/ETH": f'Dot1Q(vlan=100) / IPv6(src = "{sndIPv6}") / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()', + } + ) pkts_ref = { key_outer + "/" @@ -526,14 +732,22 @@ class TestVfOffload(TestCase): bad_inner_ipcsum = self.vm0_testpmd.get_pmd_value("Bad-ipcsum:", out) bad_inner_l4csum = self.vm0_testpmd.get_pmd_value("Bad-l4csum:", out) if self.dcf_mode == "enable": - self.verify(bad_outer_ipcsum == 24, "Bad-outer-ipcsum check error") + # Outer IP checksum error = 7 (outer-ip) * 6 (inner packet) + self.verify(bad_outer_ipcsum == 42, "Bad-outer-ipcsum check error") + # Outer IP checksum error = 8 (outer-UDP) * 6 (inner packet) self.verify(bad_outer_l4csum == 48, "Bad-outer-l4csum check error") + # Outer L4 checksum error = 14 (outer packets) * 3 (inner-IP) self.verify(bad_inner_ipcsum == 42, "Bad-ipcsum check error") + # Outer L4 checksum error = 14 (outer packets) * 6 (inner-L4) self.verify(bad_inner_l4csum == 84, "Bad-l4csum check error") else: - self.verify(bad_outer_ipcsum == 24, "Bad-outer-ipcsum check error") + # Outer IP checksum error = 6 (outer-ip) * 6 (inner packet) + self.verify(bad_outer_ipcsum == 36, "Bad-outer-ipcsum check error") + # Outer IP checksum error = 6 (outer-UDP) * 6 (inner packet) self.verify(bad_outer_l4csum == 36, "Bad-outer-l4csum check error") + # Outer L4 checksum error = 12 (outer packets) * 3 (inner-IP) self.verify(bad_inner_ipcsum == 36, "Bad-ipcsum check error") + # Outer L4 checksum error = 12 (outer packets) * 6 (inner-L4) self.verify(bad_inner_l4csum == 72, "Bad-l4csum check error") self.verify(len(result) == 0, ",".join(list(result.values()))) From patchwork Tue Feb 14 06:28:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 123875 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 89CF441C91; Tue, 14 Feb 2023 07:30:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8027B410FB; Tue, 14 Feb 2023 07:30:59 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id AD36240E2D for ; Tue, 14 Feb 2023 07:30:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676356257; x=1707892257; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Z7SwEyjoDQBhEFIGxPKk3Ew9AmiHjgmW/Y5nR8cPiJ0=; b=VI8omOt1fRxW11/JsC4TnuNyikr/WLWVlG9l1+2m9kT6y21C+onodxRM EKgEMHU82COr+0Z+hfRpvIaEP6/SaOXKjygXv6HwloKabyZzxwnFngoPT dxW1W0WA9IHXmcdKkUEWfQzpHk0mqfQQre44Mp3letLF0kBrW8pxMgYti YMcrz2z3O0h1wSq2d5tncXgVuTqAna67rENeXvYwB/pY4SpCv4MHDF7GR vZZ7NBf350b8pv7Lj2jYVMLB6TQ5nhdMJHNn0KpsZVs1KpKFDkZcY838S fimQ2SSXnQz0coAnC5GfLEHwT6VhSNUZyHa+SMnX+y6H/ZSHP6/HDa0p/ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="333228305" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="333228305" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 22:30:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="843051878" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="843051878" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga005.jf.intel.com with ESMTP; 13 Feb 2023 22:30:54 -0800 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, qi.fu@intel.com, lijuan.tu@intel.com, yux.jiang@intel.com, zhiminx.huang@intel.com Subject: [DTS][PATCH V4 2/5] tests/vf_offload: improve TSO validating. Date: Tue, 14 Feb 2023 14:28:37 +0800 Message-Id: <20230214062840.2434213-3-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214062840.2434213-1-ke1.xu@intel.com> References: <20230214062840.2434213-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 Use segment_validate and tso_validate methods to do the validate, providing scalarble interface for futrher cases. Signed-off-by: Ke Xu --- tests/TestSuite_vf_offload.py | 491 ++++++++++++++-------------------- 1 file changed, 206 insertions(+), 285 deletions(-) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index 4a4ee5e1..d6948738 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -849,6 +849,172 @@ class TestVfOffload(TestCase): rx_packet_size = [len(p[Raw].load) for p in pkts] return rx_packet_count, rx_packet_size + def segment_validate( + self, + segment_size, + loading_size, + packet_count, + tx_stats, + rx_stats, + payload_size_list, + ): + """ + Validate the segmentation, checking if the result is segmented + as expected. + segment_size: segment size, + loading_size: tx payload size, + packet_count: tx packet count, + tx_stats: tx packets count sniffed, + rx_stats: rx packets count, + payload_size_list: rx packets payload size list, + Return a message of validate result. + """ + num_segs = (loading_size + segment_size - 1) // segment_size + num_segs_full = loading_size // segment_size + if not packet_count == tx_stats: + return "Failed: TX packet count is of inconsitent with sniffed TX packet count." + elif not packet_count * num_segs == rx_stats: + return "Failed: RX packet count is of inconsitent with expected RX packet count." + elif not ( + all( + [ + # i * packet_count + j is the i-th segmentation for j-th packet. + payload_size_list[i * packet_count + j] == segment_size + for j in range(packet_count) + for i in range(num_segs_full) + ] + + [ + # i * packet_count + j is i-th segmentation for j-th packet. + # i range from num_segs_full to num_segs, means the last + # segmentation if exists. + payload_size_list[i * packet_count + j] + == (loading_size % segment_size) + for j in range(packet_count) + for i in range(num_segs_full, num_segs) + ] + ) + ): + return ( + "Failed: RX packet segmentation size incorrect, %s." % payload_size_list + ) + return None + + def tso_validate( + self, + tx_interface, + rx_interface, + mac, + inet_type, + size_and_count, + outer_pkts=None, + ): + + validate_result = [] + + self.tester.scapy_foreground() + time.sleep(5) + + packet_l3 = { + "IP": 'IP(src="192.168.1.1",dst="192.168.1.2")', + "IPv6": 'IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")', + } + + if not outer_pkts is None: + for key_outer in outer_pkts: + for loading_size, packet_count in size_and_count: + out = self.vm0_testpmd.execute_cmd( + "clear port info all", "testpmd> ", 120 + ) + self.tcpdump_start_sniffing([tx_interface, rx_interface]) + if "GTPU" in key_outer: + self.tester.scapy_append( + "from scapy.contrib.gtp import GTP_U_Header" + ) + self.tester.scapy_append( + ( + 'sendp([Ether(dst="%s",src="52:00:00:00:00:00")/' + + outer_pkts[key_outer] + + '/%s/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count=%s)' + ) + % ( + mac, + packet_l3[inet_type], + loading_size, + tx_interface, + packet_count, + ) + ) + out = self.tester.scapy_execute() + out = self.vm0_testpmd.execute_cmd("show port stats all") + print(out) + # In case tcpdump working slower than expected on very limited environments, + # an immediate stop sniffing causes a trimed pcap file, leading to wrong + # packet statistic. + # Uncommenting the following line helps resolving this problem. + # time.sleep(1) + self.tcpdump_stop_sniff() + rx_stats, payload_size_list = self.tcpdump_analyse_sniff( + rx_interface + ) + tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) + payload_size_list.sort(reverse=True) + self.logger.info(payload_size_list) + segment_result = self.segment_validate( + 800, + loading_size, + packet_count, + tx_stats, + rx_stats, + payload_size_list, + ) + if segment_result: + result_message = ( + f"Packet: {key_outer}, inet type: {inet_type}, loading size: {loading_size} packet count: {packet_count}: " + + segment_result + ) + self.logger.info(result_message) + validate_result.append(result_message) + else: + for loading_size, packet_count in size_and_count: + out = self.vm0_testpmd.execute_cmd( + "clear port info all", "testpmd> ", 120 + ) + self.tcpdump_start_sniffing([tx_interface, rx_interface]) + self.tester.scapy_append( + 'sendp([Ether(dst="%s",src="52:00:00:00:00:00")/%s/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count=%s)' + % ( + mac, + packet_l3[inet_type], + loading_size, + tx_interface, + packet_count, + ) + ) + out = self.tester.scapy_execute() + out = self.vm0_testpmd.execute_cmd("show port stats all") + print(out) + self.tcpdump_stop_sniff() + rx_stats, payload_size_list = self.tcpdump_analyse_sniff(rx_interface) + tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) + payload_size_list.sort(reverse=True) + self.logger.info(payload_size_list) + segment_result = self.segment_validate( + 800, + loading_size, + packet_count, + tx_stats, + rx_stats, + payload_size_list, + ) + if segment_result: + result_message = ( + f"Inet type: {inet_type}, loading size: {loading_size} packet count: {packet_count}: " + + segment_result + ) + self.logger.info(result_message) + validate_result.append(result_message) + return validate_result + def test_tso(self): """ TSO IPv4 TCP, IPv6 TCP testing. @@ -863,7 +1029,7 @@ class TestVfOffload(TestCase): # Here size_and_count is a list of tuples for the test scopes that # in a tuple (size, count) means, sending packets for count times # for TSO with a payload size of size. - self.size_and_count = [ + size_and_count = [ (128, 10), (800, 10), (801, 10), @@ -895,162 +1061,31 @@ class TestVfOffload(TestCase): mac = self.vm0_testpmd.get_port_mac(0) self.vm0_testpmd.execute_cmd("set verbose 1", "testpmd> ", 120) - self.vm0_testpmd.execute_cmd("port stop all", "testpmd> ", 120) - self.vm0_testpmd.execute_cmd( - "csum set ip hw %d" % self.dut_ports[0], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set udp hw %d" % self.dut_ports[0], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set tcp hw %d" % self.dut_ports[0], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set sctp hw %d" % self.dut_ports[0], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set outer-ip hw %d" % self.dut_ports[0], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum parse-tunnel on %d" % self.dut_ports[0], "testpmd> ", 120 - ) - - self.vm0_testpmd.execute_cmd( - "csum set ip hw %d" % self.dut_ports[1], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set udp hw %d" % self.dut_ports[1], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set tcp hw %d" % self.dut_ports[1], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set sctp hw %d" % self.dut_ports[1], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum set outer-ip hw %d" % self.dut_ports[1], "testpmd> ", 120 - ) - self.vm0_testpmd.execute_cmd( - "csum parse-tunnel on %d" % self.dut_ports[1], "testpmd> ", 120 - ) - - self.vm0_testpmd.execute_cmd("tso set 800 %d" % self.vm0_dut_ports[1]) self.vm0_testpmd.execute_cmd("set fwd csum") - self.vm0_testpmd.execute_cmd("port start all", "testpmd> ", 120) + self.tso_enable(self.vm0_dut_ports[0], self.vm_dut_0) + self.tso_enable(self.vm0_dut_ports[1], self.vm_dut_0) self.vm0_testpmd.execute_cmd("set promisc 0 on", "testpmd> ", 120) self.vm0_testpmd.execute_cmd("set promisc 1 on", "testpmd> ", 120) self.vm0_testpmd.execute_cmd("start") + self.vm0_testpmd.wait_link_status_up(self.vm0_dut_ports[0]) + self.vm0_testpmd.wait_link_status_up(self.vm0_dut_ports[1]) - self.tester.scapy_foreground() - time.sleep(5) - - for loading_size, packet_count in self.size_and_count: - # IPv4 tcp test - out = self.vm0_testpmd.execute_cmd("clear port info all", "testpmd> ", 120) - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - self.tester.scapy_append( - 'sendp([Ether(dst="%s",src="52:00:00:00:00:00")/IP(src="192.168.1.1",dst="192.168.1.2")/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count=%s)' - % (mac, loading_size, tx_interface, packet_count) - ) - out = self.tester.scapy_execute() - out = self.vm0_testpmd.execute_cmd("show port stats all") - print(out) - self.tcpdump_stop_sniff() - rx_stats, payload_size_list = self.tcpdump_analyse_sniff(rx_interface) - tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) - payload_size_list.sort(reverse=True) - self.logger.info(payload_size_list) - if loading_size <= 800: - self.verify( - # for all packet_count packets, verifying the packet size equals the size we sent. - rx_stats == tx_stats - and all( - [ - int(payload_size_list[j]) == loading_size - for j in range(packet_count) - ] - ), - "IPV4 RX or TX packet number not correct", - ) - else: - num = loading_size // 800 - for i in range(num): - self.verify( - # i * packet_count + j is the i-th segmentation for j-th packet. - all( - [ - int(payload_size_list[i * packet_count + j]) == 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) - if loading_size % 800 != 0: - self.verify( - # num * packet_count + j is the last segmentation for j-th packet. - all( - [ - int(payload_size_list[num * packet_count + j]) - == loading_size % 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) - - for loading_size, packet_count in self.size_and_count: - # IPv6 tcp test - out = self.vm0_testpmd.execute_cmd("clear port info all", "testpmd> ", 120) - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - self.tester.scapy_append( - 'sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count=%s)' - % (mac, loading_size, tx_interface, packet_count) - ) - out = self.tester.scapy_execute() - out = self.vm0_testpmd.execute_cmd("show port stats all") - print(out) - self.tcpdump_stop_sniff() - rx_stats, payload_size_list = self.tcpdump_analyse_sniff(rx_interface) - tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) - payload_size_list.sort(reverse=True) - self.logger.info(payload_size_list) - if loading_size <= 800: - self.verify( - # for all packet_count packets, verifying the packet size equals the size we sent. - rx_stats == tx_stats - and all( - [ - int(payload_size_list[j]) == loading_size - for j in range(packet_count) - ] - ), - "IPV6 RX or TX packet number not correct", - ) - else: - num = loading_size // 800 - for i in range(num): - self.verify( - # i * packet_count + j is the i-th segmentation for j-th packet. - all( - [ - int(payload_size_list[i * packet_count + j]) == 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) - if loading_size % 800 != 0: - self.verify( - # num * packet_count + j is the last segmentation for j-th packet. - all( - [ - int(payload_size_list[num * packet_count + j]) - == loading_size % 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) + validate_result = [] + validate_result += self.tso_validate( + tx_interface=tx_interface, + rx_interface=rx_interface, + mac=mac, + inet_type="IP", + size_and_count=size_and_count, + ) + validate_result += self.tso_validate( + tx_interface=tx_interface, + rx_interface=rx_interface, + mac=mac, + inet_type="IPv6", + size_and_count=size_and_count, + ) + self.verify(len(validate_result) == 0, ",".join(list(validate_result))) @check_supported_nic( ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"] @@ -1070,7 +1105,7 @@ class TestVfOffload(TestCase): # Here size_and_count is a list of tuples for the test scopes that # in a tuple (size, count) means, sending packets for count times # for TSO with a payload size of size. - self.size_and_count = [ + size_and_count = [ (128, 10), (800, 10), (801, 10), @@ -1130,138 +1165,24 @@ class TestVfOffload(TestCase): "IPv6/UDP/GTPU": 'IPv6(src = "FE80:0:0:0:200:1FF:FE00:200", dst = "3555:5555:6666:6666:7777:7777:8888:8888") / UDP(dport = 2152) / GTP_U_Header(gtp_type=255, teid=0x123456)', } - self.tester.scapy_foreground() - time.sleep(5) - - for key_outer in pkts_outer: - for loading_size, packet_count in self.size_and_count: - # IPv4 tcp test - out = self.vm0_testpmd.execute_cmd( - "clear port info all", "testpmd> ", 120 - ) - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - if "GTPU" in key_outer: - self.tester.scapy_append( - "from scapy.contrib.gtp import GTP_U_Header" - ) - self.tester.scapy_append( - ( - 'sendp([Ether(dst="%s",src="52:00:00:00:00:00")/' - + pkts_outer[key_outer] - + '/IP(src="192.168.1.1",dst="192.168.1.2")/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count=%s)' - ) - % (mac, loading_size, tx_interface, packet_count) - ) - out = self.tester.scapy_execute() - out = self.vm0_testpmd.execute_cmd("show port stats all") - print(out) - self.tcpdump_stop_sniff() - rx_stats, payload_size_list = self.tcpdump_analyse_sniff(rx_interface) - tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) - payload_size_list.sort(reverse=True) - self.logger.info(payload_size_list) - if loading_size <= 800: - self.verify( - # for all packet_count packets, verifying the packet size equals the size we sent. - rx_stats == tx_stats - and all( - [ - int(payload_size_list[j]) == loading_size - for j in range(packet_count) - ] - ), - f"{key_outer} tunnel IPV4 RX or TX packet number not correct", - ) - else: - num = loading_size // 800 - for i in range(num): - self.verify( - # i * packet_count + j is the i-th segmentation for j-th packet. - all( - [ - payload_size_list[i * packet_count + j] == 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) - if loading_size % 800 != 0: - self.verify( - # num * packet_count + j is the last segmentation for j-th packet. - all( - [ - payload_size_list[num * packet_count + j] - == loading_size % 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) - - for loading_size, packet_count in self.size_and_count: - # IPv6 tcp test - out = self.vm0_testpmd.execute_cmd( - "clear port info all", "testpmd> ", 120 - ) - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - if "GTPU" in key_outer: - self.tester.scapy_append( - "from scapy.contrib.gtp import GTP_U_Header" - ) - self.logger.info([mac, loading_size, tx_interface, packet_count]) - self.tester.scapy_append( - ( - 'sendp([Ether(dst="%s", src="52:00:00:00:00:00")/' - + pkts_outer[key_outer] - + '/IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=1021,dport=1021)/("X"*%s)], iface="%s", count=%s)' - ) - % (mac, loading_size, tx_interface, packet_count) - ) - out = self.tester.scapy_execute() - out = self.vm0_testpmd.execute_cmd("show port stats all") - print(out) - self.tcpdump_stop_sniff() - rx_stats, payload_size_list = self.tcpdump_analyse_sniff(rx_interface) - tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) - payload_size_list.sort(reverse=True) - self.logger.info(payload_size_list) - if loading_size <= 800: - self.verify( - # for all packet_count packets, verifying the packet size equals the size we sent. - rx_stats == tx_stats - and all( - [ - payload_size_list[j] == loading_size - for j in range(packet_count) - ] - ), - f"{key_outer} tunnel IPV6 RX or TX packet number not correct", - ) - else: - num = loading_size // 800 - for i in range(num): - self.verify( - # i * packet_count + j is the i-th segmentation for j-th packet. - all( - [ - payload_size_list[i * packet_count + j] == 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) - if loading_size % 800 != 0: - self.verify( - # num * packet_count + j is the last segmentation for j-th packet. - all( - [ - payload_size_list[num * packet_count + j] - == loading_size % 800 - for j in range(packet_count) - ] - ), - "the packet segmentation incorrect, %s" % payload_size_list, - ) + validate_result = [] + validate_result += self.tso_validate( + tx_interface=tx_interface, + rx_interface=rx_interface, + mac=mac, + inet_type="IP", + size_and_count=size_and_count, + outer_pkts=pkts_outer, + ) + validate_result += self.tso_validate( + tx_interface=tx_interface, + rx_interface=rx_interface, + mac=mac, + inet_type="IPv6", + size_and_count=size_and_count, + outer_pkts=pkts_outer, + ) + self.verify(len(validate_result) == 0, ",".join(list(validate_result))) def tear_down(self): self.vm0_testpmd.execute_cmd("quit", "# ") From patchwork Tue Feb 14 06:28:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 123876 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 AEC2C41C91; Tue, 14 Feb 2023 07:31:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A58AC42D46; Tue, 14 Feb 2023 07:31:01 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id DEFE542D46 for ; Tue, 14 Feb 2023 07:30:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676356260; x=1707892260; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e8iMQLcdgWLAfRPzfGa4XQLPdI34JOaD9BdubNcdEKE=; b=MRCCSPeE4Px714WVnk7kc6pIcVKYxbyeG74ICSpxHiHrppejbV7Dm9Od vpXMsATfcO+TXQMzvGBMtZbw7qtor9pvbaHY3fXhqIaURMzECXQOHYNae YEX4aqO9kbY4PunhZtSdFCFbRWCI1F0lPWPQbcEQ9nqffnCmfyCMOsjPX LF/xBjhUfHzqS9i3GIV2x2n3/4WupkFoeED1MD1p91g6XHXG8MK7OGlzt OQ15UvOIsm5P1FUS98s/66BIrIX1+TCEbvKXcmqLRGOrB/z+InIPQ0mYW inwEpmjJqniptFqBVeV/AbCZ5iYZyAc+uiwIZFQf98Y7eH4Z6CQ31X3ih A==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="333228314" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="333228314" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 22:30:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="843051937" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="843051937" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga005.jf.intel.com with ESMTP; 13 Feb 2023 22:30:57 -0800 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, qi.fu@intel.com, lijuan.tu@intel.com, yux.jiang@intel.com, zhiminx.huang@intel.com Subject: [DTS][PATCH V4 3/5] tests/vf_offload: improve vector path validating. Date: Tue, 14 Feb 2023 14:28:38 +0800 Message-Id: <20230214062840.2434213-4-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214062840.2434213-1-ke1.xu@intel.com> References: <20230214062840.2434213-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 For better deployment for daily regression, we introduce a wrapper to add cases for each path. Based on it, we add seperate cases for regression. Signed-off-by: Ke Xu --- tests/TestSuite_vf_offload.py | 176 ++++++++++++++++++++++++++++++++-- 1 file changed, 168 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index d6948738..f3af2379 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -185,11 +185,13 @@ class TestVfOffload(TestCase): def launch_testpmd(self, **kwargs): dcf_flag = kwargs.get("dcf_flag") + eal_param = kwargs.get("eal_param") if kwargs.get("eal_param") else "" param = kwargs.get("param") if kwargs.get("param") else "" if dcf_flag == "enable": self.vm0_testpmd.start_testpmd( VM_CORES_MASK, param=param, + eal_param=eal_param, ports=[self.vf0_guest_pci, self.vf1_guest_pci], port_options={ self.vf0_guest_pci: "cap=dcf", @@ -197,7 +199,11 @@ class TestVfOffload(TestCase): }, ) else: - self.vm0_testpmd.start_testpmd(VM_CORES_MASK, param=param) + self.vm0_testpmd.start_testpmd( + VM_CORES_MASK, + param=param, + eal_param=eal_param, + ) def checksum_enablehw(self, port, dut): dut.send_expect("port stop all", "testpmd>") @@ -336,7 +342,7 @@ class TestVfOffload(TestCase): ) return result - def test_checksum_offload_enable(self): + def exec_checksum_offload_enable(self, specific_bitwidth=None): """ Enable HW checksum offload. Send packet with incorrect checksum, @@ -346,6 +352,13 @@ class TestVfOffload(TestCase): self.launch_testpmd( dcf_flag=self.dcf_mode, param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + eal_param=( + "--force-max-simd-bitwidth=%d " % specific_bitwidth + + "--log-level='iavf,7' " + + "--log-level='dcf,7' " + ) + if (not specific_bitwidth is None) + else "", ) self.vm0_testpmd.execute_cmd("set fwd csum") self.vm0_testpmd.execute_cmd("csum mac-swap off 0", "testpmd>") @@ -400,7 +413,7 @@ class TestVfOffload(TestCase): self.verify(len(result) == 0, ",".join(list(result.values()))) - def test_checksum_offload_vlan_enable(self): + def exec_checksum_offload_vlan_enable(self, specific_bitwidth=None): """ Enable HW checksum offload. Send packet with incorrect checksum, @@ -410,6 +423,13 @@ class TestVfOffload(TestCase): self.launch_testpmd( dcf_flag=self.dcf_mode, param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + eal_param=( + "--force-max-simd-bitwidth=%d " % specific_bitwidth + + "--log-level='iavf,7' " + + "--log-level='dcf,7' " + ) + if (not specific_bitwidth is None) + else "", ) self.vm0_testpmd.execute_cmd("set fwd csum") self.vm0_testpmd.execute_cmd("csum mac-swap off 0", "testpmd>") @@ -468,7 +488,7 @@ class TestVfOffload(TestCase): ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"] ) @skip_unsupported_pkg(["os default"]) - def test_checksum_offload_tunnel_enable(self): + def exec_checksum_offload_tunnel_enable(self, specific_bitwidth=None): """ Enable HW checksum offload. Send packet with inner and outer incorrect checksum, @@ -478,6 +498,13 @@ class TestVfOffload(TestCase): self.launch_testpmd( dcf_flag=self.dcf_mode, param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + eal_param=( + "--force-max-simd-bitwidth=%d " % specific_bitwidth + + "--log-level='iavf,7' " + + "--log-level='dcf,7' " + ) + if (not specific_bitwidth is None) + else "", ) self.vm0_testpmd.execute_cmd("set fwd csum") self.vm0_testpmd.execute_cmd("set promisc 1 on") @@ -612,7 +639,7 @@ class TestVfOffload(TestCase): ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"] ) @skip_unsupported_pkg(["os default"]) - def test_checksum_offload_vlan_tunnel_enable(self): + def exec_checksum_offload_vlan_tunnel_enable(self, specific_bitwidth=None): """ Enable HW checksum offload. Send packet with inner and outer incorrect checksum, @@ -622,6 +649,13 @@ class TestVfOffload(TestCase): self.launch_testpmd( dcf_flag=self.dcf_mode, param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + eal_param=( + "--force-max-simd-bitwidth=%d " % specific_bitwidth + + "--log-level='iavf,7' " + + "--log-level='dcf,7' " + ) + if (not specific_bitwidth is None) + else "", ) self.vm0_testpmd.execute_cmd("set fwd csum") self.vm0_testpmd.execute_cmd("set promisc 1 on") @@ -752,7 +786,7 @@ class TestVfOffload(TestCase): self.verify(len(result) == 0, ",".join(list(result.values()))) - def test_checksum_offload_disable(self): + def exec_checksum_offload_disable(self, specific_bitwidth=None): """ Enable SW checksum offload. Send same packet with incorrect checksum and verify checksum is valid. @@ -761,6 +795,13 @@ class TestVfOffload(TestCase): self.launch_testpmd( dcf_flag=self.dcf_mode, param="--portmask=%s " % (self.portMask) + "--enable-rx-cksum " + "", + eal_param=( + "--force-max-simd-bitwidth=%d " % specific_bitwidth + + "--log-level='iavf,7' " + + "--log-level='dcf,7' " + ) + if (not specific_bitwidth is None) + else "", ) self.vm0_testpmd.execute_cmd("set fwd csum") self.vm0_testpmd.execute_cmd("csum mac-swap off 0", "testpmd>") @@ -812,6 +853,81 @@ class TestVfOffload(TestCase): self.verify(len(result) == 0, ",".join(list(result.values()))) + def test_checksum_offload_enable(self): + self.exec_checksum_offload_enable() + + def test_checksum_offload_enable_scalar(self): + self.exec_checksum_offload_enable(specific_bitwidth=64) + + def test_checksum_offload_enable_sse(self): + self.exec_checksum_offload_enable(specific_bitwidth=128) + + def test_checksum_offload_enable_avx2(self): + self.exec_checksum_offload_enable(specific_bitwidth=256) + + def test_checksum_offload_enable_avx512(self): + self.exec_checksum_offload_enable(specific_bitwidth=512) + + def test_checksum_offload_vlan_enable(self): + self.exec_checksum_offload_vlan_enable() + + def test_checksum_offload_vlan_enable_scalar(self): + self.exec_checksum_offload_vlan_enable(specific_bitwidth=64) + + def test_checksum_offload_vlan_enable_sse(self): + self.exec_checksum_offload_vlan_enable(specific_bitwidth=128) + + def test_checksum_offload_vlan_enable_avx2(self): + self.exec_checksum_offload_vlan_enable(specific_bitwidth=256) + + def test_checksum_offload_vlan_enable_avx512(self): + self.exec_checksum_offload_vlan_enable(specific_bitwidth=512) + + def test_checksum_offload_tunnel_enable(self): + self.exec_checksum_offload_tunnel_enable() + + def test_checksum_offload_tunnel_enable_scalar(self): + self.exec_checksum_offload_tunnel_enable(specific_bitwidth=64) + + def test_checksum_offload_tunnel_enable_sse(self): + self.exec_checksum_offload_tunnel_enable(specific_bitwidth=128) + + def test_checksum_offload_tunnel_enable_avx2(self): + self.exec_checksum_offload_tunnel_enable(specific_bitwidth=256) + + def test_checksum_offload_tunnel_enable_avx512(self): + self.exec_checksum_offload_tunnel_enable(specific_bitwidth=512) + + def test_checksum_offload_vlan_tunnel_enable(self): + self.exec_checksum_offload_vlan_tunnel_enable() + + def test_checksum_offload_vlan_tunnel_enable_scalar(self): + self.exec_checksum_offload_vlan_tunnel_enable(specific_bitwidth=64) + + def test_checksum_offload_vlan_tunnel_enable_sse(self): + self.exec_checksum_offload_vlan_tunnel_enable(specific_bitwidth=128) + + def test_checksum_offload_vlan_tunnel_enable_avx2(self): + self.exec_checksum_offload_vlan_tunnel_enable(specific_bitwidth=256) + + def test_checksum_offload_vlan_tunnel_enable_avx512(self): + self.exec_checksum_offload_vlan_tunnel_enable(specific_bitwidth=512) + + def test_checksum_offload_disable(self): + self.exec_checksum_offload_disable() + + def test_checksum_offload_disable_scalar(self): + self.exec_checksum_offload_disable(specific_bitwidth=64) + + def test_checksum_offload_disable_sse(self): + self.exec_checksum_offload_disable(specific_bitwidth=128) + + def test_checksum_offload_disable_avx2(self): + self.exec_checksum_offload_disable(specific_bitwidth=256) + + def test_checksum_offload_disable_avx512(self): + self.exec_checksum_offload_disable(specific_bitwidth=512) + def tcpdump_start_sniffing(self, ifaces=[]): """ Start tcpdump in the background to sniff the tester interface where @@ -1015,7 +1131,7 @@ class TestVfOffload(TestCase): validate_result.append(result_message) return validate_result - def test_tso(self): + def exec_tso(self, specific_bitwidth=None): """ TSO IPv4 TCP, IPv6 TCP testing. """ @@ -1057,6 +1173,13 @@ class TestVfOffload(TestCase): param="--portmask=0x3 " + "--enable-rx-cksum " + "--max-pkt-len=%s" % TSO_MTU, + eal_param=( + "--force-max-simd-bitwidth=%d " % specific_bitwidth + + "--log-level='iavf,7' " + + "--log-level='dcf,7' " + ) + if (not specific_bitwidth is None) + else "", ) mac = self.vm0_testpmd.get_port_mac(0) @@ -1091,7 +1214,7 @@ class TestVfOffload(TestCase): ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"] ) @skip_unsupported_pkg(["os default"]) - def test_tso_tunnel(self): + def exec_tso_tunnel(self, specific_bitwidth=None): """ TSO tunneled IPv4 TCP, IPv6 TCP testing. """ @@ -1133,6 +1256,13 @@ class TestVfOffload(TestCase): param="--portmask=0x3 " + "--enable-rx-cksum " + "--max-pkt-len=%s" % TSO_MTU, + eal_param=( + "--force-max-simd-bitwidth=%d " % specific_bitwidth + + "--log-level='iavf,7' " + + "--log-level='dcf,7' " + ) + if (not specific_bitwidth is None) + else "", ) mac = self.vm0_testpmd.get_port_mac(0) @@ -1184,6 +1314,36 @@ class TestVfOffload(TestCase): ) self.verify(len(validate_result) == 0, ",".join(list(validate_result))) + def test_tso(self): + self.exec_tso() + + def test_tso_scalar(self): + self.exec_tso(specific_bitwidth=64) + + def test_tso_sse(self): + self.exec_tso(specific_bitwidth=128) + + def test_tso_avx2(self): + self.exec_tso(specific_bitwidth=256) + + def test_tso_avx512(self): + self.exec_tso(specific_bitwidth=512) + + def test_tso_tunnel(self): + self.exec_tso_tunnel() + + def test_tso_tunnel_scalar(self): + self.exec_tso_tunnel(specific_bitwidth=64) + + def test_tso_tunnel_sse(self): + self.exec_tso_tunnel(specific_bitwidth=128) + + def test_tso_tunnel_avx2(self): + self.exec_tso_tunnel(specific_bitwidth=256) + + def test_tso_tunnel_avx512(self): + self.exec_tso_tunnel(specific_bitwidth=512) + def tear_down(self): self.vm0_testpmd.execute_cmd("quit", "# ") self.dut.send_expect( From patchwork Tue Feb 14 06:28:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 123877 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 CC7B241C91; Tue, 14 Feb 2023 07:31:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3D1C42D44; Tue, 14 Feb 2023 07:31:03 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id B23FA42D49 for ; Tue, 14 Feb 2023 07:31:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676356262; x=1707892262; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FjvONxQwAq0OqkhPDNhhlnpZwbyTA/tGiBL4aS66otE=; b=ep981Mna0RUh3MYHevYPnkHeqvy+7r5fLdL6rWhU68Mh2DGIza7mj5xX 0kuMQ5ofGHr6fWSe/+7znJ4rty7mAtkWy+76SAvM3eu5DJdKPpZk1Bxrg l3e5eDciZENANs6SPwdekJ+czDFBiL+M6YPfaWUH1anfeAfBtYw4TNoA4 pktuePSiNu6fEE5dDE0iVVQV7+uiYB72KG7sDjCv3mCBdC6kwgrAxr5qN eFtrieTPlAd5a6zkAN5RrGf5enft97CI2FWGAHBgdBtNxerACeGhxVQJ/ L4VCuY4ptzaAN88GbzE8bYvMgaToSn5gnsrm1a2GvhQwUQHSKrNqIzbqA w==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="333228320" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="333228320" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 22:31:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="843051966" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="843051966" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga005.jf.intel.com with ESMTP; 13 Feb 2023 22:30:59 -0800 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, qi.fu@intel.com, lijuan.tu@intel.com, yux.jiang@intel.com, zhiminx.huang@intel.com Subject: [DTS][PATCH V4 4/5] tests/vf_offload: fix error when no packet captured. Date: Tue, 14 Feb 2023 14:28:39 +0800 Message-Id: <20230214062840.2434213-5-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214062840.2434213-1-ke1.xu@intel.com> References: <20230214062840.2434213-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 Signed-off-by: Ke Xu --- tests/TestSuite_vf_offload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index f3af2379..9475ef22 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -262,7 +262,7 @@ class TestVfOffload(TestCase): def filter_packets(self, packets): return [ p - for p in packets + for p in (packets if packets else []) if len(p.layers()) >= 3 and p.layers()[1] in {IP, IPv6, Dot1Q} and p.layers()[2] in {IP, IPv6, Dot1Q, UDP, TCP, SCTP, GRE, MPLS} From patchwork Tue Feb 14 06:28:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 123878 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 F236D41C91; Tue, 14 Feb 2023 07:31:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E93C7410D1; Tue, 14 Feb 2023 07:31:05 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 3668A42D53 for ; Tue, 14 Feb 2023 07:31:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676356264; x=1707892264; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SUQem2bphwZFoUjKjsYUqz+eObP41CvnVDrLqUtGLf0=; b=aqtaN5Z/eKXulM5DtthFFgudnI3BJ3Ba5C6c0paefBWIMDC/8ZxhNh+r EkAkU+EwKM2oxHYRXSb+dYUPvtw7FzW70Rr3y6Jy+gDDh3JSK+75Tfsx/ v0kRPafTplNzQTK9QBepVVbJrnwFvgpXLJNLq3k/FFXv6w4KrNwsRnt5T ITFN2hDWJ3cdB7eSLi3Q4ckuWKNuNKkyTZa2fbCbBN53zj+M/hQByiL3J 9Ck2uqhIkFphJuum/BCr9/ioh77APfYkTh2+5t/36nrrFBUlL+5Giuv9n O+ek33HuLvuemgqa+YyI5adXhafNIZB5tNisNvb+uYKLRsMBPN06Xrjvm Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="333228329" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="333228329" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 22:31:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="843052082" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="843052082" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga005.jf.intel.com with ESMTP; 13 Feb 2023 22:31:01 -0800 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, qi.fu@intel.com, lijuan.tu@intel.com, yux.jiang@intel.com, zhiminx.huang@intel.com Subject: [DTS][PATCH V4 5/5] test_plans/vf_offload: add VLAN packets to test scope and improve vector path validating. Date: Tue, 14 Feb 2023 14:28:40 +0800 Message-Id: <20230214062840.2434213-6-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214062840.2434213-1-ke1.xu@intel.com> References: <20230214062840.2434213-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 Add VLAN Packets to ensure checksum offload works well on packets with Dot1Q part. For daily regression, we introduce wrapped cases for each path. Signed-off-by: Ke Xu --- test_plans/vf_offload_test_plan.rst | 158 ++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/test_plans/vf_offload_test_plan.rst b/test_plans/vf_offload_test_plan.rst index 3e9b658b..1c929371 100644 --- a/test_plans/vf_offload_test_plan.rst +++ b/test_plans/vf_offload_test_plan.rst @@ -286,6 +286,135 @@ be validated as pass by the tester. The first byte of source IPv4 address will be increased by testpmd. The checksum is indeed recalculated by software algorithms. + +Test Case: HW checksum offload check with vlan +============================================== +Start testpmd and enable checksum offload on rx port. Based on test steps of +HW checksum offload check, configure the traffic generator to send the multiple +packets for the following combination: + + +----------------+----------------------------------------+ + | packet type | packet organization | + +================+========================================+ + | | Ether / VLAN / IPv4 / UDP / payload | + | +----------------------------------------+ + | | Ether / VLAN / IPv4 / TCP / payload | + | +----------------------------------------+ + | packets | Ether / VLAN / IPv4 / SCTP / payload | + | for checksum +----------------------------------------+ + | offload test | Ether / VLAN / IPv6 / UDP / payload | + | +----------------------------------------+ + | | Ether / VLAN / IPv6 / TCP / payload | + +----------------+----------------------------------------+ + + +Test Case: HW tunneling checksum offload check with vlan +======================================================== +Based on test steps of HW tunneling checksum offload check, configure the +traffic generator to send the multiple packets combination with outer or +tunneling package of: + + +----------------+--------------------------------------------+ + | packet type | packet organization | + +================+============================================+ + | | Ether / VLAN / IPv4 / UDP / VXLAN / Ether | + | +--------------------------------------------+ + | | Ether / VLAN / IPv6 / UDP / VXLAN / Ether | + | +--------------------------------------------+ + | | Ether / VLAN / IPv4 / GRE | + | outer and +--------------------------------------------+ + | tunneling | Ether / VLAN / IPv4 / GRE / Ether | + | packets +--------------------------------------------+ + | for checksum | Ether / VLAN / IPv6 / GRE | + | offload test +--------------------------------------------+ + | | Ether / VLAN / IPv6 / GRE / Ether | + | +--------------------------------------------+ + | | Ether / VLAN / IPv4 / NVGRE | + | +--------------------------------------------+ + | | Ether / VLAN / IPv4 / NVGRE / Ether | + | +--------------------------------------------+ + | | Ether / VLAN / IPv6 / NVGRE | + | +--------------------------------------------+ + | | Ether / VLAN / IPv6 / NVGRE / Ether | + | +--------------------------------------------+ + | | Ether / VLAN / IPv4 / UDP / GTPU | + | +--------------------------------------------+ + | | Ether / VLAN / IPv6 / UDP / GTPU | + +----------------+--------------------------------------------+ + + +Test Case: HW checksum offload check on scalar path +=================================================== +These set of cases based on existing cases are designed for better case managment for +regression test. + +Start testpmd with eal parameter --force-max-simd-bitwidth=64. Based on test steps of +'HW checksum offload check'. + +Test Case: HW checksum offload check on sse path +================================================ +Start testpmd with eal parameter --force-max-simd-bitwidth=128. Based on test steps of +'HW checksum offload check'. + +Test Case: HW checksum offload check on avx2 path +================================================= +Start testpmd with eal parameter --force-max-simd-bitwidth=256. Based on test steps of +'HW checksum offload check'. + +Test Case: HW checksum offload check on avx512 path +=================================================== +Start testpmd with eal parameter --force-max-simd-bitwidth=512. Based on test steps of +'HW checksum offload check'. + +Test Case: HW checksum offload check with vlan on scalar path +============================================================= + +Test Case: HW checksum offload check with vlan on sse path +============================================================= + +Test Case: HW checksum offload check with vlan on avx2 path +============================================================= + +Test Case: HW checksum offload check with vlan on avx512 path +============================================================= + +Test Case: HW tunneling checksum offload check on scalar path +============================================================= + +Test Case: HW tunneling checksum offload check on sse path +========================================================== + +Test Case: HW tunneling checksum offload check on avx2 path +=========================================================== + +Test Case: HW tunneling checksum offload check on avx512 path +============================================================= + +Test Case: HW tunneling checksum offload check with vlan on scalar path +======================================================================= + +Test Case: HW tunneling checksum offload check with vlan on sse path +==================================================================== + +Test Case: HW tunneling checksum offload check with vlan on avx2 path +===================================================================== + +Test Case: HW tunneling checksum offload check with vlan on avx512 path +======================================================================= + +Test Case: SW checksum offload check on scalar path +=================================================== + +Test Case: SW checksum offload check on sse path +================================================ + +Test Case: SW checksum offload check on avx2 path +================================================= + +Test Case: SW checksum offload check on avx512 path +=================================================== + + Prerequisites for TSO ===================== @@ -510,3 +639,32 @@ Test IPv6() in scapy:: for one_outer_packet in outer_packet_list: sendp([Ether(dst="%s", src="52:00:00:00:00:00")/one_outer_packet/IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=1021,dport=1021)/Raw(load=RandString(size=%s))], iface="%s", count = %s) + +Test case: csum fwd engine, use TSO, on scalar path +=================================================== +These set of cases based on existing cases are designed for better case managment for +regression test. + +Start testpmd with eal parameter --force-max-simd-bitwidth=64. Based on test steps of +'csum fwd engine, use TSO'. + +Test case: csum fwd engine, use TSO, on sse path +================================================ + +Test case: csum fwd engine, use TSO, on avx2 path +================================================= + +Test case: csum fwd engine, use TSO, on avx512 path +=================================================== + +Test case: csum fwd engine, use tunnel TSO, on scalar path +========================================================== + +Test case: csum fwd engine, use tunnel TSO, on sse path +======================================================= + +Test case: csum fwd engine, use tunnel TSO, on avx2 path +======================================================== + +Test case: csum fwd engine, use tunnel TSO, on avx512 path +==========================================================