From patchwork Wed Jul 12 20:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 129513 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 D70C242E58; Wed, 12 Jul 2023 22:33:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0C2540F17; Wed, 12 Jul 2023 22:33:33 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 88A09400D5 for ; Wed, 12 Jul 2023 22:33:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689194011; x=1720730011; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=47MdeBddIPFx3MhPlUVxwgl5+jsvQU16HMUR6NikoCc=; b=GMGIUBqiVsT8wKk2tG4eJ1lWU8+vDqpaAYCAiv3LJprJEv2oe1c7L5Mb ouCx3Q2r5kKt7scQEvaGBwx00Xc/EeecfJqTAa1DMqZ2SvdhfIhpbSHUD GNr9sBcoHhVQLsfwD5JlkFmml5b2+iFYDvv7UDh7r2LFiVIPpGsuxOdlK hP/I7Gev14wNUeKKy4RfnHpU3QRYCQFsvD9DP+0OD/9VWyfvVQssJtq84 aSoVNT+eRQLrl/NLAARbuc+aUro15i6pN4NgmphIV+DxXHjQP/wppyDCx 1K63PjWkwfaGWpgV5z/ia4uS+pOchj6A9SWmouLBAcYLOlzf2AaJAJE55 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="362467056" X-IronPort-AV: E=Sophos;i="6.01,200,1684825200"; d="scan'208";a="362467056" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 13:33:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="715696959" X-IronPort-AV: E=Sophos;i="6.01,200,1684825200"; d="scan'208";a="715696959" Received: from dpdk-xuke-host.sh.intel.com ([10.67.114.220]) by orsmga007.jf.intel.com with ESMTP; 12 Jul 2023 13:33:28 -0700 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, tarcadia@qq.com, Jin Ling Subject: [DTS][Patch V1 1/2] test_plans/checksum_offload: Refactor checksum_offload case. Date: Wed, 12 Jul 2023 20:33:33 +0000 Message-Id: <20230712203334.2032445-2-ke1.xu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230712203334.2032445-1-ke1.xu@intel.com> References: <20230712203334.2032445-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 Update checksum_offload testplan. 1. Add description for tunnel scenario. 2. Add Common test steps and packet organization table to better show the test steps. 3. Update test cases and test scopes. Using HW and SW to describe checksum configuration. Add cases for enabling HW IP UDP TCP SCTP seperately. Add cases for inner HW enabled with enabling HW outer IP UDP seperately. 4. Update cases for NIC comaptibility. Add description for VLAN and AVX512 to fit specific testing scenarios required by several NICs. 5. RX scopes and offload flags are combined with varied packet type TX cases for better covering and more common validation. Co-authored-by: Ke Xu Co-authored-by: Jin Ling Signed-off-by: Ke Xu --- test_plans/checksum_offload_test_plan.rst | 1478 +++++++++------------ 1 file changed, 608 insertions(+), 870 deletions(-) diff --git a/test_plans/checksum_offload_test_plan.rst b/test_plans/checksum_offload_test_plan.rst index fab75857..57987b82 100644 --- a/test_plans/checksum_offload_test_plan.rst +++ b/test_plans/checksum_offload_test_plan.rst @@ -1,59 +1,71 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright(c) 2010-2017 Intel Corporation + Copyright(c) 2010-2023 Intel Corporation Copyright(c) 2018-2019 The University of New Hampshire -============================ -RX/TX Checksum Offload Tests -============================ +====================== +Checksum Offload Tests +====================== -The support of RX/TX L3/L4 Checksum offload features by Poll Mode Drivers consists in: +Description +=========== + +The support of RX/TX L3/L4 checksum offload features by Poll Mode Drivers consists in: On the RX side: - Verify IPv4 checksum by hardware for received packets. - Verify UDP/TCP/SCTP checksum by hardware for received packets. +- Verify tunneled outer IPv4 checksum by hardware for recieved packets. +- Verify tunneled outer UDP checksum by hardware for recieved packets. On the TX side: -- IPv4 checksum insertion by hardware in transmitted packets. -- IPv4/UDP checksum insertion by hardware in transmitted packets. -- IPv4/TCP checksum insertion by hardware in transmitted packets. -- IPv4/SCTP checksum insertion by hardware in transmitted packets (sctp - length in 4 bytes). -- IPv6/UDP checksum insertion by hardware in transmitted packets. -- IPv6/TCP checksum insertion by hardware in transmitted packets. -- IPv6/SCTP checksum insertion by hardware in transmitted packets (sctp - length in 4 bytes). - -RX/TX side, the insertion of a L3/L4 checksum by hardware can be enabled with the +- IPv4 checksum insertion by hardware/software in transmitted packets. +- UDP/TCP/SCTP checksum insertion by hardware/software in transmitted packets (sctp length in 4 bytes). +- Tunneled outer IPv4 checksum insertion by hardware/software in transmitted packets. +- Tunneled outer UDP checksum insertion by hardware/software in transmitted packets. + +RX/TX side, the insertion of a L3/L4 or tunneled outer 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 - csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw port_id + set fwd csum + 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. - +configured ports. Prerequisites ============= -If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in bios.When +Topology +-------- + + dut_port_0 <---> tester_port_0 + + dut_port_1 <---> tester_port_1 + +Software +-------- + + - dpdk: http://dpdk.org/git/dpdk + - scapy: http://www.secdev.org/projects/scapy/ + +Configuration and Setup +----------------------- + +If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in bios. When using vfio, use the following commands to load the vfio driver and bind it to the device under test:: modprobe vfio modprobe vfio-pci - usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id + usertools/dpdk-devbind.py --bind=vfio-pci -Assuming that ports ``0`` and ``2`` are connected to a traffic generator, -launch the ``testpmd`` with the following arguments:: +Based on the topology, launch the ``testpmd`` with the following arguments:: - ./build/app/dpdk-testpmd -cffffff -n 1 -- -i --burst=1 --txpt=32 \ - --txht=8 --txwt=0 --txfreet=0 --rxfreet=64 --mbcache=250 --portmask=0x5 - enable-rx-cksum + ./build/app/dpdk-testpmd -c <...> -n <...> -- -i <...> --enable-rx-cksum Set the verbose level to 1 to display information for each received packet:: @@ -65,944 +77,670 @@ Currently, our test scripts are based on not exchanging MAC addresses, mac-swap testpmd> csum mac-swap off 0 -Test Case: Insert IPv4/IPv6 UDP/TCP/SCTP checksum on the transmit packet -======================================================================== - -Setup the ``csum`` forwarding mode:: - - testpmd> set fwd csum - Set csum packet 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 - 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, IPv4/SCTP, IPv6/UDP, IPv6/TCP:: - - 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) - -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 -========================================================================== - -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 - -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")/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) - -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 -================================================================= - -Setup the ``csum`` forwarding mode:: - - testpmd> set fwd csum - Set csum packet 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 - 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. - -Send a packet ptypes is IP/UDP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=int(0x7ca0))/UDP(chksum=int(0x1126))/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168d06200, pkt_len=88, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/TCP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=int(0xf19f))/TCP(chksum=int(0x165f))/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168be5100, pkt_len=100, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/SCTP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=int(0xf127))/SCTP(chksum=int(0x2566b731))/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168be7600, pkt_len=94, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=132 l4_len=0 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=0 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_SCTP_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IPV6/UDP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6(src="::1")/UDP(chksum=int(0xf27))/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168d058c0, pkt_len=108, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 - -Send a packet ptypes is IPV6/TCP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6(src="::1")/TCP(chksum=int(0x9f5f))/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168d033c0, pkt_len=120, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV6 - -Send a packet ptypes is IP/UDP with a bad IP/UDP checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0x0)/UDP(chksum=0xf)/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168d00ec0, pkt_len=88, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/TCP with a bad IP/TCP checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0x0)/TCP(chksum=0xf)/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168cfe9c0, pkt_len=100, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/SCTP with a bad IP/SCTP checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0x0)/SCTP(chksum=0xf)/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168cfc4c0, pkt_len=94, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=132 l4_len=0 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=0 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_SCTP_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IPV6/UDP with a bad UDP checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6(src="::1")/UDP(chksum=0xf)/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168cf9fc0, pkt_len=108, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 - -Send a packet ptypes is IPV6/TCP with a bad TCP checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6(src="::1")/TCP(chksum=0xf)/('X'*50), iface=iface) - - Check the Rx checksum flags consistent with expected flags. - - port=0, mbuf=0x168cf9fc0, pkt_len=108, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 - -Test Case: Hardware Checksum Check L4 RX -=========================================== -This test involves testing many different scenarios with a L4 checksum. -A variety of tunneling protocols, L3 protocols and L4 protocols are combined -to test as many scenarios as possible. Currently, UDP, TCP and SCTP are used -as L4 protocols, with IP and IPv6 being used at level 3. The tested tunneling -protocols are VXLAN and GRE. - -Setup the ``csum`` forwarding mode:: - - testpmd> set fwd csum - Set csum packet 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 - 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 - -Send a packet ptypes is IP/UDP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP()/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_L4_CKSUM_GOOD in the packet received - - port=0, mbuf=0x2269df8780, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP(chksum=0xf)/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_L4_CKSUM_BAD in the packet received - - port=0, mbuf=0x2269df7e40, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/TCP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/TCP()/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_L4_CKSUM_GOOD in the packet received - - port=0, mbuf=0x2269df8780, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/TCP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/TCP(chksum=0xf)/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_L4_CKSUM_BAD in the packet received - - port=0, mbuf=0x2269df7e40, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/SCTP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/SCTP()/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_L4_CKSUM_GOOD in the packet received - - port=0, mbuf=0x2269df8780, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 +Common test steps +================= + +1. launch test-pmd to enable RX Checksum offload and for some NIC it enables a general set of RX Offloads:: + + ./dpdk/x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c <...> -n <...> -a <...> -- -i --enable-rx-cksum + +2. config testpmd:: + + set csum fwd mode and stop all port:: + + testpmd> set fwd csum + testpmd> port stop all + + Modify the following commands to configure checksum offload according to the test scenario of each case: + + testpmd> csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw port_id + + start all ports and fwd: + + testpmd> port start all + testpmd> set verbose 1 + testpmd> start + +3. start to capture packets on tester:: + + tester: tcpdump -i -Q in -e ether src 52:00:00:00:00:00 -w /tmp/ens10.pcap + +4. send packets with scapy:: + + Configure the packet generator to send multiple combinations of inner and outer packet parts + according to the test scenario of each case, refer to the following table: + ++------------------+---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| Packet Types | Packet Names | Packet organizations | ++==================+===========================+==============================================================================================================================+ +| | IP/UDP | IP(src="10.0.0.1") / UDP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | IP/TCP | IP(src="10.0.0.1") / TCP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | IP/SCTP | IP(src="10.0.0.1") / SCTP(sport=29999, dport=30000, chksum=0x0000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | IPv6/UDP | IPv6(src="::1") / UDP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | IPv6/TCP | IPv6(src="::1") / TCP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| Inner Parts | IPv6/SCTP | IPv6(src="::1") / SCTP(sport=29999, dport=30000, chksum=0x0000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | VLAN/IP/UDP | Dot1Q(vlan=100) / IP(src="10.0.0.1") / UDP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | VLAN/IP/TCP | Dot1Q(vlan=100) / IP(src="10.0.0.1") / TCP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | VLAN/IP/SCTP | Dot1Q(vlan=100) / IP(src="10.0.0.1") / SCTP(sport=29999, dport=30000, chksum=0x0000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | VLAN/IPv6/UDP | Dot1Q(vlan=100) / IPv6(src="::1") / UDP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | VLAN/IPv6/TCP | Dot1Q(vlan=100) / IPv6(src="::1") / TCP(sport=29999, dport=30000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| | VLAN/IPv6/SCTP | Dot1Q(vlan=100) / IPv6(src="::1") / SCTP(sport=29999, dport=30000, chksum=0x0000) / Raw(randstring(CSUM_PAYLOAD_SIZE)) | ++------------------+---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/VXLAN | IP(src="10.0.0.1") / UDP(dport=4789) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/VXLAN | IPv6() / UDP(dport=4789) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/VXLAN-GPE | IP(src="10.0.0.1") / UDP(sport=4790, dport=4790) / VXLAN() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/VXLAN-GPE | IPv6() / UDP(sport=4790, dport=4790) / VXLAN() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/VXLAN-GPE/Ether | IP(src="10.0.0.1") / UDP(sport=4790, dport=4790) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/VXLAN-GPE/Ether | IPv6() / UDP(sport=4790, dport=4790) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/GRE | IP(src="10.0.0.1", proto=47) / GRE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/GRE | IPv6(nh=47) / GRE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/GRE/Ether | IP(src="10.0.0.1", proto=47) / GRE() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/GRE/Ether | IPv6(nh=47) / GRE() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/NVGRE | IP(src="10.0.0.1", proto=47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/NVGRE | IPv6(nh=47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/GTPU | IP(src="10.0.0.1") / UDP(dport=2152) / GTP_U_Header(gtp_type=255, teid=0x123456) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/GTPU | IPv6() / UDP(dport=2152) / GTP_U_Header(gtp_type=255, teid=0x123456) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP/GENEVE | IP(src="10.0.0.1") / UDP(dport=6081, sport=29999) / GENEVE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IPv6/GENEVE | IPv6() / UDP(dport=6081, sport=29999) / GENEVE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |IP | IP(src="10.0.0.1") | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| Outer Parts |IPv6 | IPv6() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/VXLAN | Dot1Q(vlan=100) / IP(src="10.0.0.1") / UDP(dport=4789) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/VXLAN | Dot1Q(vlan=100) / IPv6() / UDP(dport=4789) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/VXLAN-GPE | Dot1Q(vlan=100) / IP(src="10.0.0.1") / UDP(sport=4790, dport=4790) / VXLAN() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/VXLAN-GPE | Dot1Q(vlan=100) / IPv6() / UDP(sport=4790, dport=4790) / VXLAN() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/VXLAN-GPE/Ether | Dot1Q(vlan=100) / IP(src="10.0.0.1") / UDP(sport=4790, dport=4790) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/VXLAN-GPE/Ether | Dot1Q(vlan=100) / IPv6() / UDP(sport=4790, dport=4790) / VXLAN() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/GRE | Dot1Q(vlan=100) / IP(src="10.0.0.1", proto=47) / GRE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/GRE | Dot1Q(vlan=100) / IPv6(nh=47) / GRE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/GRE/Ether | Dot1Q(vlan=100) / IP(src="10.0.0.1", proto=47) / GRE() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/GRE/Ether | Dot1Q(vlan=100) / IPv6(nh=47) / GRE() / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/NVGRE | Dot1Q(vlan=100) / IP(src="10.0.0.1", proto=47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/NVGRE | Dot1Q(vlan=100) / IPv6(nh=47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/GTPU | Dot1Q(vlan=100) / IP(src="10.0.0.1") / UDP(dport=2152) / GTP_U_Header(gtp_type=255, teid=0x123456) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/GTPU | Dot1Q(vlan=100) / IPv6() / UDP(dport=2152) / GTP_U_Header(gtp_type=255, teid=0x123456) | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP/GENEVE | Dot1Q(vlan=100) / IP(src="10.0.0.1") / UDP(dport=6081, sport=29999) / GENEVE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6/GENEVE | Dot1Q(vlan=100) / IPv6() / UDP(dport=6081, sport=29999) / GENEVE() | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IP | Dot1Q(vlan=100) / IP(src="10.0.0.1") | +| +---------------------------+------------------------------------------------------------------------------------------------------------------------------+ +| |VLAN/IPv6 | Dot1Q(vlan=100) / IPv6() | ++------------------+---------------------------+------------------------------------------------------------------------------------------------------------------------------+ + ++------------------+------------------+----------------------------+ +| Scenarios | Packet Types | Packet Names | ++==================+==================+============================+ +| | | IP/UDP | +| | +----------------------------+ +| | | IP/TCP | +| | +----------------------------+ +| CSUM NON-TUNNEL | Inner parts | IP/SCTP | +| PACKETS | +----------------------------+ +| | | IPv6/UDP | +| | +----------------------------+ +| | | IPv6/TCP | +| | +----------------------------+ +| | | IPv6/SCTP | ++------------------+------------------+----------------------------+ +| | | IP/VXLAN | +| | +----------------------------+ +| | | IPv6/VXLAN | +| | Outer parts +----------------------------+ +| | | IP/NVGRE | +| | +----------------------------+ +| | | IPv6/NVGRE | +| +------------------+----------------------------+ +| CSUM TUNNEL | | IP/UDP | +| PACKETS | +----------------------------+ +| | | IP/TCP | +| | +----------------------------+ +| | Inner parts | IP/SCTP | +| | +----------------------------+ +| | | IPv6/UDP | +| | +----------------------------+ +| | | IPv6/TCP | +| | +----------------------------+ +| | | IPv6/SCTP | ++------------------+------------------+----------------------------+ +| | | IP/VXLAN | +| | +----------------------------+ +| | | IPv6/VXLAN | +| | +----------------------------+ +| | | IP/VXLAN-GPE | +| | +----------------------------+ +| | | IPv6/VXLAN-GPE | +| | +----------------------------+ +| | | IP/VXLAN-GPE/Ether | +| | +----------------------------+ +| | | IPv6/VXLAN-GPE/Ether | +| | +----------------------------+ +| | | IP/GRE | +| | +----------------------------+ +| CSUM TUNNEL | Outer parts | IPv6/GRE | +| PACKETS | +----------------------------+ +| for Commons DDP | | IP/GRE/Ether | +| | +----------------------------+ +| | | IPv6/GRE/Ether | +| | +----------------------------+ +| | | IP/NVGRE | +| | +----------------------------+ +| | | IPv6/NVGRE | +| | +----------------------------+ +| | | IP/GTPU | +| | +----------------------------+ +| | | IPv6/GTPU | +| +------------------+----------------------------+ +| | | IP/UDP | +| | +----------------------------+ +| | | IP/TCP | +| | +----------------------------+ +| | Inner parts | IP/SCTP | +| | +----------------------------+ +| | | IPv6/UDP | +| | +----------------------------+ +| | | IPv6/TCP | +| | +----------------------------+ +| | | IPv6/SCTP | ++------------------+------------------+----------------------------+ +| | | VLAN/IP/UDP | +| | +----------------------------+ +| | | VLAN/IP/TCP | +| | +----------------------------+ +| CSUM NON-TUNNEL | Inner parts | VLAN/IP/SCTP | +| VLAN PACKETS | +----------------------------+ +| | | VLAN/IPv6/UDP | +| | +----------------------------+ +| | | VLAN/IPv6/TCP | +| | +----------------------------+ +| | | VLAN/IPv6/SCTP | ++------------------+------------------+----------------------------+ +| | | VLAN/IP/VXLAN | +| | +----------------------------+ +| | | VLAN/IPv6/VXLAN | +| | Outer parts +----------------------------+ +| | | VLAN/IP/NVGRE | +| | +----------------------------+ +| | | VLAN/IPv6/NVGRE | +| +------------------+----------------------------+ +| CSUM TUNNEL | | VLAN/IP/UDP | +| VLAN PACKETS | +----------------------------+ +| | | VLAN/IP/TCP | +| | +----------------------------+ +| | Inner parts | VLAN/IP/SCTP | +| | +----------------------------+ +| | | VLAN/IPv6/UDP | +| | +----------------------------+ +| | | VLAN/IPv6/TCP | +| | +----------------------------+ +| | | VLAN/IPv6/SCTP | ++------------------+------------------+----------------------------+ +| | | VLAN/IP/VXLAN | +| | +----------------------------+ +| | | VLAN/IPv6/VXLAN | +| | +----------------------------+ +| | | VLAN/IP/VXLAN-GPE | +| | +----------------------------+ +| | | VLAN/IPv6/VXLAN-GPE | +| | +----------------------------+ +| | | VLAN/IP/VXLAN-GPE/Ether | +| | +----------------------------+ +| | | VLAN/IPv6/VXLAN-GPE/Ether | +| | +----------------------------+ +| | | VLAN/IP/GRE | +| | +----------------------------+ +| CSUM TUNNEL | Outer parts | VLAN/IPv6/GRE | +| VLAN PACKETS | +----------------------------+ +| for Commons DDP | | VLAN/IP/GRE/Ether | +| | +----------------------------+ +| | | VLAN/IPv6/GRE/Ether | +| | +----------------------------+ +| | | VLAN/IP/NVGRE | +| | +----------------------------+ +| | | VLAN/IPv6/NVGRE | +| | +----------------------------+ +| | | VLAN/IP/GTPU | +| | +----------------------------+ +| | | VLAN/IPv6/GTPU | +| +------------------+----------------------------+ +| | | VLAN/IP/UDP | +| | +----------------------------+ +| | | VLAN/IP/TCP | +| | +----------------------------+ +| | Inner parts | VLAN/IP/SCTP | +| | +----------------------------+ +| | | VLAN/IPv6/UDP | +| | +----------------------------+ +| | | VLAN/IPv6/TCP | +| | +----------------------------+ +| | | VLAN/IPv6/SCTP | ++------------------+------------------+----------------------------+ + +5. stop capture packets and then stop fwd:: + + tester: pkill tcpdump + dut: testpmd> stop + +6. check rx and tx results:: + + Check if ``ol_flag`` contains these fields based on the checksum values of L3 and L4 in the sent packets, refer to the following table. + ++--------------+---------------------------------+--------------------------+ +| packet type | checksum value | check ol_flag | ++==============+=================================+==========================+ +| Inner | IPv4 (bad checksum) | `RX_IP_CKSUM_BAD` | +| +---------------------------------+--------------------------+ +| | IPv4 (good checksum) | `RX_IP_CKSUM GOOD` | +| +---------------------------------+--------------------------+ +| | TCP / UDP / SCTP (bad checksum) | `RX_L4_CKSUM_BAD` | +| +---------------------------------+--------------------------+ +| | TCP / UDP / SCTP (bad checksum) | `RX_L4_CKSUM_GOOD` | ++--------------+---------------------------------+--------------------------+ +| Outer | IPv4 (bad checksum) | `RX_OUTER_IP_CKSUM_BAD` | +| +---------------------------------+--------------------------+ +| | IPv4 (good checksum) | `RX_OUTER_IP_CKSUM GOOD` | +| +---------------------------------+--------------------------+ +| | UDP (bad checksum) | `RX_OUTER_L4_CKSUM_BAD` | +| +---------------------------------+--------------------------+ +| | UDP (good checksum) | `RX_OUTER_L4_CKSUM_GOOD` | ++--------------+---------------------------------+--------------------------+ + + + Check rx and tx statistics according to the checksum values of L3 and L4 in the sent packets, refer to the following packets. + ++------------------+-------------------------------------------------------------------+ +| entry | checkpoint | ++==================+===================================================================+ +| RX-packets | `RX-packets` = Num of sent packets | ++------------------+-------------------------------------------------------------------+ +| RX-total | `RX-total` = Num of sent packets | ++------------------+-------------------------------------------------------------------+ +| Bad-ipcsum | `Bad-ipcsum` = Sum of bad inner IP checksum in sent packets | ++------------------+-------------------------------------------------------------------+ +| Bad-l4csum | `Bad-l4csum` = Sum of bad inner L4 checksum in sent packets | ++------------------+-------------------------------------------------------------------+ +| Bad-outer-ipcsum | `Bad-outer-ipcsum` = Sum of bad outer IP checksum in sent packets | ++------------------+-------------------------------------------------------------------+ +| Bad-outer-l4csum | `Bad-outer-l4csum` = Sum of bad outer L4 checksum in sent packets | ++------------------+-------------------------------------------------------------------+ +| TX-packets | `TX-packets` = `RX-packets` (exclude tso cases) | ++------------------+-------------------------------------------------------------------+ +| TX-total | `TX-total` = `RX-total` (exclude tso cases) | ++------------------+-------------------------------------------------------------------+ + + Read pcap files with scapy and check if configured checksum values to insert of tx_packets are all correct:: + + >>> tx_pkts = rdpcap("/tmp/ens10.pcap") # tx_packets is of list of all tx pkts + >>> tx_pkts[0].show2() # will print all info about the first packet, compare the checksum with the ref checksum. + + +Support of NICs +=============== + +Here we list the NICs for features supported introduced above. For NICs not listed we should use default test scopes. + ++--------------------+------------------------------+--------------------+--------------------+------------------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+ +| NICs | IPv4 or IPv6 / TCP or UDP RX | IPv4 / SCTP RX | IPv6 / SCTP RX | IPv4 or IPv6 / TCP or UDP TX | IPv4 / SCTP TX | IPv6 / SCTP TX | VLAN RX | VLAN TX | Tunneled RX | Tunneled TX | ++====================+==============================+====================+====================+==============================+====================+====================+====================+====================+====================+====================+ +| E810 series | Yes | Yes | Yes | Yes | Partially | Partially | Yes | Yes | Partially | Partially | +| DDP OS Default | | | | | | | | | | | ++--------------------+------------------------------+--------------------+--------------------+------------------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+ +| E810 series | Yes | Yes | Yes | Yes | Partially | Partially | Yes | Yes | Yes | Yes | +| DDP Comms | | | | | | | | | | | ++--------------------+------------------------------+--------------------+--------------------+------------------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+ +| E710 series | Yes | Yes | Yes | Yes | Partially | Partially | Yes | Yes | Partially | Partially | ++--------------------+------------------------------+--------------------+--------------------+------------------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+ +| Lib SW | N/A | N/A | N/A | Yes | Partially | Partially | N/A | Yes | N/A | No | ++--------------------+------------------------------+--------------------+--------------------+------------------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+ +| Default | Yes | Yes | Yes | Yes | Partially | Partially | Req Config | Yes | No | No | ++--------------------+------------------------------+--------------------+--------------------+------------------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+ + + +Test case 1: HW IP non-tunneling +================================ + +This test is used to test non-tunneling packets and will enable hw ip checksum offload. +Configure the TX HW Offload:: + + csum set ip hw 1 + +Send packets of:: -Send a packet ptypes is IP/SCTP with a bad checksum:: + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/SCTP(chksum=0xf)/('X'*50), iface=iface) - check the packet received, the flag RTE_MBUF_F_RX_L4_CKSUM_BAD in the packet received +Test case 2: HW UDP non-tunneling +================================= - port=0, mbuf=0x2269df7e40, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 +This test is used to test non-tunneling packets and will enable hw udp checksum offload. +Configure the TX HW Offload:: -Verify flags are as expected. + csum set udp hw 1 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Test Case: Hardware Checksum Check L3 RX -=========================================== -This test involves testing L3 checksum hardware offload. -Due to the relative dominance of IPv4 and IPv6 as L3 protocols, and IPv6's -lack of a checksum, only IPv4's checksum is tested. + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) -Setup the ``csum`` forwarding mode:: +Check for the correct checksum insertion at the correct place. - testpmd> set fwd csum - Set csum packet forwarding mode -Start the packet forwarding:: +Test case 3: HW TCP non-tunneling +================================= - 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 - 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 +This test is used to test non-tunneling packets and will enable hw tcp checksum offload. +Configure the TX HW Offload:: -Send a packet ptypes is IP/UDP with a good checksum:: + csum set tcp hw 1 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP()/('X'*50), iface=iface) + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - check the packet received, the flag RTE_MBUF_F_RX_IP_CKSUM_GOOD in the packet received +Check for the correct checksum insertion at the correct place. - port=0, mbuf=0x2269df8780, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 -Send a packet ptypes is IP/UDP with a bad checksum:: +Test case 4: HW SCTP non-tunneling +================================== - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0xf)/UDP()/('X'*50), iface=iface) +This test is used to test non-tunneling packets and will enable hw sctp checksum offload. +Configure the TX HW Offload:: - check the packet received, the flag RTE_MBUF_F_RX_IP_CKSUM_BAD in the packet received + csum set sctp hw 1 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - port=0, mbuf=0x2269df7e40, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) -Send a packet ptypes is IP/TCP with a good checksum:: +Check for the correct checksum insertion at the correct place. - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/TCP()/('X'*50), iface=iface) - check the packet received, the flag RTE_MBUF_F_RX_IP_CKSUM_GOOD in the packet received - - port=0, mbuf=0x2269df8780, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/TCP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0xf)/TCP()/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_IP_CKSUM_BAD in the packet received - - port=0, mbuf=0x2269df7e40, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/SCTP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/SCTP()/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_IP_CKSUM_GOOD in the packet received - - port=0, mbuf=0x2269df8780, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Send a packet ptypes is IP/SCTP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0xf)/SCTP()/('X'*50), iface=iface) - - check the packet received, the flag RTE_MBUF_F_RX_IP_CKSUM_BAD in the packet received - - port=0, mbuf=0x2269df7e40, pkt_len=96, nb_segs=1: - rx: l2_len=18 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: flags=RTE_MBUF_F_TX_L4_NO_CKSUM RTE_MBUF_F_TX_IPV4 - -Verify flags are as expected. - -Test Case: Hardware Checksum Check L4 TX -=========================================== -This test involves testing many different scenarios with a L4 checksum. -A variety of tunneling protocols, L3 protocols and L4 protocols are combined -to test as many scenarios as possible. Currently, UDP and TCP are used -as L4 protocols, with IP and IPv6 being used at level 3. The tested tunneling -protocols are VXLAN and GRE. This test is used to determine whether the -hardware offloading of checksums works properly. - -Setup the ``csum`` forwarding mode:: - - testpmd> set fwd csum - Set csum packet 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 - 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_hardware_checksum_check_l4_tx_capture.pcap & - -Send a packet ptypes is IP/UDP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP(chksum=0xb161)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168d06200, pkt_len=90, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP(chksum=0xf)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168d06b40, pkt_len=90, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/TCP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/TCP(chksum=0x4904)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168d07480, pkt_len=102, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/TCP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/TCP(chksum=0xf)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168be47c0, pkt_len=102, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/UDP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6()/UDP(chksum=0xaf62)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168be5100, pkt_len=110, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6()/UDP(chksum=0xf)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168be5a40, pkt_len=110, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=8 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/TCP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6()/TCP(chksum=0x4705)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168be6380, pkt_len=122, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV6 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/TCP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPv6()/TCP(chksum=0xf)/Raw(load=b'x'), iface=iface) - - port=0, mbuf=0x168be6cc0, pkt_len=122, nb_segs=1: - rx: l2_len=14 ethertype=86dd l3_len=40 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=40 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV6 - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/UDP inner UDP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/UDP(chksum=0x9949)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168be7600, pkt_len=140, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/UDP inner UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/UDP(chksum=0xf)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168be7600, pkt_len=140, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/UDP outer UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/UDP()/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168be7600, pkt_len=140, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/UDP inter UDP and outer UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/UDP(chksum=0xf)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168be7600, pkt_len=140, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/TCP inner TCP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/TCP(chksum=0x30ec)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168d058c0, pkt_len=152, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/TCP inner TCP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/TCP(chksum=0xf)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168d04f80, pkt_len=152, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/TCP outer UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/TCP()/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168d04640, pkt_len=152, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IP/UDP/VXLAN/IP/TCP outer UDP and inner TCP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IP()/TCP(chksum=0xf)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168d03d00, pkt_len=152, nb_segs=1: - rx: l2_len=30 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=30 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/UDP inner UDP with a good checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/UDP(chksum=0x9949)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168d033c0, pkt_len=180, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/UDP inner UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/UDP(chksum=0xf)/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168d02a80, pkt_len=180, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/UDP outer UDP with a bad checksum:: - - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/UDP()/Raw(load=b'Y'), iface=iface) - - port=0, mbuf=0x168d02140, pkt_len=180, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM - - Inspect the pcap file from the packet capture and verify the checksums. - -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/UDP inter UDP and outer UDP with a bad checksum:: +Test case 5: HW IP + L4 non-tunneling +===================================== - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/UDP(chksum=0xf)/Raw(load=b'Y'), iface=iface) +This test is used to test non-tunneling packets and will enable IP and all L4 hw checksum offload. +Configure the TX HW Offload:: - port=0, mbuf=0x168d01800, pkt_len=180, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM + csum set ip hw 1 + csum set udp hw 1 + csum set tcp hw 1 + csum set sctp hw 1 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - Inspect the pcap file from the packet capture and verify the checksums. + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/TCP inner TCP with a good checksum:: +Check for the correct checksum insertion at the correct place. - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/TCP(chksum=0x30ec)/Raw(load=b'Y'), iface=iface) +For PMD not supporting VLAN defaultly, we run an extra case:: + + csum set ip hw 1 + csum set udp hw 1 + csum set tcp hw 1 + csum set sctp hw 1 + vlan set filter on 0 + rx_vlan add 100 0 - port=0, mbuf=0x168d00ec0, pkt_len=192, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - Inspect the pcap file from the packet capture and verify the checksums. + CSUM NON-TUNNEL VLAN PACKETS -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/TCP inner TCP with a bad checksum:: +Check for the correct checksum insertion at the correct place. - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP()/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/TCP(chksum=0xf)/Raw(load=b'Y'), iface=iface) - port=0, mbuf=0x168d00580, pkt_len=192, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM +Test case 6: HW Outer-IP tunneling +================================== - Inspect the pcap file from the packet capture and verify the checksums. +This test is used to test tunneling scenario and will enable Outer-IP checksum offload. +Configure the TX HW Offload:: -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/TCP outer UDP with a bad checksum:: + csum set ip hw 1 + csum set udp hw 1 + csum set tcp hw 1 + csum set sctp hw 1 + csum set outer-ip hw 1 + csum parse-tunnel on 1 + rx_vxlan_port add 4789 0 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/TCP()/Raw(load=b'Y'), iface=iface) + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - port=0, mbuf=0x168cffc40, pkt_len=192, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - Inspect the pcap file from the packet capture and verify the checksums. + CSUM TUNNEL PACKETS (common packets for common DDP) + CSUM TUNNEL VLAN PACKETS (for i40e and ice, common packets for common DDP) -Send a packet ptypes is IPV6/UDP/VXLAN/IPV6/TCP outer UDP and inner TCP with a bad checksum:: +Check for the correct checksum insertion at the correct place. - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/UDP(chksum=0xf)/VXLAN()/ - Ether(dst='ff:ff:ff:ff:ff:ff', src='00:00:00:00:00:00')/IPV6()/TCP(chksum=0xf)/Raw(load=b'Y'), iface=iface) - port=0, mbuf=0x168cff300, pkt_len=192, nb_segs=1: - rx: l2_len=30 ethertype=86dd l3_len=40 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=86dd outer_l3_len=40 - tx: m->l2_len=30 m->l3_len=40 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=40 - tx: flags=RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV6 RTE_MBUF_F_TX_OUTER_IPV6 RTE_MBUF_F_TX_TUNNEL_VXLAN RTE_MBUF_F_TX_OUTER_UDP_CKSUM +Test case 7: HW Outer-UDP tunneling +=================================== - Inspect the pcap file from the packet capture and verify the checksums. +This test is used to test tunneling scenario and will enable Outer-UDP checksum offload. +Configure the TX HW Offload:: -Send a packet ptypes is IP/GRE/IP/UDP inner UDP with a good checksum:: + csum set ip hw 1 + csum set udp hw 1 + csum set tcp hw 1 + csum set sctp hw 1 + csum set outer-udp hw 1 + csum parse-tunnel on 1 + rx_vxlan_port add 4789 0 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/GRE()/IP()/UDP(chksum=0x8131)/Raw(load=b'Z'), iface=iface) + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - port=0, mbuf=0x168cfe9c0, pkt_len=114, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - Inspect the pcap file from the packet capture and verify the checksums. + CSUM TUNNEL PACKETS (common packets for common DDP) + CSUM TUNNEL VLAN PACKETS (for i40e and ice, common packets for common DDP) -Send a packet ptypes is IP/GRE/IP/UDP inner UDP with a bad checksum:: +Check for the correct checksum insertion at the correct place. - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/GRE()/IP()/UDP(chksum=0xf)/Raw(load=b'Z'), iface=iface) - port=0, mbuf=0x168cfe080, pkt_len=114, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE +Test case 8: HW Outer-IP + Outer-UDP tunneling with SW Inner (w/o VLAN) +======================================================================= - Inspect the pcap file from the packet capture and verify the checksums. +This test is used to test tunneling scenario and will enable Outer-IP and Outer-UDP checksum offload. +Configure the TX HW Offload:: -Send a packet ptypes is IP/GRE/IP/TCP inner TCP with a good checksum:: + csum set outer-ip hw 1 + csum set outer-udp hw 1 + csum parse-tunnel on 1 + rx_vxlan_port add 4789 0 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/GRE()/IP()/TCP(chksum=0x18d4)/Raw(load=b'Z'), iface=iface) + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - port=0, mbuf=0x168cfd740, pkt_len=126, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - Inspect the pcap file from the packet capture and verify the checksums. + CSUM TUNNEL PACKETS (common packets for common DDP) + CSUM TUNNEL VLAN PACKETS (for i40e and ice, common packets for common DDP) -Send a packet ptypes is IP/GRE/IP/TCP inner TCP with a bad checksum:: +Check for the correct checksum insertion at the correct place. - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP()/GRE()/IP()/TCP(chksum=0xf)/Raw(load=b'Z'), iface=iface) +For PMD not supporting VLAN defaultly, we run an extra case:: + + csum set outer-ip hw 1 + csum set outer-udp hw 1 + csum parse-tunnel on 1 + vlan set filter on 0 + rx_vlan add 100 0 - port=0, mbuf=0x168cfce00, pkt_len=126, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - Inspect the pcap file from the packet capture and verify the checksums. + CSUM NON-TUNNEL VLAN PACKETS -Send a packet ptypes is IPV6/GRE/IPV6/UDP inner UDP with a good checksum:: +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/GRE()/IPV6()/UDP(chksum=0x8131)/Raw(load=b'Z'), iface=iface) + CSUM TUNNEL VLAN PACKETS - port=0, mbuf=0x168cfe9c0, pkt_len=114, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE +Check for the correct checksum insertion at the correct place. - Inspect the pcap file from the packet capture and verify the checksums. -Send a packet ptypes is IPV6/GRE/IPV6/UDP inner UDP with a bad checksum:: +Test case 9: HW Outer-IP + Outer-UDP tunneling with HW Inner (w/o VLAN, w/o AVX512) +=================================================================================== - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/GRE()/IPV6()/UDP(chksum=0xf)/Raw(load=b'Z'), iface=iface) +Test for both default path and for AVX512 path by adding EAL Parameter '--force-max-simd-bitwidth=512'. - port=0, mbuf=0x168cfe080, pkt_len=114, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=17 l4_len=8 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=8 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_UDP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE +This test is used to test tunneling scenario and will enable Outer-IP and Outer-UDP checksum offload. +Configure the TX HW Offload:: - Inspect the pcap file from the packet capture and verify the checksums. + csum set ip hw 1 + csum set udp hw 1 + csum set tcp hw 1 + csum set sctp hw 1 + csum set outer-ip hw 1 + csum set outer-udp hw 1 + csum parse-tunnel on 1 + rx_vxlan_port add 4789 0 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Send a packet ptypes is IPV6/GRE/IPV6/TCP inner TCP with a good checksum:: + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/GRE()/IPV6()/TCP(chksum=0x18d4)/Raw(load=b'Z'), iface=iface) +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - port=0, mbuf=0x168cfd740, pkt_len=126, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE + CSUM TUNNEL PACKETS (common packets for common DDP) + CSUM TUNNEL VLAN PACKETS (for i40e and ice, common packets for common DDP) - Inspect the pcap file from the packet capture and verify the checksums. +Check for the correct checksum insertion at the correct place. -Send a packet ptypes is IPV6/GRE/IPV6/TCP inner TCP with a bad checksum:: +For PMD not supporting VLAN defaultly, we run an extra case:: + + csum set ip hw 1 + csum set udp hw 1 + csum set tcp hw 1 + csum set sctp hw 1 + csum set outer-ip hw 1 + csum set outer-udp hw 1 + csum parse-tunnel on 1 + vlan set filter on 0 + rx_vlan add 100 0 - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IPV6()/GRE()/IPV6()/TCP(chksum=0xf)/Raw(load=b'Z'), iface=iface) +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - port=0, mbuf=0x168cfce00, pkt_len=126, nb_segs=1: - rx: l2_len=4 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_BAD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - rx: outer_l2_len=14 outer_ethertype=800 outer_l3_len=20 - tx: m->l2_len=4 m->l3_len=20 m->l4_len=20 - tx: m->outer_l2_len=14 m->outer_l3_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 RTE_MBUF_F_TX_OUTER_IP_CKSUM RTE_MBUF_F_TX_OUTER_IPV4 RTE_MBUF_F_TX_TUNNEL_GRE + CSUM NON-TUNNEL VLAN PACKETS - Inspect the pcap file from the packet capture and verify the checksums. +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Test Case: Hardware Checksum Check L3 TX -=========================================== -This test involves testing L3 checksum hardware offload. -Due to the relative dominance of IPv4 and IPv6 as L3 protocols, and IPv6's -lack of a checksum, only IPv4's checksum is tested. + CSUM TUNNEL VLAN PACKETS -Setup the ``csum`` forwarding mode:: +Check for the correct checksum insertion at the correct place. - testpmd> set fwd csum - Set csum packet forwarding mode -Start the packet forwarding:: +Test case 10: SW non-tunneling (w/o VLAN) +========================================= - 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 +This test is used to test tunneling scenario and will enable no checksum offload. +Configured in default. +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Start a packet capture on the tester in the background:: + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - # tcpdump -i -s 65535 -w /tmp/tester/test_hardware_checksum_check_l3_tx_capture.pcap & +Check for the correct checksum insertion at the correct place. -Send a packet ptypes is IP/TCP with a good checksum with a 1 in it's payload:: +For PMD not supporting VLAN defaultly, we run an extra case:: + + vlan set filter on 0 + rx_vlan add 100 0 - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0x7ccc)/TCP()/Raw(load=b'1'), iface=iface) +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: - port=0, mbuf=0x168d06200, pkt_len=60, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 + CSUM NON-TUNNEL VLAN PACKETS - Inspect the pcap file from the packet capture and verify the checksums. +Check for the correct checksum insertion at the correct place. -Send a packet ptypes is IP/TCP with a bad checksum with a 0 in it's payload:: - sendp(Ether(dst='23:00:00:00:00:00', src='52:00:00:00:00:00')/IP(chksum=0xf)/TCP()/Raw(load=b'1'), iface=iface) +Test case 11: SW tunneling (w/o VLAN, w/o AVX512) +================================================= - port=0, mbuf=0x168d06b40, pkt_len=60, nb_segs=1: - rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=6 l4_len=20 flags=RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_BAD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - tx: m->l2_len=14 m->l3_len=20 m->l4_len=20 - tx: flags=RTE_MBUF_F_TX_IP_CKSUM RTE_MBUF_F_TX_TCP_CKSUM RTE_MBUF_F_TX_IPV4 +Test for both default path and for AVX512 path by adding EAL Parameter '--force-max-simd-bitwidth=512'. - Inspect the pcap file from the packet capture and verify the checksums. +This test is used to test tunneling scenario and will enable no checksum offload. +Configure the TX HW Offload:: -Test Case: checksum offload with vlan -===================================== + csum parse-tunnel on 1 + rx_vxlan_port add 4789 0 + +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Setup the ``csum`` forwarding mode:: + CSUM NON-TUNNEL PACKETS + CSUM NON-TUNNEL VLAN PACKETS (for i40e and ice) - testpmd> set fwd csum - Set csum packet forwarding mode +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Enable the IPv4/UDP/TCP/SCTP checksum offload on port 0:: + CSUM TUNNEL PACKETS (common packets for common DDP) + CSUM TUNNEL VLAN PACKETS (for i40e and ice, common packets for common DDP) - 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 +Check for the correct checksum insertion at the correct place. -Start a packet capture on the tester in the background:: +For PMD not supporting VLAN defaultly, we run an extra case:: + + csum parse-tunnel on 1 + vlan set filter on 0 + rx_vlan add 100 0 - tcpdump -i -s 65535 -w /tmp/tester/test_checksum_capture.pcap & +Send packets of below with bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Send the following multiple packets from tester for with scapy -combination: IPv4/UDP, IPv4/TCP, IPv6/UDP, IPv6/TCP:: + CSUM NON-TUNNEL VLAN PACKETS - 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) +Send packets of below with bad Outer-IP checksum, bad Outer-L4 checksum, bad IP checksum, bad L4 checksum, bad all checksum, good all checksum:: -Then verify that the same number of packet are correctly received on the tester. + CSUM TUNNEL VLAN PACKETS -Inspect the pcap file from the packet capture and verify the checksums. +Check for the correct checksum insertion at the correct place.