From patchwork Tue Aug 2 07:06:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 114519 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 72C84A0543; Tue, 2 Aug 2022 09:12:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BF2B40156; Tue, 2 Aug 2022 09:12:25 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 68DA8400D7 for ; Tue, 2 Aug 2022 09:12:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659424343; x=1690960343; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9fyhLt9D2Bq5bbk+NjjP0VqCx9mGLPtChnGigQ5bjQE=; b=MeiicOFQdS19jh4BWaGztMgwQtnS+IJR7gIjI360LK1js+Ts45QLYDHh cN0533I/JGWTi2c5jh3CJlpzivaHOz9nNjMzW+bIWmYsZ2uRGW6VNQQLN d4UqV+no/Ja7/AA6dy8Jzb/NwTi8qx/stAOQOxNonb2uRdd+GmE+1Ktez mg6iZg69W2ODJTZNSyA4sUQ9TIb2puFhqwsZQSnYTCvoY7cYoKp1QbPcM O+oxS/RH5nlKxPo6mMkcWxYCiwbXjxlLDFZT5kx038UT4a3/d6svkLlQh yxGPu5TclMc1M7EmJ+XJhYtN8gKLi03fBQ734tjJw1Totu49k96TZwdvn A==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="315180136" X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="315180136" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 00:12:22 -0700 X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="630591126" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 00:12:20 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V3 1/2] test_plans/vhost_pmd_xstats_test_plan: modify testplan by DPDK change Date: Tue, 2 Aug 2022 03:06:50 -0400 Message-Id: <20220802070650.1101909-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 According to DPDK commit be75dc99ea(vhost: support per-virtqueue statistics), the return output of `show port xstats 1` command have changed, so modify the testsuite to send different IP packets to verify the different queues can receive the packets. Signed-off-by: Wei Ling --- test_plans/vhost_pmd_xstats_test_plan.rst | 342 +++++++++++++--------- 1 file changed, 199 insertions(+), 143 deletions(-) diff --git a/test_plans/vhost_pmd_xstats_test_plan.rst b/test_plans/vhost_pmd_xstats_test_plan.rst index ed21783b..1c5ec1f3 100644 --- a/test_plans/vhost_pmd_xstats_test_plan.rst +++ b/test_plans/vhost_pmd_xstats_test_plan.rst @@ -1,9 +1,9 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2019 Intel Corporation -======================================== -vhost PMD Xstats Tests restart test plan -======================================== +============================ +vhost PMD Xstats test plan +============================ Description =========== @@ -11,280 +11,335 @@ Description This test plan will cover the basic vhost pmd xstats test with with 10 tx/rx paths. Includes mergeable, non-mergeable, vectorized_rx, inorder mergeable, inorder non-mergeable, virtio 1.1 mergeable, virtio 1.1 non-mergeable,virtio 1.1 inorder mergeable, virtio 1.1 inorder non-mergeable, virtio1.1 vectorized path, also cover stability cases. +From DPDK 22.07, vhost support per-virtqueue statistics, Per-virtqueue statistics collection will be enabled when the flag "RTE_VHOST_USER_NET_STATS_ENABLE" is set. It is disabled by default. Note IXIA or Scapy packes includes 4 CRC bytes and vhost side will remove the CRC when receive packests. -Test flow +Prerequisites +============= + +Topology +--------- + + Test flow:Traffic Generator --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> Traffic Generator + +Hardware +-------- + Supportted NICs: ALL + +Software +-------- + + Scapy: http://www.secdev.org/projects/scapy/ + +General set up +-------------- +1. Compile DPDK:: + + # CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib -Dexamples=all --default-library=static + # ninja -C -j 110 + For example: + CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib -Dexamples=all --default-library=static x86_64-native-linuxapp-gcc + ninja -C x86_64-native-linuxapp-gcc -j 110 + +2. Get the PCI device ID of DUT, for example, 0000:18:00.0 is PCI device ID:: + + # ./usertools/dpdk-devbind.py -s + + Network devices using kernel driver + =================================== + 0000:18:00.0 'Device 159b' if=ens785f0 drv=ice unused=vfio-pci + +Test case ========= -TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG +Common steps +------------ + +1. Bind 1 NIC port to vfio-pci:: + + # ./usertools/dpdk-devbind.py -b vfio-pci + For example:: + ./usertools/dpdk-devbind.py -b vfio-pci 0000:00:18.0 -Test Case 1: xstats test with packed ring mergeable path -======================================================== +2. Check the statistic type and number in each queue is correct. + For example: send 1000 packets with 1028B size(includes 4 CRC bytes) with different destination IP to two queues, the total statistic number of tx_q0_size_1024_to_1518_packets and tx_q1_size_1024_to_1518_packets should be 1000, the statistics about the rx direction is the same. + Send 1000 packets with ucast type with different destination IP to two queues, the total number of tx_q0_unicast_packets and tx_q1_unicast_packets should both be 1000, the statistics about the rx direction is the same. -1. Bind one port to vfio-pci, then launch vhost by below command:: + +Test Case 1: Vhost pmd xstats stability test with split ring inorder mergeable path +----------------------------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats stability when using split ring inorder mergeable path. + +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=1,in_order=0 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=1,mrg_rxbuf=1 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. -For example: send 1000 packets with 1028B size(includes 4 CRC bytes), the statistic number of tx_size_1024_to_1522_packets and rx_size_1024_to_1522_packets should both 1000. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. -For example: send 1000 packets with ucast type, the number of tx_unicast_packets and rx_unicast_packets should both 1000. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 2: xstats test with packed ring non-mergeable path -============================================================ +Test Case 2: Vhost pmd xstats test with split ring inorder non-mergeable path +----------------------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using split ring inorder non-mergeable path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=0,in_order=0 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=1,mrg_rxbuf=0 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 3: xstats stability test with split ring inorder mergeable path -========================================================================= +Test Case 3: Vhost pmd xstats test with split ring mergeable path +----------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using split ring mergeable path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=1,mrg_rxbuf=1 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=0,mrg_rxbuf=1 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start - -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). + testpmd>set fwd io + testpmd>start -4. On host run "show port xstats 1", and check the statistic type and number is correct. +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -6. On host run "show port xstats 1", and check the statistic type and number is correct. +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -7.Send packets for 10 minutes with low speed, check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 4: xstats test with split ring inorder non-mergeable path -=================================================================== +Test Case 4: Vhost pmd xstats test with split ring non-mergeable path +--------------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using split ring non-mergeable path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=1,mrg_rxbuf=0 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=0,mrg_rxbuf=0,vectorized=1 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 5: xstats test with split ring mergeable path -======================================================= +Test Case 5: Vhost pmd xstats test with split ring vector_rx path +----------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using split ring vector_rx path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=0,mrg_rxbuf=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=0,mrg_rxbuf=0,vectorized=1 \ + -- -i --tx-offloads=0x0 --rss-ip --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 6: xstats test with split ring non-mergeable path -=========================================================== +Test Case 6: Vhost pmd xstats test with packed ring inorder mergeable path +-------------------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using packed ring inorder mergeable path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=0,mrg_rxbuf=0,vectorized=1 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=1,in_order=1 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 7: xstats test with split ring vector_rx path -======================================================= +Test Case 7: Vhost pmd xstats test with packed ring inorder non-mergeable path +------------------------------------------------------------------------------ +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using packed ring inorder non-mergeable path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,in_order=0,mrg_rxbuf=0,vectorized=1 \ - -- -i --tx-offloads=0x0 --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=0,in_order=1,vectorized=1 \ + -- -i --rx-offloads=0x10 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 8: xstats test with packed ring inorder mergeable path -================================================================ +Test Case 8: Vhost pmd xstats test with packed ring mergeable path +------------------------------------------------------------------ +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using packed ring mergeable path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=1,in_order=1 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=1,in_order=0 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -7.Send packets for 10 minutes with low speed, check the statistic type and number is correct. +7.Send packets for 10 minutes with low speed, check the statistic type and number is correct like common step 2. -Test Case 9: xstats test with packed ring inorder non-mergeable path -==================================================================== +Test Case 9: Vhost pmd xstats test with packed ring non-mergeable path +---------------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using packed ring non-mergeable path. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-7 \ --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=0,in_order=1,vectorized=1 \ - -- -i --rx-offloads=0x10 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=0,in_order=0 \ + -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 10: xstats test with packed ring vectorized path -========================================================== -1. Bind one port to vfio-pci, then launch vhost by below command:: +Test Case 10: Vhost pmd xstats test with packed ring vectorized path +-------------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using packed ring vectorized path. + +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: @@ -293,26 +348,27 @@ Test Case 10: xstats test with packed ring vectorized path --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=0,in_order=1,vectorized=1 \ -- -i --rss-ip --nb-cores=2 --rxq=2 --txq=2 - >set fwd mac - >start + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -Test Case 11: xstats test with packed ring vectorized path with ring size is not power of 2 -=========================================================================================== +Test Case 11: Vhost pmd xstats test with packed ring vectorized path with ring size is not power of 2 +----------------------------------------------------------------------------------------------------- +This case use Scapy or other traffic generator to send packets of different types and packet sizes with different destination IP addresses to test vhost pmd xstats when using packed ring vectorized path with ring size is not power of 2. -1. Bind one port to vfio-pci, then launch vhost by below command:: +1. Bind one port to vfio-pci like common step 1, then launch vhost by below command:: rm -rf vhost-net* ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2,client=0' -- -i --nb-cores=2 --rxq=2 --txq=2 - testpmd>set fwd mac + --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=2' -- -i --nb-cores=2 --rxq=2 --txq=2 + testpmd>set fwd io testpmd>start 2. Launch virtio-user by below command:: @@ -321,13 +377,13 @@ Test Case 11: xstats test with packed ring vectorized path with ring size is not --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,packed_vq=1,mrg_rxbuf=0,in_order=1,vectorized=1,queue_size=255 \ -- -i --rss-ip --nb-cores=2 --rxq=2 --txq=2 --txd=255 --rxd=255 - >set fwd mac - >start + testpmd>set fwd io + testpmd>start -3. Let TG generate send 10000 packets for each packet sizes(64,128,255, 512, 1024, 1523). +3. Let Traffic Generator generate and send 10000 packets for each packet sizes(64, 128, 255, 512, 1024, 1523) with different destination IP. -4. On host run "show port xstats 1", and check the statistic type and number is correct. +4. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. -5. Let TG generate send 10000 packets for each different types (broadcast, multicast, ucast). +5. Let Traffic Generator generate and send 10000 packets for each different types (broadcast, multicast, ucast). -6. On host run "show port xstats 1", and check the statistic type and number is correct. \ No newline at end of file +6. On host run "show port xstats 1", and check the statistic type and number is correct like common step 2. From patchwork Tue Aug 2 07:07:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 114520 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 9725DA0543; Tue, 2 Aug 2022 09:12:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DA0340141; Tue, 2 Aug 2022 09:12:50 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id A3709400D7 for ; Tue, 2 Aug 2022 09:12:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659424368; x=1690960368; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DHf1m904m+SZc2HErE9sCQ7o9VZwpk5BWj+PKE+XWfk=; b=gNu1x+FBlI+CU9xoccBmrz1kx/OQN87APUOx6FA+I/tPRr21LFcGqHa/ 21Y1Z3tRo3C2Om5dXCseDzFFgs5fqDa9LgQK27V4X/lu8zHsATsTOU/aN Brl7Nojwv0bbOni4I/awtNXSVq9w4Y6shxwx9iXgn+92i1UQ3jBzMCDdc eAG3K7XAJch3tBkjy5DjZL9uZ+UXOywPXZN7Hj4F0NE78DaZ4trI7cuQ8 xnUD+cyoktAwvaWlZI/StUpPcNQnXBeBR1QSxh4KWNiOVxEJrMSYi/X4n gZaTL3ElD0zlSypmTufqcS6vtkqiTffWklBIrDqyygwgLroQPEzCR68gM Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="351050215" X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="351050215" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 00:12:47 -0700 X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="630591202" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 00:12:38 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V3 2/2] tests/vhost_pmd_xstats: modify testsuite by DPDK changed Date: Tue, 2 Aug 2022 03:07:01 -0400 Message-Id: <20220802070701.1101972-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 According to DPDK commit be75dc99ea(vhost: support per-virtqueue statistics), the return output of `show port xstats 1` command have changed, so modify the testsuite to send different IP packets to verify the different queues can receive the packets. Signed-off-by: Wei Ling --- tests/TestSuite_vhost_pmd_xstats.py | 226 ++++++++++++++++------------ 1 file changed, 128 insertions(+), 98 deletions(-) diff --git a/tests/TestSuite_vhost_pmd_xstats.py b/tests/TestSuite_vhost_pmd_xstats.py index ec95b7f1..b2a44971 100644 --- a/tests/TestSuite_vhost_pmd_xstats.py +++ b/tests/TestSuite_vhost_pmd_xstats.py @@ -7,17 +7,13 @@ DPDK Test suite. vhost pmd xstats test suite. """ -import copy import datetime import re -import time -import framework.utils as utils from framework.packet import Packet from framework.pmd_output import PmdOutput -from framework.qemu_kvm import QEMUKvm -from framework.settings import HEADER_SIZE from framework.test_case import TestCase +from framework.utils import convert_int2ip, convert_ip2int ETHER_JUMBO_FRAME_MTU = 9000 DEFAULT_JUMBO_FRAME_MTU = 1500 @@ -32,6 +28,7 @@ class TestVhostPmdXstats(TestCase): txport = self.tester.get_local_port(self.dut_ports[0]) self.txItf = self.tester.get_interface(txport) self.scapy_num = 0 + self.queues = 2 self.dmac = self.dut.get_mac_address(self.dut_ports[0]) self.virtio1_mac = "52:54:00:00:00:01" self.core_config = "1S/6C/1T" @@ -73,31 +70,63 @@ class TestVhostPmdXstats(TestCase): Send a packet to port """ self.scapy_num += 1 - pkt = Packet(pkt_type="TCP", pkt_len=pktsize) - pkt.config_layer("ether", {"dst": dmac}) - pkt.send_pkt(self.tester, tx_port=self.txItf, count=num) + options = { + "ip": {"src": "192.168.0.1", "dst": "192.168.1.1"}, + "layers_config": [], + } + # give a default value to ip + try: + src_ip_num = convert_ip2int(options["ip"]["src"]) + except: + src_ip_num = 0 + try: + dst_ip_num = convert_ip2int(options["ip"]["dst"]) + except: + dst_ip_num = 0 + if num == 1: + count = 1 + group = num + else: + count = 1000 + group = int(num / count) + for _ in range(group): + srcip = convert_int2ip(src_ip_num, ip_type=4) + dstip = convert_int2ip(dst_ip_num, ip_type=4) + pkt = Packet(pkt_type="IP_RAW", pkt_len=pktsize) + pkt.config_layer("ether", {"dst": dmac}) + pkt.config_layer("ipv4", {"src": srcip, "dst": dstip}) + dst_ip_num += 1 + pkt.send_pkt(self.tester, tx_port=self.txItf, count=count) - def send_verify(self, scope, mun): + def send_verify(self, scope, num): """ according the scope to check results """ out = self.vhost_user_pmd.execute_cmd("show port xstats 1") - packet_rx = re.search("rx_%s_packets:\s*(\d*)" % scope, out) - sum_packet_rx = packet_rx.group(1) - packet_tx = re.search("tx_%s_packets:\s*(\d*)" % scope, out) - sum_packet_tx = packet_tx.group(1) + rx_pattern = re.compile("rx_q\d+_%s_packets:\s*(\d+)" % scope) + packet_rx = rx_pattern.findall(out) + sum_packet_rx = 0 + for item in packet_rx: + sum_packet_rx += int(item) + + tx_pattern = re.compile("tx_q\d+_%s_packets:\s*(\d+)" % scope) + packet_tx = tx_pattern.findall(out) + sum_packet_tx = 0 + for item in packet_tx: + sum_packet_tx += int(item) + self.verify( - int(sum_packet_rx) >= mun, "Insufficient the received packets from nic" + int(sum_packet_rx) == num, "Insufficient the received packets from nic" ) self.verify( - int(sum_packet_tx) >= mun, "Insufficient the received packets from virtio" + int(sum_packet_tx) == num, "Insufficient the received packets from virtio" ) def start_vhost_testpmd(self): """ start testpmd on vhost """ - vdevs = ["net_vhost0,iface=vhost-net,queues=2,client=0"] + vdevs = ["net_vhost0,iface=vhost-net,queues=%d,client=0" % self.queues] param = "--nb-cores=2 --rxq=2 --txq=2" self.vhost_user_pmd.start_testpmd( cores=self.core_list_host, @@ -117,8 +146,8 @@ class TestVhostPmdXstats(TestCase): if self.check_2M_env: eal_param += " --single-file-segments" vdevs = [ - "net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=2,%s" - % args["version"] + "net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=%d,%s" + % (self.queues, args["version"]) ] param = "%s --rss-ip --nb-cores=2 --rxq=2 --txq=2" % args["path"] self.virtio_user0_pmd.start_testpmd( @@ -137,7 +166,7 @@ class TestVhostPmdXstats(TestCase): Verify receiving and transmitting packets correctly in the Vhost PMD xstats """ out = self.vhost_user_pmd.execute_cmd("show port xstats 1") - p = re.compile(r"rx_size_[0-9]+_[to_\w+]*packets") + p = re.compile(r"rx_q0_size_[0-9]+_[\w+]*packets") categories = p.findall(out) categories = categories[:-1] self.verify( @@ -145,7 +174,7 @@ class TestVhostPmdXstats(TestCase): ) for cat in categories: scope = re.search(r"(?<=rx_)\w+(?=_packets)", cat).group(0) - pktsize = int(re.search(r"(?<=rx_size_)\d+", cat).group(0)) + pktsize = int(re.search(r"(?<=rx_q0_size_)\d+", cat).group(0)) if pktsize > 1518: self.tester.send_expect( "ifconfig %s mtu %d" % (self.txItf, ETHER_JUMBO_FRAME_MTU), "# " @@ -165,38 +194,25 @@ class TestVhostPmdXstats(TestCase): "ifconfig %s mtu %d" % (self.txItf, DEFAULT_JUMBO_FRAME_MTU), "# " ) - def test_vhost_xstats_virtio11_mergeable(self): + def test_vhost_xstats_split_ring_inorder_mergeable_path(self): """ - performance for Vhost PVP virtio1.1 Mergeable Path. + Test Case 1: Vhost pmd xstats stability test with split ring inorder mergeable path """ - self.scapy_num = 0 virtio_pmd_arg = { - "version": "in_order=0,packed_vq=1,mrg_rxbuf=1", + "version": "in_order=1,mrg_rxbuf=1", "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() - # stability test with basic packets number check - self.scapy_num = 0 - date_old = datetime.datetime.now() - date_new = date_old + datetime.timedelta(minutes=2) - while 1: - date_now = datetime.datetime.now() - scope = "multicast" - self.dmac = "01:00:00:33:00:01" - self.scapy_send_packet(64, self.dmac, 1) - if date_now >= date_new: - break - self.send_verify(scope, self.scapy_num) self.close_all_testpmd() - def test_vhost_xstats_virtio11_no_mergeable(self): + def test_vhost_xstats_split_ring_inorder_no_mergeable_path(self): """ - performance for Vhost PVP virtio1.1 no_mergeable Path. + Test Case 2: Vhost pmd xstats test with split ring inorder non-mergeable path """ virtio_pmd_arg = { - "version": "in_order=0,packed_vq=1,mrg_rxbuf=0", + "version": "in_order=1,mrg_rxbuf=0", "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() @@ -204,12 +220,12 @@ class TestVhostPmdXstats(TestCase): self.xstats_number_and_type_verify() self.close_all_testpmd() - def test_vhost_xstats_virtio11_inorder_mergeable(self): + def test_vhost_xstats_split_ring_mergeable_path(self): """ - performance for Vhost PVP virtio1.1 inorder Mergeable Path. + Test Case 3: Vhost pmd xstats test with split ring mergeable path """ virtio_pmd_arg = { - "version": "in_order=1,packed_vq=1,mrg_rxbuf=1", + "version": "in_order=0,mrg_rxbuf=1", "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() @@ -217,101 +233,90 @@ class TestVhostPmdXstats(TestCase): self.xstats_number_and_type_verify() self.close_all_testpmd() - def test_vhost_xstats_virtio11_inorder_no_mergeable(self): + def test_vhost_xstats_split_ring_no_mergeable_path(self): """ - performance for Vhost PVP virtio1.1 inorder no_mergeable Path. + Test Case 4: Vhost pmd xstats test with split ring non-mergeable path """ virtio_pmd_arg = { - "version": "in_order=1,packed_vq=1,mrg_rxbuf=0,vectorized=1", - "path": "--rx-offloads=0x10 --enable-hw-vlan-strip --rss-ip", + "version": "in_order=0,mrg_rxbuf=0,vectorized=1", + "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() self.close_all_testpmd() - def test_vhost_xstats_virtio11_vector(self): + def test_vhost_xstats_split_ring_vector_rx_path(self): """ - performance for Vhost PVP virtio1.1 inorder no_mergeable Path. + Test Case 5: Vhost pmd xstats test with split ring vector_rx path """ virtio_pmd_arg = { - "version": "in_order=1,packed_vq=1,mrg_rxbuf=0,vectorized=1", - "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", + "version": "in_order=0,mrg_rxbuf=0,vectorized=1", + "path": "--tx-offloads=0x0", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() - # stability test with basic packets number check - self.scapy_num = 0 - date_old = datetime.datetime.now() - date_new = date_old + datetime.timedelta(minutes=2) - while 1: - date_now = datetime.datetime.now() - scope = "broadcast" - self.dmac = "ff:ff:ff:ff:ff:ff" - self.scapy_send_packet(64, self.dmac, 1) - if date_now >= date_new: - break - self.send_verify(scope, self.scapy_num) self.close_all_testpmd() - def test_vhost_xstats_virtio11_vector_ringsize_not_powerof_2(self): + def test_vhost_xstats_packed_ring_inorder_mergeable_path(self): """ - performance for Vhost PVP virtio1.1 inorder no_mergeable Path. + Test Case 6: Vhost pmd xstats test with packed ring inorder mergeable path """ virtio_pmd_arg = { - "version": "in_order=1,packed_vq=1,mrg_rxbuf=0,vectorized=1,queue_size=1221", - "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --rxd=1221 --txd=1221", + "version": "in_order=1,mrg_rxbuf=1,packed_vq=1", + "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() - # stability test with basic packets number check - self.scapy_num = 0 - date_old = datetime.datetime.now() - date_new = date_old + datetime.timedelta(minutes=2) - while 1: - date_now = datetime.datetime.now() - scope = "broadcast" - self.dmac = "ff:ff:ff:ff:ff:ff" - self.scapy_send_packet(64, self.dmac, 1) - if date_now >= date_new: - break - self.send_verify(scope, self.scapy_num) self.close_all_testpmd() - def test_vhost_xstats_inorder_mergeable(self): + def test_vhost_xstats_packed_ring_inorder_no_mergeable_path(self): """ - performance for Vhost PVP In_order mergeable Path. + Test Case 7: Vhost pmd xstats test with packed ring inorder non-mergeable path """ virtio_pmd_arg = { - "version": "packed_vq=0,in_order=1,mrg_rxbuf=1", - "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", + "version": "in_order=1,mrg_rxbuf=0,vectorized=1,packed_vq=1", + "path": "--rx-offloads=0x10 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() self.close_all_testpmd() - def test_vhost_xstats_inorder_no_mergeable(self): + def test_vhost_xstats_packed_ring_mergeable_path(self): """ - performance for Vhost PVP In_order no_mergeable Path. + Test Case 8: Vhost pmd xstats test with packed ring mergeable path """ + self.scapy_num = 0 virtio_pmd_arg = { - "version": "packed_vq=0,in_order=1,mrg_rxbuf=0", + "version": "in_order=0,mrg_rxbuf=1,packed_vq=1", "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() + # stability test with basic packets number check + self.scapy_num = 0 + date_old = datetime.datetime.now() + date_new = date_old + datetime.timedelta(minutes=2) + while 1: + date_now = datetime.datetime.now() + scope = "multicast" + self.dmac = "01:00:00:33:00:01" + self.scapy_send_packet(64, self.dmac, 1) + if date_now >= date_new: + break + self.send_verify(scope, self.scapy_num) self.close_all_testpmd() - def test_vhost_xstats_mergeable(self): + def test_vhost_xstats_packed_ring_no_mergeable_path(self): """ - performance for Vhost PVP Mergeable Path. + Test Case 9: Vhost pmd xstats test with packed ring non-mergeable path """ virtio_pmd_arg = { - "version": "packed_vq=0,in_order=0,mrg_rxbuf=1", + "version": "in_order=0,mrg_rxbuf=0,packed_vq=1", "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() @@ -319,30 +324,54 @@ class TestVhostPmdXstats(TestCase): self.xstats_number_and_type_verify() self.close_all_testpmd() - def test_vhost_xstats_no_mergeable(self): + def test_vhost_xstats_packed_ring_vectorized_path(self): """ - performance for Vhost PVP no_mergeable Path. + Test Case 10: Vhost pmd xstats test with packed ring vectorized path """ virtio_pmd_arg = { - "version": "packed_vq=0,in_order=0,mrg_rxbuf=0,vectorized=1", + "version": "in_order=1,mrg_rxbuf=0,vectorized=1,packed_vq=1", "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() + # stability test with basic packets number check + self.scapy_num = 0 + date_old = datetime.datetime.now() + date_new = date_old + datetime.timedelta(minutes=2) + while 1: + date_now = datetime.datetime.now() + scope = "broadcast" + self.dmac = "ff:ff:ff:ff:ff:ff" + self.scapy_send_packet(64, self.dmac, 1) + if date_now >= date_new: + break + self.send_verify(scope, self.scapy_num) self.close_all_testpmd() - def test_vhost_xstats_vector_rx(self): + def test_vhost_xstats_packed_ring_vectorized_path_ringsize_not_powerof_2(self): """ - performance for Vhost PVP Vector_RX Path + Test Case 11: Vhost pmd xstats test with packed ring vectorized path with ring size is not power of 2 """ virtio_pmd_arg = { - "version": "packed_vq=0,in_order=0,mrg_rxbuf=0,vectorized=1", - "path": "--tx-offloads=0x0", + "version": "in_order=1,mrg_rxbuf=0,vectorized=1,queue_size=1221,packed_vq=1", + "path": "--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --rxd=1221 --txd=1221", } self.start_vhost_testpmd() self.start_virtio_testpmd(virtio_pmd_arg) self.xstats_number_and_type_verify() + # stability test with basic packets number check + self.scapy_num = 0 + date_old = datetime.datetime.now() + date_new = date_old + datetime.timedelta(minutes=2) + while 1: + date_now = datetime.datetime.now() + scope = "broadcast" + self.dmac = "ff:ff:ff:ff:ff:ff" + self.scapy_send_packet(64, self.dmac, 1) + if date_now >= date_new: + break + self.send_verify(scope, self.scapy_num) self.close_all_testpmd() def close_all_testpmd(self): @@ -356,9 +385,10 @@ class TestVhostPmdXstats(TestCase): self.vhost_user_pmd.execute_cmd("clear port xstats 1") out = self.vhost_user_pmd.execute_cmd("show port xstats 1") - packet = re.search("rx_%s_packets:\s*(\d*)" % scope, out) - sum_packet = packet.group(1) - self.verify(int(sum_packet) == 0, "Insufficient the received package") + rx_pattern = re.compile("rx_q\d+_%s_packets:\s*(\d+)" % scope) + rx_packet_list = rx_pattern.findall(out) + for rx_packet in rx_packet_list: + self.verify(int(rx_packet) == 0, "Insufficient the received package") def tear_down(self): """