From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E8599A050A; Sat, 7 May 2022 11:27:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D34A040696; Sat, 7 May 2022 11:27:23 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 40F1640395 for ; Sat, 7 May 2022 11:27:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651915642; x=1683451642; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zI+4gsAClOUYwbUcRoDb6YPmeF804IHLXi6XyEmGuHs=; b=MH4o1xdOD57cAIvq7+zILAkOC1+7mSFCBZNiY4nQPwQTv7TXAUh+xRqx L/ECqSS48cfj1veuH6pc7aHwxEmQYBFzJ5k16sSf0nQbhtyK3vGbN6pwg 8hdS8V243rGReNgqoHMj0K6TM/KFt4MgyUNgA5/D4FyMcIR/roM7JfX3J M5AfknSZypvVVJIhie6oiMFBThzub+flUPVnGaHX4Lhl5mU/eCYK1dckv lXePGALT3VDs2IIb2R8wSIKBD1wCyHTtYhsIompXhM8zZC/osyaYAC6SJ tvE82FaIgyVItONx4963y8uyPJy1wwE6xjX4pIQW7CRBbgB0mTGGd2QUT w==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="248590498" X-IronPort-AV: E=Sophos;i="5.91,206,1647327600"; d="scan'208";a="248590498" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2022 02:27:21 -0700 X-IronPort-AV: E=Sophos;i="5.91,206,1647327600"; d="scan'208";a="564245904" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2022 02:27:19 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 2/3] test_plans/dpdk_gro_lib_cbdma_test_plan: add dpdk_gro_lib_cbdma testplan Date: Sat, 7 May 2022 05:26:55 -0400 Message-Id: <20220507092655.309702-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Add new testplan test_plans/dpdk_gro_lib_cbdma_test_plan into test_plans. Signed-off-by: Wei Ling --- test_plans/dpdk_gro_lib_cbdma_test_plan.rst | 185 ++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 test_plans/dpdk_gro_lib_cbdma_test_plan.rst diff --git a/test_plans/dpdk_gro_lib_cbdma_test_plan.rst b/test_plans/dpdk_gro_lib_cbdma_test_plan.rst new file mode 100644 index 00000000..445540a6 --- /dev/null +++ b/test_plans/dpdk_gro_lib_cbdma_test_plan.rst @@ -0,0 +1,185 @@ +.. Copyright (c) <2022>, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +================================= +DPDK GRO lib with cbdma test plan +================================= + +Description +=========== + +Generic Receive Offload (GRO) is a widely used SW-based offloading +technique to reduce per-packet processing overheads. By reassembling +small packets into larger ones, GRO enables applications to process +fewer large packets directly, thus reducing the number of packets to +be processed. To benefit DPDK-based applications, like Open vSwitch, +DPDK also provides own GRO implementation. In DPDK, GRO is implemented +as a standalone library. Applications explicitly use the GRO library to +reassemble packets. + +In the GRO library, there are many GRO types which are defined by packet +types. One GRO type is in charge of process one kind of packets. For +example, TCP/IPv4 GRO processes TCP/IPv4 packets. + +Each GRO type has a reassembly function, which defines own algorithm and +table structure to reassemble packets. We assign input packets to the +corresponding GRO functions by MBUF->packet_type. + +The GRO library doesn't check if input packets have correct checksums and +doesn't re-calculate checksums for merged packets. The GRO library +assumes the packets are complete (i.e., MF==0 && frag_off==0), when IP +fragmentation is possible (i.e., DF==0). Additionally, it complies RFC +6864 to process the IPv4 ID field. + +Currently, the GRO library provides GRO supports for TCP/IPv4 packets and +VxLAN packets which contain an outer IPv4 header and an inner TCP/IPv4 +packet. + +This test plan includes dpdk gro lib test with TCP/IPv4 traffic with CBDMA. + +..Note: +1.For packed virtqueue virtio-net test, need qemu version > 4.2.0 and VM kernel version > 5.1, and packed ring multi-queues not support reconnect in qemu yet. +2.For split virtqueue virtio-net with multi-queues server mode test, need qemu version >= 5.2.0, dut to old qemu exist reconnect issue when multi-queues test. +3.DPDK local patch that about vhost pmd is needed when testing Vhost asynchronous data path with testpmd. + +Prerequisites +============= + +Modify the testpmd code as following:: + + --- a/app/test-pmd/csumonly.c + +++ b/app/test-pmd/csumonly.c + @@ -693,10 +693,12 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) +                  * and inner headers */ +   +                 eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + +#if 0 +                 ether_addr_copy(&peer_eth_addrs[fs->peer_addr], +                                 ð_hdr->d_addr); +                 ether_addr_copy(&ports[fs->tx_port].eth_addr, +                                 ð_hdr->s_addr); + +#endif +                 parse_ethernet(eth_hdr, &info); +                 l3_hdr = (char *)eth_hdr + info.l2_len; + +Modify the dpdk code as following:: + + diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c + index b38a4b6b1..573250dbe 100644 + --- a/drivers/net/vhost/rte_eth_vhost.c + +++ b/drivers/net/vhost/rte_eth_vhost.c + @@ -1071,8 +1071,14 @@ eth_dev_info(struct rte_eth_dev *dev, + dev_info->min_rx_bufsize = 0; + + dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS | + - DEV_TX_OFFLOAD_VLAN_INSERT; + - dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; + + DEV_TX_OFFLOAD_VLAN_INSERT | + + DEV_TX_OFFLOAD_UDP_CKSUM | + + DEV_TX_OFFLOAD_TCP_CKSUM | + + DEV_TX_OFFLOAD_IPV4_CKSUM | + + DEV_TX_OFFLOAD_TCP_TSO; + + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP | + + DEV_RX_OFFLOAD_TCP_CKSUM | + + DEV_RX_OFFLOAD_UDP_CKSUM | + + DEV_RX_OFFLOAD_IPV4_CKSUM | + + DEV_RX_OFFLOAD_TCP_LRO; + } + +Compile DPDK as following:: + + CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib --default-library=static x86_64-native-linuxapp-gcc + ninja -C x86_64-native-linuxapp-gcc -j 110 + +Test flow +========= + +NIC2(In kernel) -> NIC1(DPDK) -> testpmd(csum fwd) -> Vhost -> Virtio-net + + +Test Case1: DPDK GRO test with two queues and two CBDMA channels using tcp/ipv4 traffic +======================================================================================= + +Test flow +========= + + +1. Connect two nic port directly, put nic2 into another namesapce and turn on the tso of this nic port by below cmds:: + + ip netns del ns1 + ip netns add ns1 + ip link set enp26s0f0 netns ns1 # [enp216s0f0] is the name of nic2 + ip netns exec ns1 ifconfig enp26s0f0 1.1.1.8 up + ip netns exec ns1 ethtool -K enp26s0f0 tso on + +2. Bind cbdma port and nic1 to vfio-pci, launch vhost-user with testpmd and set flush interval to 1:: + + ./usertools/dpdk-devbind.py -b vfio-pci xx:xx.x + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 29-31 -n 4 \ + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,dmas=[txq0@80:04.0;txq1@80:04.1]' \ + -- -i --txd=1024 --rxd=1024 --txq=2 --rxq=2 --nb-cores=2 + testpmd> set fwd csum + testpmd> stop + testpmd> port stop 0 + testpmd> port stop 1 + testpmd> csum set tcp hw 0 + testpmd> csum set ip hw 0 + testpmd> csum set tcp hw 1 + testpmd> csum set ip hw 1 + testpmd> set port 0 gro on + testpmd> set gro flush 1 + testpmd> port start 0 + testpmd> port start 1 + testpmd> start + +3. Set up vm with virto device and using kernel virtio-net driver:: + + taskset -c 31 /home/qemu-install/qemu-4.2.1/bin/qemu-system-x86_64 -name us-vhost-vm1 \ + -cpu host -enable-kvm -m 2048 -object memory-backend-file,id=mem,size=2048M,mem-path=/mnt/huge,share=on \ + -numa node,memdev=mem \ + -mem-prealloc -monitor unix:/tmp/vm2_monitor.sock,server,nowait -netdev user,id=yinan,hostfwd=tcp:127.0.0.1:6005-:22 -device e1000,netdev=yinan \ + -smp cores=1,sockets=1 -drive file=/home/osimg/ubuntu2004.img \ + -chardev socket,id=char0,path=./vhost-net \ + -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce,queues=2 \ + -device virtio-net-pci,mac=52:54:00:00:00:01,netdev=mynet1,mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on,mq=on,vectors=15 \ + -vnc :10 -daemonize + +4. In vm, config the virtio-net device with ip and turn the kernel gro off:: + + ifconfig ens4 1.1.1.2 up # [ens3] is the name of virtio-net + ethtool -L ens4 combined 2 + ethtool -K ens4 gro off + +5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput, should be larger than 10Gbits/sec:: + + Host side : taskset -c 35 ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -m -P 2 + VM side: iperf -s -- 2.25.1