From patchwork Thu Aug 13 13:55:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Wang, Yinan" X-Patchwork-Id: 75473 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DBB6DA04B0; Thu, 13 Aug 2020 07:56:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B06911C00D; Thu, 13 Aug 2020 07:56:12 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 6009D1C002 for ; Thu, 13 Aug 2020 07:56:11 +0200 (CEST) IronPort-SDR: AEl/cn+ZPumarxNNgXVi/LOE49Q6xO/z5gbZK3t6IL/P3ta4X6cn/RwFuC/oQf/MoSS3P5gi0E GLovPEC+ffYg== X-IronPort-AV: E=McAfee;i="6000,8403,9711"; a="239002974" X-IronPort-AV: E=Sophos;i="5.76,307,1592895600"; d="scan'208";a="239002974" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 22:56:10 -0700 IronPort-SDR: Fhhbd25QBNZ/xc7HvBOk0eiMXlwXR4wqnwAf9ivJV7vvixTK6CzIYq32ntYyKNrw98raR48Bgi FpBLqwCWYC4w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,307,1592895600"; d="scan'208";a="470099739" Received: from dpdk-yinan-ntb2.sh.intel.com ([10.67.119.177]) by orsmga005.jf.intel.com with ESMTP; 12 Aug 2020 22:56:08 -0700 From: Yinan Wang To: dts@dpdk.org Cc: Yinan Wang Date: Thu, 13 Aug 2020 09:55:47 -0400 Message-Id: <20200813135547.95759-1-yinan.wang@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [dts] [PATCH v1] test_plans: add vhost cbdma enable case in dpdk_gro_lib test_plan X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "dts" Signed-off-by: Yinan Wang --- test_plans/dpdk_gro_lib_test_plan.rst | 143 +++++++++++++++++++------- 1 file changed, 105 insertions(+), 38 deletions(-) diff --git a/test_plans/dpdk_gro_lib_test_plan.rst b/test_plans/dpdk_gro_lib_test_plan.rst index 410ae68..3e06906 100644 --- a/test_plans/dpdk_gro_lib_test_plan.rst +++ b/test_plans/dpdk_gro_lib_test_plan.rst @@ -1,4 +1,4 @@ -.. Copyright (c) <2019>, Intel Corporation +.. Copyright (c) <2020>, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -34,6 +34,9 @@ DPDK GRO lib 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 @@ -84,12 +87,34 @@ Modify the testpmd code as following::                 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; + } + Test flow ========= -:: - - NIC2(In kernel) -> NIC1(DPDK) -> testpmd(csum fwd) -> Vhost -> Virtio-net +NIC2(In kernel) -> NIC1(DPDK) -> testpmd(csum fwd) -> Vhost -> Virtio-net Test Case1: DPDK GRO lightmode test with tcp/ipv4 traffic ========================================================= @@ -121,12 +146,9 @@ Test Case1: DPDK GRO lightmode test with tcp/ipv4 traffic testpmd>port start 1 testpmd>start -3. Set up vm with virto device and using kernel virtio-net driver: +3. Set up vm with virto device and using kernel virtio-net driver:: - :: - - taskset -c 13 \ - qemu-system-x86_64 -name us-vhost-vm1 \ + taskset -c 13 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 -net nic,vlan=2,macaddr=00:00:00:08:e8:aa,addr=1f -net user,vlan=2,hostfwd=tcp:127.0.0.1:6001-:22 \ @@ -141,7 +163,7 @@ Test Case1: DPDK GRO lightmode test with tcp/ipv4 traffic ifconfig [ens3] 1.1.1.2 up # [ens3] is the name of virtio-net ethtool -K [ens3] gro off -5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log:: +5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log can get expected data:: Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -m -P 1 VM side: iperf -s @@ -176,12 +198,9 @@ Test Case2: DPDK GRO heavymode test with tcp/ipv4 traffic testpmd>port start 1 testpmd>start -3. Set up vm with virto device and using kernel virtio-net driver: - - :: +3. Set up vm with virto device and using kernel virtio-net driver:: - taskset -c 13 \ - qemu-system-x86_64 -name us-vhost-vm1 \ + taskset -c 13 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 -net nic,vlan=2,macaddr=00:00:00:08:e8:aa,addr=1f -net user,vlan=2,hostfwd=tcp:127.0.0.1:6001-:22 \ @@ -196,7 +215,7 @@ Test Case2: DPDK GRO heavymode test with tcp/ipv4 traffic ifconfig [ens3] 1.1.1.2 up # [ens3] is the name of virtio-net ethtool -K [ens3] gro off -5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log:: +5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log can get expected data:: Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -m -P 1 VM side: iperf -s @@ -231,12 +250,9 @@ Test Case3: DPDK GRO heavymode_flush4 test with tcp/ipv4 traffic testpmd>port start 1 testpmd>start -3. Set up vm with virto device and using kernel virtio-net driver: +3. Set up vm with virto device and using kernel virtio-net driver:: - :: - - taskset -c 13 \ - qemu-system-x86_64 -name us-vhost-vm1 \ + taskset -c 13 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 -net nic,vlan=2,macaddr=00:00:00:08:e8:aa,addr=1f -net user,vlan=2,hostfwd=tcp:127.0.0.1:6001-:22 \ @@ -251,7 +267,7 @@ Test Case3: DPDK GRO heavymode_flush4 test with tcp/ipv4 traffic ifconfig [ens3] 1.1.1.2 up # [ens3] is the name of virtio-net ethtool -K [ens3] gro off -5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log:: +5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log can get expected data:: Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -m -P 1 VM side: iperf -s @@ -261,15 +277,11 @@ Test Case4: DPDK GRO test with vxlan traffic Vxlan topology -------------- - -:: - - VM Host - 50.1.1.2 50.1.1.1 - | | - 1.1.2.3 1.1.2.4 - |------------Testpmd------------| - + VM Host +50.1.1.2 50.1.1.1 + | | +1.1.2.3 1.1.2.4 + |------------Testpmd------------| 1. Connect two nic port directly, put nic2 into another namesapce and create Host VxLAN port:: @@ -308,12 +320,9 @@ Vxlan topology testpmd>port start 1 testpmd>start -3. Set up vm with virto device and using kernel virtio-net driver: +3. Set up vm with virto device and using kernel virtio-net driver:: - :: - - taskset -c 13 \ - qemu-system-x86_64 -name us-vhost-vm1 \ + taskset -c 13 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 -net nic,vlan=2,macaddr=00:00:00:08:e8:aa,addr=1f -net user,vlan=2,hostfwd=tcp:127.0.0.1:6001-:22 \ @@ -332,7 +341,65 @@ Vxlan topology ifconfig [ens3] 1.1.2.3/24 up ifconfig -a -5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log:: +5. Start iperf test, run iperf server at vm side and iperf client at host side, check throughput in log can get expected data:: Host side : ip netns exec t2 iperf -c 50.1.1.2 -i 2 -t 60 -f g -m - VM side: iperf -s -f g \ No newline at end of file + VM side: iperf -s -f g + +Test Case5: DPDK GRO test with CBDMA enable using tcp/ipv4 traffic +================================================================== + +Test flow +========= + +NIC2(In kernel) -> NIC1(DPDK) -> testpmd(csum fwd) -> Vhost -> Virtio-net + +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 igb_uio, launch vhost-user with testpmd and set flush interval to 1:: + + ./dpdk-devbind.py -b igb_uio xx:xx.x + ./x86_64-native-linuxapp-gcc/app/testpmd -l 29-30 -n 4 \ + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,dmas=[txq0@80:04.0;txq1@80:04.1],dmathr=1024' -- -i --txd=1024 --rxd=1024 --txq=2 --rxq=2 + set fwd csum + stop + port stop 0 + port stop 1 + csum set tcp hw 0 + csum set ip hw 0 + csum set tcp hw 1 + csum set ip hw 1 + set port 0 gro on + set gro flush 1 + port start 0 + port start 1 + start + +3. Set up vm with virto device and using kernel virtio-net driver:: + + taskset -c 31 /home/qemu-install/qemu-3.0/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/ubuntu1910.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 in log can get better performance than case1:: + + 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