From patchwork Wed Sep 7 12:59:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 116045 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 73CBAA054F; Wed, 7 Sep 2022 15:05:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6EE194021F; Wed, 7 Sep 2022 15:05:23 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 369BA400D6 for ; Wed, 7 Sep 2022 15:05:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662555921; x=1694091921; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=N21ssVt0R5LzpmP9BlCi3J6tNPlJN5TCnun4TeAB2wc=; b=nHYLVypCC3UuaoPNTa1NiUE5ny74OiFWkHgsRhJSNDaMX08Ok+LIqtw/ V+38iP6YucpfRo+N/S5iUUExI98+5VfLdEPVmutQp+1ODXsf1M7wo2+Uv 8OY/9Ka08XkascfdLuyLyk6D7DbRGsfTGDQAUTgYskXgZ/w9OOLKcr5v/ WkIc4gMzzyGXvq5bfn8hjv2QZkgLdvRsPlby+yFUZONw6EjkgZfYnSy+5 T3YLIEfOETKbY/asUvTgw1mH9u7Fz0oLul3NJdt62vbruvA1fWyMKxToU bYY26VGOjtzhIQgw3rau2OjkkKV61RmEvhIb4PL346vQ8GykO/9hb0tHD A==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="277257187" X-IronPort-AV: E=Sophos;i="5.93,296,1654585200"; d="scan'208";a="277257187" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 06:05:06 -0700 X-IronPort-AV: E=Sophos;i="5.93,296,1654585200"; d="scan'208";a="676176018" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 06:05:05 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V1 1/2] test_plans/dpdk_gro_lib_test_plan: add udp traffice testcase Date: Wed, 7 Sep 2022 08:59:59 -0400 Message-Id: <20220907125959.1728258-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Add new udp traffic testcase 6-10 in dpdk_gro_lib testplan. Signed-off-by: Wei Ling --- test_plans/dpdk_gro_lib_test_plan.rst | 330 ++++++++++++++++++++++++-- 1 file changed, 307 insertions(+), 23 deletions(-) diff --git a/test_plans/dpdk_gro_lib_test_plan.rst b/test_plans/dpdk_gro_lib_test_plan.rst index e36550d2..e46f2487 100644 --- a/test_plans/dpdk_gro_lib_test_plan.rst +++ b/test_plans/dpdk_gro_lib_test_plan.rst @@ -16,12 +16,12 @@ 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. @@ -95,7 +95,7 @@ Test Case1: DPDK GRO lightmode test with tcp/ipv4 traffic 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 + Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -m VM side: iperf -s Test Case2: DPDK GRO heavymode test with tcp/ipv4 traffic @@ -147,7 +147,7 @@ Test Case2: DPDK GRO heavymode test with tcp/ipv4 traffic 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 + Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -m VM side: iperf -s Test Case3: DPDK GRO heavymode_flush4 test with tcp/ipv4 traffic @@ -199,11 +199,11 @@ Test Case3: DPDK GRO heavymode_flush4 test with tcp/ipv4 traffic 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 + Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -m VM side: iperf -s -Test Case4: DPDK GRO test with vxlan traffic -============================================ +Test Case4: DPDK GRO test with tcp/vxlan traffic +================================================ Vxlan topology -------------- @@ -274,8 +274,8 @@ Vxlan topology 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 + Host side : ip netns exec t2 iperf -c 50.1.1.2 -i 2 -t 60 -f + VM side: iperf -s -f Test Case5: DPDK GRO test with 2 queues using tcp/ipv4 traffic ============================================================== @@ -288,24 +288,24 @@ Test Case5: DPDK GRO test with 2 queues using tcp/ipv4 traffic 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:: +2. Bind 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' -- -i --txd=1024 --rxd=1024 --txq=2 --rxq=2 --nb-cores=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 + 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:: @@ -327,5 +327,289 @@ Test Case5: DPDK GRO test with 2 queues using tcp/ipv4 traffic 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 + Host side : taskset -c 35 ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 + VM side: iperf -s + +Test Case6: DPDK GRO lightmode test with udp/ipv4 traffic +========================================================= + +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 [enp216s0f0] netns ns1 # [enp216s0f0] is the name of nic2 + ip netns exec ns1 ifconfig [enp216s0f0] 1.1.1.8 up + ip netns exec ns1 ethtool -K [enp216s0f0] tso on + +2. Bind 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 2-4 -n 4 \ + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=1,client=0' -- -i --txd=1024 --rxd=1024 + 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 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 \ + -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 \ + -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,guest_ufo=on,guest_ecn=on \ + -vnc :10 -daemonize + +4. In vm, config the virtio-net device with ip and turn the kernel gro off:: + + 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 can get expected data:: + + Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -P 4 -u -b 10G -l 9000 + VM side: iperf -s + +Test Case7: DPDK GRO heavymode test with udp/ipv4 traffic +========================================================= + +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 [enp216s0f0] netns ns1 # [enp216s0f0] is the name of nic2 + ip netns exec ns1 ifconfig [enp216s0f0] 1.1.1.8 up + ip netns exec ns1 ethtool -K [enp216s0f0] tso on + +2. Bind nic1 to vfio-pci, launch vhost-user with testpmd and set flush interval to 2:: + + ./usertools/dpdk-devbind.py -b vfio-pci xx:xx.x + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-4 -n 4 \ + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=1,client=0' -- -i --txd=1024 --rxd=1024 + 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 2 + 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 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 \ + -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 \ + -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,guest_ufo=on,guest_ecn=on \ + -vnc :10 -daemonize + +4. In vm, config the virtio-net device with ip and turn the kernel gro off:: + + 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 can get expected data:: + + Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -P 4 -u -b 10G -l 9000 + VM side: iperf -s + +Test Case8: DPDK GRO heavymode_flush4 test with udp/ipv4 traffic +================================================================ + +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 [enp216s0f0] netns ns1 # [enp216s0f0] is the name of nic2 + ip netns exec ns1 ifconfig [enp216s0f0] 1.1.1.8 up + ip netns exec ns1 ethtool -K [enp216s0f0] tso on + +2. Bind nic1 to vfio-pci, launch vhost-user with testpmd and set flush interval to 4:: + + ./usertools/dpdk-devbind.py -b vfio-pci xx:xx.x + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-4 -n 4 \ + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=1,client=0' -- -i --txd=1024 --rxd=1024 + 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 4 + 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 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 \ + -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 \ + -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,guest_ufo=on,guest_ecn=on \ + -vnc :10 -daemonize + +4. In vm, config the virtio-net device with ip and turn the kernel gro off:: + + 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 can get expected data:: + + Host side : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -P 4 -u -b 10G -l 9000 + VM side: iperf -s + +Test Case9: DPDK GRO test with udp/vxlan traffic +================================================ + +Vxlan topology +-------------- + 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:: + + ip netns del ns1 + ip netns add ns1 + ip link set [enp216s0f0] netns ns1 # [enp216s0f0] is the name of nic2 + ip netns exec ns1 ifconfig [enp216s0f0] 1.1.2.4/24 up + VXLAN_NAME=vxlan1 + VXLAN_IP=50.1.1.1 + IF_NAME=[enp216s0f0] + VM_IP=1.1.2.3 + ip netns exec t2 ip link add $VXLAN_NAME type vxlan id 42 dev $IF_NAME dstport 4789 + ip netns exec t2 bridge fdb append to 00:00:00:00:00:00 dst $VM_IP dev $VXLAN_NAME + ip netns exec t2 ip addr add $VXLAN_IP/24 dev $VXLAN_NAME + ip netns exec t2 ip link set up dev $VXLAN_NAME + +2. Bind nic1 to vfio-pci, launch vhost-user with testpmd and set flush interval to 4:: + + ./usertools/dpdk-devbind.py -b vfio-pci xx:xx.x + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-4 -n 4 \ + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=1,client=0' -- -i --txd=1024 --rxd=1024 + 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 parse-tunnel on 0 + testpmd>csum parse-tunnel on 1 + testpmd>csum set outer-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 4 + 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 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 \ + -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 \ + -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,guest_ufo=on,guest_ecn=on \ + -vnc :10 -daemonize + +4. In vm, config the virtio-net device with ip and turn the kernel gro off:: + + ip link add vxlan0 type vxlan id 42 dev [ens3] dstport 4789 # [ens3] is the name of virtio-net + bridge fdb add to 00:00:00:00:00:00 dst 1.1.2.4 dev vxlan0 + ip addr add 50.1.1.2/24 dev vxlan0 + ip link set up dev vxlan0 + 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 can get expected data:: + + Host side : ip netns exec t2 iperf -c 50.1.1.2 -i 1 -t 60 -P 4 -u -b 10G -l 9000 + VM side: iperf -s -f g + +Test Case10: DPDK GRO test with 2 queues using udp/ipv4 traffic +=============================================================== + +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 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' -- -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,,guest_ufo=on,guest_ecn=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 : ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 60 -P 4 -u -b 10G -l 9000 VM side: iperf -s From patchwork Wed Sep 7 13:00:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 116046 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 C265DA054F; Wed, 7 Sep 2022 15:05:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B73DC427EA; Wed, 7 Sep 2022 15:05:28 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 77397400D6 for ; Wed, 7 Sep 2022 15:05:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662555926; x=1694091926; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=4m0y/hDuiqBGw6H95mQ5VxhHSx8traKdRArG9Kdsl5M=; b=gyx3iQGqL3BpsIYVO/wsEe//oZmQasUjDm4+B1fTCU/BONEAXaKgX5fu QBSPOg420+7A/GBYn3VOXDSG6KUcZz2zvf1kMWzB1xk6cEiSZr4Q9s13w 0x2WtH9iPjHWj0m+A94x4tjotKcJszV4pp5Ptdhn03a/tyNV4OYTn2wbv Cmvka9Ylu5RH/PohsNYLPT+/jsCKe8IaOsnjZR4i5t9GbMbZ9dGUoF+YG JUnjmdnI3CX2Rk4M42fwaEncUOB/xxyESl9bBfmAZ+5/g09+7rnWcqAjr 34XlKTlwlPnenQTuzZ+py6at/tE8OTwCSTROFsleMeTjx9ZKuVvx2ErNG w==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="283862094" X-IronPort-AV: E=Sophos;i="5.93,296,1654585200"; d="scan'208";a="283862094" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 06:05:17 -0700 X-IronPort-AV: E=Sophos;i="5.93,296,1654585200"; d="scan'208";a="676176112" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 06:05:16 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V1 2/2] tests/dpdk_gro_lib: add udp traffice testcase Date: Wed, 7 Sep 2022 09:00:11 -0400 Message-Id: <20220907130011.1728407-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 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 1.Supplement testcase 5 in dpdk_gro_lib testsuite. 2.Add new udp traffic testcase 6-10 in dpdk_gro_lib testsuite. Signed-off-by: Wei Ling --- tests/TestSuite_dpdk_gro_lib.py | 327 ++++++++++++++++++++++++++++---- 1 file changed, 294 insertions(+), 33 deletions(-) diff --git a/tests/TestSuite_dpdk_gro_lib.py b/tests/TestSuite_dpdk_gro_lib.py index 0f44d666..c8a46bde 100644 --- a/tests/TestSuite_dpdk_gro_lib.py +++ b/tests/TestSuite_dpdk_gro_lib.py @@ -106,7 +106,7 @@ class TestDPDKGROLib(TestCase): ) self.vhost_user = self.dut.new_session(suite="user") self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120) - self.set_testpmd_params() + self.set_testpmd_params(mode=mode) def set_testpmd_params(self, mode=1): # set testpmd params @@ -129,7 +129,7 @@ class TestDPDKGROLib(TestCase): self.vhost_user.send_expect("csum parse-tunnel on 0", "testpmd> ", 120) self.vhost_user.send_expect("csum set outer-ip hw 0", "testpmd> ", 120) self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120) - self.vhost_user.send_expect("set gro flush 2", "testpmd> ", 120) + self.vhost_user.send_expect("set gro flush 4", "testpmd> ", 120) else: self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120) self.vhost_user.send_expect("set gro flush 4", "testpmd> ", 120) @@ -150,7 +150,7 @@ class TestDPDKGROLib(TestCase): self.vhost_user.send_expect("quit", "#", 120) self.dut.close_session(self.vhost_user) - def config_kernel_nic_host(self, mode=1): + def config_kernel_nic_host(self, mode=0): if mode == 0: self.dut.send_expect("ip netns del ns1", "#") self.dut.send_expect("ip netns add ns1", "#") @@ -191,22 +191,26 @@ class TestDPDKGROLib(TestCase): vm_config.params[i]["cpu"][0]["number"] = 1 vm_config.params[i]["cpu"][0]["cpupin"] = self.qemu_cpupin - def start_vm(self, mode=1, queue=1): + def start_vm(self, queue=1, tcp=True): self.vm1 = VM(self.dut, "vm0", "vhost_sample") self.vm1.load_config() vm_params_1 = {} vm_params_1["driver"] = "vhost-user" vm_params_1["opt_path"] = self.base_dir + "/vhost-net" vm_params_1["opt_mac"] = self.virtio_mac1 - vm_params_1["opt_queue"] = queue - if mode == 5: - vm_params_1[ - "opt_settings" - ] = "mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on,mq=on,vectors=15" - else: - vm_params_1[ - "opt_settings" - ] = "mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on" + if queue > 1: + vm_params_1["opt_queue"] = queue + param = "" if tcp else ",guest_ufo=on,host_ufo=on" + if queue > 1: + vm_params_1["opt_settings"] = ( + "mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on,mq=on,vectors=15%s" + % param + ) + elif queue == 1: + vm_params_1["opt_settings"] = ( + "mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on,vectors=15%s" + % param + ) self.vm1.set_vm_device(**vm_params_1) self.set_vm_cpu_number(self.vm1) try: @@ -243,9 +247,12 @@ class TestDPDKGROLib(TestCase): return iperfdata_kb def test_vhost_gro_tcp_lightmode(self): - self.config_kernel_nic_host(0) - self.launch_testpmd_gro_on() - self.start_vm() + """ + Test Case1: DPDK GRO lightmode test with tcp/ipv4 traffic + """ + self.config_kernel_nic_host(mode=0) + self.launch_testpmd_gro_on(mode=1, queue=1) + self.start_vm(queue=1, tcp=True) time.sleep(5) self.dut.get_session_output(timeout=2) # Get the virtio-net device name @@ -261,7 +268,7 @@ class TestDPDKGROLib(TestCase): self.vm1_dut.send_expect("iperf -s", "", 10) self.dut.send_expect("rm /root/iperf_client.log", "#", 10) self.dut.send_expect( - "ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1> /root/iperf_client.log &" + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 1 > /root/iperf_client.log &" % (self.virtio_ip1), "", 180, @@ -273,7 +280,7 @@ class TestDPDKGROLib(TestCase): # Turn off DPDK GRO lib and Kernel GRO off self.set_testpmd_gro_off() self.dut.send_expect( - "ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1 > /root/iperf_client.log &" + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 1 > /root/iperf_client.log &" % (self.virtio_ip1), "", 180, @@ -289,10 +296,12 @@ class TestDPDKGROLib(TestCase): ) def test_vhost_gro_tcp_heavymode(self): - self.config_kernel_nic_host(0) - self.heavymode = 2 - self.launch_testpmd_gro_on(self.heavymode) - self.start_vm() + """ + Test Case2: DPDK GRO heavymode test with tcp/ipv4 traffic + """ + self.config_kernel_nic_host(mode=0) + self.launch_testpmd_gro_on(mode=2, queue=1) + self.start_vm(queue=1, tcp=True) time.sleep(5) self.dut.get_session_output(timeout=2) # Get the virtio-net device name @@ -308,7 +317,7 @@ class TestDPDKGROLib(TestCase): self.vm1_dut.send_expect("iperf -s", "", 10) self.dut.send_expect("rm /root/iperf_client.log", "#", 10) self.dut.send_expect( - "ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1> /root/iperf_client.log &" + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 1 > /root/iperf_client.log &" % (self.virtio_ip1), "", 180, @@ -321,10 +330,12 @@ class TestDPDKGROLib(TestCase): self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") def test_vhost_gro_tcp_heavymode_flush4(self): - self.config_kernel_nic_host(0) - self.heavymode = 4 - self.launch_testpmd_gro_on(self.heavymode) - self.start_vm() + """ + Test Case3: DPDK GRO heavymode_flush4 test with tcp/ipv4 traffic + """ + self.config_kernel_nic_host(mode=0) + self.launch_testpmd_gro_on(mode=4, queue=1) + self.start_vm(queue=1, tcp=True) time.sleep(5) self.dut.get_session_output(timeout=2) # Get the virtio-net device name @@ -340,7 +351,7 @@ class TestDPDKGROLib(TestCase): self.vm1_dut.send_expect("iperf -s", "", 10) self.dut.send_expect("rm /root/iperf_client.log", "#", 10) self.dut.send_expect( - "ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1> /root/iperf_client.log &" + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 1 > /root/iperf_client.log &" % (self.virtio_ip1), "", 180, @@ -352,13 +363,104 @@ class TestDPDKGROLib(TestCase): self.quit_testpmd() self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") - def test_vhost_gro_with_2queues_tcp_lightmode(self): + def test_vhost_gro_tcp_vxlan_heavymode_flush4(self): + """ + Test Case4: DPDK GRO test with vxlan traffic + """ + self.config_kernel_nic_host(mode=1) + self.launch_testpmd_gro_on(mode=3, queue=1) + self.start_vm(queue=1, tcp=True) + time.sleep(5) + self.dut.get_session_output(timeout=2) + # Get the virtio-net device name + for port in self.vm1_dut.ports_info: + self.vm1_intf = port["intf"] + # Start the Iperf test + self.vm1_dut.send_expect( + "ip link add vxlan0 type vxlan id 42 dev %s dstport 4789" % self.vm1_intf, + "#", + 30, + ) + self.vm1_dut.send_expect( + "bridge fdb add to 00:00:00:00:00:00 dst 1.1.2.4 dev vxlan0", "#", 30 + ) + self.vm1_dut.send_expect("ip addr add 50.1.1.2/24 dev vxlan0", "#", 30) + self.vm1_dut.send_expect("ip link set up dev vxlan0", "#", 30) + self.vm1_dut.send_expect("ifconfig -a", "#", 30) + self.vm1_dut.send_expect("ifconfig %s 1.1.2.3" % (self.vm1_intf), "#", 10) + self.vm1_dut.send_expect("ifconfig %s up" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -K %s gro off" % (self.vm1_intf), "#", 10) + self.vm1_dut.send_expect("iperf -s", "", 10) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.dut.send_expect( + "ip netns exec ns1 iperf -c 50.1.1.2 -i 1 -t 60 -P 1 > /root/iperf_client.log &", + "", + 180, + ) + time.sleep(30) + self.iperf_result_verify("GRO lib") + print(("the GRO lib %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.quit_testpmd() + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + + def test_vhost_gro_tcp_lightmode_with_2queues(self): """ Test Case5: DPDK GRO test with 2 queues using tcp/ipv4 traffic """ - self.config_kernel_nic_host(0) + self.config_kernel_nic_host(mode=0) self.launch_testpmd_gro_on(mode=1, queue=2) - self.start_vm(mode=1, queue=2) + self.start_vm(queue=2, tcp=True) + time.sleep(5) + self.dut.get_session_output(timeout=2) + # Get the virtio-net device name + for port in self.vm1_dut.ports_info: + self.vm1_intf = port["intf"] + # Start the Iperf test + self.vm1_dut.send_expect("ifconfig -a", "#", 30) + self.vm1_dut.send_expect( + "ifconfig %s %s" % (self.vm1_intf, self.virtio_ip1), "#", 10 + ) + self.vm1_dut.send_expect("ifconfig %s up" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -L %s combined 2" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -K %s gro off" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("iperf -s", "", 10) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.dut.send_expect( + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 1 > /root/iperf_client.log &" + % (self.virtio_ip1), + "", + 180, + ) + time.sleep(60) + perfdata = self.iperf_result_verify("GRO lib") + print(("the GRO lib %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + # Turn off DPDK GRO lib and Kernel GRO off + self.set_testpmd_gro_off() + self.dut.send_expect( + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 1 > /root/iperf_client.log &" + % (self.virtio_ip1), + "", + 180, + ) + time.sleep(60) + self.iperf_result_verify("Kernel GRO") + print(("the Kernel GRO %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.quit_testpmd() + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + self.dut.send_expect( + "echo %s > /root/dpdk_gro_lib_on_iperf_tc5.log" % perfdata, "#", 10 + ) + + def test_vhost_gro_udp_lightmode(self): + """ + Test Case6: DPDK GRO lightmode test with udp/ipv4 traffic + """ + self.config_kernel_nic_host(mode=0) + self.launch_testpmd_gro_on(mode=1, queue=1) + self.start_vm(queue=1, tcp=False) time.sleep(5) self.dut.get_session_output(timeout=2) # Get the virtio-net device name @@ -374,7 +476,166 @@ class TestDPDKGROLib(TestCase): self.vm1_dut.send_expect("iperf -s", "", 10) self.dut.send_expect("rm /root/iperf_client.log", "#", 10) self.dut.send_expect( - "ip netns exec ns1 iperf -c %s -i 2 -t 60 -f g -m > /root/iperf_client.log &" + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 4 -u -b 10G -l 9000 > /root/iperf_client.log &" + % (self.virtio_ip1), + "", + 180, + ) + time.sleep(30) + tc1_perfdata = self.iperf_result_verify("GRO lib") + print(("the GRO lib %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + # Turn off DPDK GRO lib and Kernel GRO off + self.set_testpmd_gro_off() + self.dut.send_expect( + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 4 -u -b 10G -l 9000 > /root/iperf_client.log &" + % (self.virtio_ip1), + "", + 180, + ) + time.sleep(30) + self.iperf_result_verify("Kernel GRO") + print(("the Kernel GRO %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.quit_testpmd() + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + self.dut.send_expect( + "echo %s > /root/dpdk_gro_lib_on_iperf_tc6.log" % tc1_perfdata, "#", 10 + ) + + def test_vhost_gro_udp_heavymode(self): + """ + Test Case7: DPDK GRO heavymode test with udp/ipv4 traffic + """ + self.config_kernel_nic_host(mode=0) + self.launch_testpmd_gro_on(mode=2, queue=1) + self.start_vm(queue=1, tcp=False) + time.sleep(5) + self.dut.get_session_output(timeout=2) + # Get the virtio-net device name + for port in self.vm1_dut.ports_info: + self.vm1_intf = port["intf"] + # Start the Iperf test + self.vm1_dut.send_expect("ifconfig -a", "#", 30) + self.vm1_dut.send_expect( + "ifconfig %s %s" % (self.vm1_intf, self.virtio_ip1), "#", 10 + ) + self.vm1_dut.send_expect("ifconfig %s up" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -K %s gro off" % (self.vm1_intf), "#", 10) + self.vm1_dut.send_expect("iperf -s", "", 10) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.dut.send_expect( + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 4 -u -b 10G -l 9000 > /root/iperf_client.log &" + % (self.virtio_ip1), + "", + 180, + ) + time.sleep(30) + self.iperf_result_verify("GRO lib") + print(("the GRO lib %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.quit_testpmd() + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + + def test_vhost_gro_udp_heavymode_flush4(self): + """ + Test Case8: DPDK GRO heavymode_flush4 test with udp/ipv4 traffic + """ + self.config_kernel_nic_host(mode=0) + self.launch_testpmd_gro_on(mode=4, queue=1) + self.start_vm(queue=1, tcp=False) + time.sleep(5) + self.dut.get_session_output(timeout=2) + # Get the virtio-net device name + for port in self.vm1_dut.ports_info: + self.vm1_intf = port["intf"] + # Start the Iperf test + self.vm1_dut.send_expect("ifconfig -a", "#", 30) + self.vm1_dut.send_expect( + "ifconfig %s %s" % (self.vm1_intf, self.virtio_ip1), "#", 10 + ) + self.vm1_dut.send_expect("ifconfig %s up" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -K %s gro off" % (self.vm1_intf), "#", 10) + self.vm1_dut.send_expect("iperf -s", "", 10) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.dut.send_expect( + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 4 -u -b 10G -l 9000 > /root/iperf_client.log &" + % (self.virtio_ip1), + "", + 180, + ) + time.sleep(30) + self.iperf_result_verify("GRO lib") + print(("the GRO lib %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.quit_testpmd() + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + + def test_vhost_gro_udp_vxlan_heavymode_flush4(self): + """ + Test Case9: DPDK GRO test with udp/vxlan traffic + """ + self.config_kernel_nic_host(mode=1) + self.launch_testpmd_gro_on(mode=3, queue=1) + self.start_vm(queue=1, tcp=False) + time.sleep(5) + self.dut.get_session_output(timeout=2) + # Get the virtio-net device name + for port in self.vm1_dut.ports_info: + self.vm1_intf = port["intf"] + # Start the Iperf test + self.vm1_dut.send_expect( + "ip link add vxlan0 type vxlan id 42 dev %s dstport 4789" % self.vm1_intf, + "#", + 30, + ) + self.vm1_dut.send_expect( + "bridge fdb add to 00:00:00:00:00:00 dst 1.1.2.4 dev vxlan0", "#", 30 + ) + self.vm1_dut.send_expect("ip addr add 50.1.1.2/24 dev vxlan0", "#", 30) + self.vm1_dut.send_expect("ip link set up dev vxlan0", "#", 30) + self.vm1_dut.send_expect("ifconfig -a", "#", 30) + self.vm1_dut.send_expect("ifconfig %s 1.1.2.3" % (self.vm1_intf), "#", 10) + self.vm1_dut.send_expect("ifconfig %s up" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -K %s gro off" % (self.vm1_intf), "#", 10) + self.vm1_dut.send_expect("iperf -s", "", 10) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.dut.send_expect( + "ip netns exec ns1 iperf -c 50.1.1.2 -i 1 -t 60 -P 4 -u -b 10G -l 9000 > /root/iperf_client.log &", + "", + 180, + ) + time.sleep(30) + self.iperf_result_verify("GRO lib") + print(("the GRO lib %s " % (self.output_result))) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.quit_testpmd() + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + + def test_vhost_gro_udp_lightmode_with_2queues(self): + """ + Test Case10: DPDK GRO test with 2 queues using udp/ipv4 traffic + """ + self.config_kernel_nic_host(mode=0) + self.launch_testpmd_gro_on(mode=1, queue=2) + self.start_vm(queue=2, tcp=False) + time.sleep(5) + self.dut.get_session_output(timeout=2) + # Get the virtio-net device name + for port in self.vm1_dut.ports_info: + self.vm1_intf = port["intf"] + # Start the Iperf test + self.vm1_dut.send_expect("ifconfig -a", "#", 30) + self.vm1_dut.send_expect( + "ifconfig %s %s" % (self.vm1_intf, self.virtio_ip1), "#", 10 + ) + self.vm1_dut.send_expect("ifconfig %s up" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -L %s combined 2" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("ethtool -K %s gro off" % self.vm1_intf, "#", 10) + self.vm1_dut.send_expect("iperf -s", "", 10) + self.dut.send_expect("rm /root/iperf_client.log", "#", 10) + self.dut.send_expect( + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 4 -u -b 10G -l 9000 > /root/iperf_client.log &" % (self.virtio_ip1), "", 180, @@ -386,7 +647,7 @@ class TestDPDKGROLib(TestCase): # Turn off DPDK GRO lib and Kernel GRO off self.set_testpmd_gro_off() self.dut.send_expect( - "ip netns exec ns1 iperf -c %s -i 2 -t 60 -f g -m > /root/iperf_client.log &" + "ip netns exec ns1 iperf -c %s -i 1 -t 60 -P 4 -u -b 10G -l 9000 > /root/iperf_client.log &" % (self.virtio_ip1), "", 180,