From patchwork Fri Sep 23 05:53:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 116714 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 F13BDA0544; Fri, 23 Sep 2022 07:53:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E909340150; Fri, 23 Sep 2022 07:53:05 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 287FF4003C for ; Fri, 23 Sep 2022 07:53:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663912384; x=1695448384; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+m2rFvC30TFl+i8ANz3peyGBJST/Drc3uOKNrv17Z4Q=; b=Bxot+FEpD22OE64yBxgHsppJlLBRd3OtjVeUXvftsQIT56ifaD7hqIh8 CvCHnQMGtmwVGUEHU/udqWRTbCCt1HE//T1RxhNqyAGxLLU4SmVOxtQlm wSxp8bo6uriscRacc8guB7oa/ucMRhdfqlvjiNrsrc0bORVnAO1BKz1d2 meGf+YX7qECStV9g3amaqTs4gq4sVXs8a+iy3Ub6bIVoRBPir6hnEa2xg 09K75jFS3XmDgDdeK8Sy3kD1olLvXq+t9b+2tlpH0AVFTAGlTTO1BMETU c6KR+Nv6YDMJkciiUGKY0DbpcUee5/bIWXYJBV88XgL9vTRpyD92U4tZ2 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="280884643" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="280884643" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 22:53:03 -0700 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="724003951" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 22:53:01 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Lingli Chen , Fu@dpdk.org, Qi Subject: [dts][PATCH V3 1/2] test_plans/checksum_offload: checksum suite script and testplan optimization Date: Fri, 23 Sep 2022 13:53:20 +0800 Message-Id: <20220923055321.23361-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 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 Optimize the test case name to match test plan, add test case in test plan to map test suite and delete the cmd "tx_checksum set 0x0 0" using "csum set". Signed-off-by: Weiyuan Li --- Tested-by: Lingli Chen Acked-by: Fu, Qi v2: -modify test plan delete IXIA description. v3: -delete case "Validate checksum on the receive packet". -optimize the case in the test plan enable csum to used "csum set ip|tcp|udp|sctp hw 0. -optimzie the test steps of cases in the test plan change from IXIA to scapy. test_plans/checksum_offload_test_plan.rst | 177 +++++++++++++--------- 1 file changed, 109 insertions(+), 68 deletions(-) diff --git a/test_plans/checksum_offload_test_plan.rst b/test_plans/checksum_offload_test_plan.rst index 346cca8f..00db1a74 100644 --- a/test_plans/checksum_offload_test_plan.rst +++ b/test_plans/checksum_offload_test_plan.rst @@ -25,28 +25,16 @@ On the TX side: - IPv6/SCTP checksum insertion by hardware in transmitted packets (sctp length in 4 bytes). -RX side, the L3/L4 checksum offload by hardware can be enabled with the -following command of the ``testpmd`` application:: - - enable-rx-cksum - -TX side, the insertion of a L3/L4 checksum by hardware can be enabled with the +RX/TX side, the insertion of a L3/L4 checksum by hardware can be enabled with the following command of the ``testpmd`` application and running in a dedicated tx checksum mode:: set fwd csum - tx_checksum set mask port_id + csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw port_id The transmission of packet is done with the ``start`` command of the ``testpmd`` application that will receive packets and then transmit the packet out on all -configured ports. ``mask`` is used to indicated what hardware checksum -offload is required on the ``port_id``. Please check the NIC datasheet for the -corresponding Hardware limits:: - - bit 0 - insert ip checksum offload if set - bit 1 - insert udp checksum offload if set - bit 2 - insert tcp checksum offload if set - bit 3 - insert sctp checksum offload if set +configured ports. Prerequisites @@ -71,39 +59,6 @@ Set the verbose level to 1 to display information for each received packet:: testpmd> set verbose 1 -Test Case: Validate checksum on the receive packet -================================================== - -Setup the ``csum`` forwarding mode:: - - testpmd> set fwd csum - Set csum packet forwarding mode - -Start the packet forwarding:: - - testpmd> start - csum packet forwarding - CRC stripping disabled - packets/burst=32 - nb forwarding cores=1 - nb forwarding ports=10 - RX queues=1 - RX desc=128 - RX free threshold=64 - RX threshold registers: pthresh=8 hthresh=8 wthresh=4 - TX queues=1 - TX desc=512 - TX free threshold=0 - TX threshold registers: pthresh=32 hthresh=8 wthresh=8 - -Configure the traffic generator to send the multiple packets with the following -combination: good/bad ip checksum + good/bad udp/tcp checksum. - -Except that SCTP header + payload length must be a multiple of 4 bytes. -IPv4 + UDP/TCP packet length can range from the minimum length to 1518 bytes. - -Then verify that how many packets found with Bad-ipcsum or Bad-l4csum:: - - testpmd> stop - ---------------------- Forward statistics for port 0 ---------------------- - RX-packets: 0 RX-dropped: 0 RX-total: 0 - Bad-ipcsum: 0 Bad-l4csum: 0 - TX-packets: 0 TX-dropped: 0 TX-total: 0 - ---------------------------------------------------------------------------- - Test Case: Insert IPv4/IPv6 UDP/TCP/SCTP checksum on the transmit packet ======================================================================== @@ -113,9 +68,14 @@ Setup the ``csum`` forwarding mode:: testpmd> set fwd csum Set csum packet forwarding mode -Enable the IPv4/UDP/TCP/SCTP checksum offload on port 0:: +Start the packet forwarding:: - testpmd> tx_checksum set 0xf 0 + testpmd> port stop all + testpmd> csum set ip hw 0 + testpmd> csum set udp hw 0 + testpmd> csum set tcp hw 0 + testpmd> csum set sctp hw 0 + testpmd> port start all testpmd> start csum packet forwarding - CRC stripping disabled - packets/burst=32 nb forwarding cores=1 - nb forwarding ports=10 @@ -124,17 +84,23 @@ Enable the IPv4/UDP/TCP/SCTP checksum offload on port 0:: TX queues=1 - TX desc=512 - TX free threshold=0 TX threshold registers: pthresh=32 hthresh=8 wthresh=8 -Configure the traffic generator to send the multiple packets for the following -combination: IPv4/UDP, IPv4/TCP, IPv4/SCTP, IPv6/UDP, IPv6/TCP. +Start a packet capture on the tester in the background:: + + tcpdump -i -s 65535 -w /tmp/tester/test_checksum_capture.pcap & -Except that SCTP header + payload length must be a multiple of 4 bytes. -IPv4 + UDP/TCP packet length can range from the minimum length to 1518 bytes. +Send the following multiple packets from tester for with scapy +combination: IPv4/UDP, IPv4/TCP, IPv4/SCTP, IPv6/UDP, IPv6/TCP:: -Then verify that the same number of packet are correctly received on the traffic -generator side. And IPv4 checksum, TCP checksum, UDP checksum, SCTP CRC32c need -be validated as pass by the IXIA. + sendp([Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IP(chksum=0x0)/UDP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IP(chksum=0x0)/TCP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IP(chksum=0x0)/SCTP(chksum=0x0)/("X"*48), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IPv6(src="::1")/UDP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46)], + iface="ens192f0",count=4,inter=0,verbose=False) -The IPv4 source address will not be changed by testpmd. +Then verify that the same number of packet are correctly received on the tester. + +Inspect the pcap file from the packet capture and verify the checksums. Test Case: Do not insert IPv4/IPv6 UDP/TCP checksum on the transmit packet @@ -145,9 +111,8 @@ Setup the ``csum`` forwarding mode:: testpmd> set fwd csum Set csum packet forwarding mode -Disable the IPv4/UDP/TCP/SCTP checksum offload on port 0:: +Start the packet forwarding:: - testpmd> tx_checksum set 0x0 0 testpmd> start csum packet forwarding - CRC stripping disabled - packets/burst=32 nb forwarding cores=1 - nb forwarding ports=10 @@ -156,18 +121,22 @@ Disable the IPv4/UDP/TCP/SCTP checksum offload on port 0:: TX queues=1 - TX desc=512 - TX free threshold=0 TX threshold registers: pthresh=32 hthresh=8 wthresh=8 -Configure the traffic generator to send the multiple packets for the following -combination: IPv4/UDP, IPv4/TCP, IPv6/UDP, IPv6/TCP. +Start a packet capture on the tester in the background:: -IPv4 + UDP/TCP packet length can range from the minimum length to 1518 bytes. + tcpdump -i -s 65535 -w /tmp/tester/test_checksum_capture.pcap & -Then verify that the same number of packet are correctly received on the traffic -generator side. And IPv4 checksum, TCP checksum, UDP checksum need -be validated as pass by the IXIA. +Send the following multiple packets from tester for with scapy +combination: IPv4/UDP, IPv4/TCP, IPv6/UDP, IPv6/TCP:: + + sendp([Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IP(src="10.0.0.1",chksum=0x0)/UDP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IP(src="10.0.0.1",chksum=0x0)/TCP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IPv6(src="::1")/UDP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46)], + iface="ens192f0",count=4,inter=0,verbose=False) -The first byte of source IPv4 address will be increment by testpmd. The checksum -is indeed recalculated by software algorithms. +Then verify that the same number of packet are correctly received on the tester. +Inspect the pcap file from the packet capture and verify the checksums. Test Case: Validate RX checksum valid flags on the receive packet ================================================================= @@ -179,6 +148,12 @@ Setup the ``csum`` forwarding mode:: Start the packet forwarding:: + testpmd> port stop all + testpmd> csum set ip hw 0 + testpmd> csum set udp hw 0 + testpmd> csum set tcp hw 0 + testpmd> csum set sctp hw 0 + testpmd> port start all testpmd> start csum packet forwarding - CRC stripping disabled - packets/burst=32 nb forwarding cores=1 - nb forwarding ports=10 @@ -315,6 +290,12 @@ Setup the ``csum`` forwarding mode:: Start the packet forwarding:: + testpmd> port stop all + testpmd> csum set ip hw 0 + testpmd> csum set udp hw 0 + testpmd> csum set tcp hw 0 + testpmd> csum set sctp hw 0 + testpmd> port start all testpmd> start csum packet forwarding - CRC stripping disabled - packets/burst=32 nb forwarding cores=1 - nb forwarding ports=10 @@ -398,6 +379,13 @@ Setup the ``csum`` forwarding mode:: Start the packet forwarding:: + testpmd> port stop all + testpmd> csum set ip hw 0 + testpmd> csum set udp hw 0 + testpmd> csum set tcp hw 0 + testpmd> csum set sctp hw 0 + testpmd> csum set 0xf 0 + testpmd> port start all testpmd> start csum packet forwarding - CRC stripping disabled - packets/burst=32 nb forwarding cores=1 - nb forwarding ports=10 @@ -484,6 +472,12 @@ Setup the ``csum`` forwarding mode:: Start the packet forwarding:: + testpmd> port stop all + testpmd> csum set ip hw 0 + testpmd> csum set udp hw 0 + testpmd> csum set tcp hw 0 + testpmd> csum set sctp hw 0 + testpmd> port start all testpmd> start csum packet forwarding - CRC stripping disabled - packets/burst=32 nb forwarding cores=1 - nb forwarding ports=10 @@ -926,6 +920,12 @@ Setup the ``csum`` forwarding mode:: Start the packet forwarding:: + testpmd> port stop all + testpmd> csum set ip hw 0 + testpmd> csum set udp hw 0 + testpmd> csum set tcp hw 0 + testpmd> csum set sctp hw 0 + testpmd> port start all testpmd> start csum packet forwarding - CRC stripping disabled - packets/burst=32 nb forwarding cores=1 - nb forwarding ports=10 @@ -960,3 +960,44 @@ Send a packet ptypes is IP/TCP with a bad checksum with a 0 in it's payload:: Inspect the pcap file from the packet capture and verify the checksums. +Test Case: checksum offload with vlan +===================================== + +Setup the ``csum`` forwarding mode:: + + testpmd> set fwd csum + Set csum packet forwarding mode + +Enable the IPv4/UDP/TCP/SCTP checksum offload on port 0:: + + testpmd> port stop all + testpmd> csum set ip hw 0 + testpmd> csum set udp hw 0 + testpmd> csum set tcp hw 0 + testpmd> csum set sctp hw 0 + testpmd> port start all + testpmd> start + csum packet forwarding - CRC stripping disabled - packets/burst=32 + nb forwarding cores=1 - nb forwarding ports=10 + RX queues=1 - RX desc=128 - RX free threshold=64 + RX threshold registers: pthresh=8 hthresh=8 wthresh=4 + TX queues=1 - TX desc=512 - TX free threshold=0 + TX threshold registers: pthresh=32 hthresh=8 wthresh=8 + +Start a packet capture on the tester in the background:: + + tcpdump -i -s 65535 -w /tmp/tester/test_checksum_capture.pcap & + +Send the following multiple packets from tester for with scapy +combination: IPv4/UDP, IPv4/TCP, IPv6/UDP, IPv6/TCP:: + + sendp([Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IP(chksum=0x0)/UDP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IP(chksum=0x0)/TCP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IP(chksum=0x0)/SCTP(chksum=0x0)/("X"*48), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IPv6(src="::1")/UDP(chksum=0xf)/("X"*46), + Ether(dst="52:00:00:00:00:01", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46)], + iface="ens192f0",count=4,inter=0,verbose=False) + +Then verify that the same number of packet are correctly received on the tester. + +Inspect the pcap file from the packet capture and verify the checksums. \ No newline at end of file From patchwork Fri Sep 23 05:53:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 116715 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 1F980A0544; Fri, 23 Sep 2022 07:53:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AD0A400D7; Fri, 23 Sep 2022 07:53:07 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 9D5EB4003C for ; Fri, 23 Sep 2022 07:53:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663912385; x=1695448385; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UrgkAPExzFtMvDrcXyTUyJh4Ls7TYmJYh1sIcaUmD8o=; b=ZMHGUqjqIdJAF4dSX5O4d0M5v4+yFJYjOJ+jmFiOp1VSBnRHUXXAliEY cYwhGgCDNt4izAqFKpS4FvlJ+BJbj9uWYXdrAD24k1kqoK9FFSAZ+C0j5 BeNv7/yMglKBQ+6Ux+/fLrjh4fmSQDhkBJmzjizlUiz0iCOJzjrjmwdd1 35iw+0l+L9aF9EkFM2B+VzNzoMXFxgp8RMjOeG8ek9OsqIkNmFy4LOzrv ydCOdxHpDkGb+CkQoYDAlOD9M7oyKqToWVFd34WOdEaDmoM/G9SLNJlw/ 2aZADwugtO4BiP+Vb1tEq4h7LewGnPAHAiIUKVgeQRTTa+7rn9Uso5X/F Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="280884646" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="280884646" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 22:53:05 -0700 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="724003959" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 22:53:03 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Lingli Chen , Fu@dpdk.org, Qi Subject: [dts][PATCH V3 2/2] tests/checksum_offload: checksum suite script and testplan optimization Date: Fri, 23 Sep 2022 13:53:21 +0800 Message-Id: <20220923055321.23361-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220923055321.23361-1-weiyuanx.li@intel.com> References: <20220923055321.23361-1-weiyuanx.li@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 Optimize the test case name to match test plan, add test case in test plan to map test suite and delete the cmd "tx_checksum set 0x0 0" using "csum set". Signed-off-by: Weiyuan Li Acked-by: Lijuan Tu --- Tested-by: Lingli Chen Acked-by: Fu, Qi v2: -modify test plan delete IXIA description. v3: -delete case "Validate checksum on the receive packet". -optimize the case in the test plan enable csum to used "csum set ip|tcp|udp|sctp hw 0. -optimzie the test steps of cases in the test plan change from IXIA to scapy. tests/TestSuite_checksum_offload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_checksum_offload.py b/tests/TestSuite_checksum_offload.py index 1ccc884c..b181bf37 100644 --- a/tests/TestSuite_checksum_offload.py +++ b/tests/TestSuite_checksum_offload.py @@ -605,7 +605,7 @@ class TestChecksumOffload(TestCase): # send the packet checksum value different from the expected value self.checksum_valid_flags(pkts_bad, 0) - def test_checksum_offload_enable(self): + def test_insert_checksum_on_the_transmit_packet(self): """ Insert IPv4/IPv6 UDP/TCP/SCTP checksum on the transmit packet. Enable Checksum offload. @@ -654,7 +654,7 @@ class TestChecksumOffload(TestCase): self.verify(len(result) == 0, ",".join(list(result.values()))) - def test_checksum_offload_disable(self): + def test_do_not_insert_checksum_on_the_transmit_packet(self): """ Do not insert IPv4/IPv6 UDP/TCP checksum on the transmit packet. Disable Checksum offload.