From patchwork Tue Nov 22 09:19:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 120088 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 D1FA1A0580; Tue, 22 Nov 2022 10:25:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B38842D6B; Tue, 22 Nov 2022 10:25:53 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 5D978427EB for ; Tue, 22 Nov 2022 10:25:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669109150; x=1700645150; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xTZSrhgY8hijSYssUcWjhS54nBV+EIp2kTi57/2ttoE=; b=lJuvgdHWhC2pQGE/p/Iuv2ChJsQmnVLKH8Mr4Kogy5wgacK5AjWXQGNU +v62oPxjtGji3Eqi8XK1G5Bp+WkZBbEOFL2mLk9v2bJl/fgUMfocluzwN 6zmnJmwGW5Ze3fdK6iqlLtXLDnr5BSYP9c0YrxcMxIu5FF+I1SQ8KU9Cq TtVgoRM8p7aByRLsm9cFJz8RamIRVIOa+X8o2vKklgI0XXdM/4Sf/zunD ZnG6BIMcSQN7DcgP32zQ6ID7wUY5GmwtBgCfvNH50ziGzKCAiDSSWYq/A 5I3opJO9USWKYQcX0IR2UPCiGMHWTkW1KKOlJvr9RHuWYKhpn3fbxm51S g==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="314923226" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208,223";a="314923226" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 01:25:38 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="635481645" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208,223";a="635481645" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 01:25:36 -0800 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V3 1/2] test_plans/loopback_virtio_user_server_mode_cbdma_test_plan: modify the dmas parameter by DPDK changed Date: Tue, 22 Nov 2022 17:19:50 +0800 Message-Id: <20221122091950.2899872-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 From DPDK-22.11, the dmas parameter have changed, so modify the dmas parameter in the testplan. Signed-off-by: Wei Ling --- ...irtio_user_server_mode_cbdma_test_plan.rst | 604 +++++++++++++----- 1 file changed, 435 insertions(+), 169 deletions(-) diff --git a/test_plans/loopback_virtio_user_server_mode_cbdma_test_plan.rst b/test_plans/loopback_virtio_user_server_mode_cbdma_test_plan.rst index 7a0a8991..04ad0089 100644 --- a/test_plans/loopback_virtio_user_server_mode_cbdma_test_plan.rst +++ b/test_plans/loopback_virtio_user_server_mode_cbdma_test_plan.rst @@ -1,5 +1,5 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright(c) 2022 Intel Corporation + Copyright(c) 2022 Intel Corporation =========================================================== Loopback vhost/virtio-user server mode with CBDMA test plan @@ -8,29 +8,41 @@ Loopback vhost/virtio-user server mode with CBDMA test plan Description =========== -Vhost asynchronous data path leverages DMA devices to offload memory copies from the CPU and it is implemented in an asynchronous way. -In addition, vhost supports M:N mapping between vrings and DMA virtual channels. Specifically, one vring can use multiple different DMA -channels and one DMA channel can be shared by multiple vrings at the same time. From DPDK22.07, Vhost enqueue and dequeue operation with -CBDMA channels is supported in both split and packed ring. +CBDMA is a kind of DMA engine, Vhost asynchronous data path leverages DMA devices +to offload memory copies from the CPU and it is implemented in an asynchronous way. +As a result, large packet copy can be accelerated by the DMA engine, and vhost can +free CPU cycles for higher level functions. This document provides the test plan for testing the following features when Vhost-user using asynchronous data path with CBDMA channels in loopback vhost-user/virtio-user topology. -1. Virtio-user server mode is a feature to enable virtio-user as the server, vhost as the client, thus after vhost-user is killed then relaunched, -virtio-user can reconnect back to vhost-user again; at another hand, virtio-user also can reconnect back to vhost-user after virtio-user is killed. -This feature test need cover different rx/tx paths with virtio 1.0 and virtio 1.1, includes split ring mergeable, non-mergeable, inorder mergeable, -inorder non-mergeable, vector_rx path and packed ring mergeable, non-mergeable, inorder non-mergeable, inorder mergeable, vectorized path. +1. Virtio-user server mode is a feature to enable virtio-user as the server, vhost as the client, thus after vhost-user +is killed then relaunched, virtio-user can reconnect back to vhost-user again; at another hand, virtio-user also can +reconnect back to vhost-user after virtio-user is killed. This feature test need cover different rx/tx paths with +virtio 1.0 and virtio 1.1, includes split ring mergeable, non-mergeable, inorder mergeable, inorder non-mergeable, +vector_rx path and packed ring mergeable, non-mergeable, inorder non-mergeable, inorder mergeable, vectorized path. 2. Check payload valid after packets forwarding many times. 3. Stress test with large chain packets. -Note: -1. When DMA devices are bound to vfio driver, VA mode is the default and recommended. For PA mode, page by page mapping may -exceed IOMMU's max capability, better to use 1G guest hugepage. -2. DPDK local patch that about vhost pmd is needed when testing Vhost asynchronous data path with testpmd. +.. note:: -For more about dpdk-testpmd sample, please refer to the DPDK docments: -https://doc.dpdk.org/guides/testpmd_app_ug/run_app.html -For virtio-user vdev parameter, you can refer to the DPDK docments: -https://doc.dpdk.org/guides/nics/virtio.html#virtio-paths-selection-and-usage. + 1. When DMA devices are bound to vfio driver, VA mode is the default and recommended. For PA mode, page by page mapping may + exceed IOMMU's max capability, better to use 1G guest hugepage. + 2. DPDK local patch that about vhost pmd is needed when testing Vhost asynchronous data path with testpmd. In this patch, + we enable asynchronous data path for vhostpmd. Asynchronous data path is enabled per tx/rx queue, and users need to specify + the DMA device used by the tx/rx queue. Each tx/rx queue only supports to use one DMA device (This is limited by the + implementation of vhostpmd), but one DMA device can be shared among multiple tx/rx queues of different vhost PMD ports. + + Two PMD parameters are added: + - dmas: specify the used DMA device for a tx/rx queue.(Default: no queues enable asynchronous data path) + - dma-ring-size: DMA ring size.(Default: 4096). + + Here is an example: + --vdev 'eth_vhost0,iface=./s0,dmas=[txq0@0000:00.01.0;rxq0@0000:00.01.1],dma-ring-size=2048' + + For more about dpdk-testpmd sample, please refer to the DPDK docments: + https://doc.dpdk.org/guides/testpmd_app_ug/run_app.html + For virtio-user vdev parameter, you can refer to the DPDK docments: + https://doc.dpdk.org/guides/nics/virtio.html#virtio-paths-selection-and-usage. Prerequisites ============= @@ -43,24 +55,24 @@ 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 + # 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 and DMA device ID of DUT, for example, 0000:18:00.0 is PCI device ID, 0000:00:04.0, 0000:00:04.1 is DMA device ID:: +2. Get the PCI device ID and DMA device ID of DUT, for example, 0000:18:00.0 is PCI device ID, 0000:00:01.0, 0000:00:01.1 is DMA device ID:: - # ./usertools/dpdk-devbind.py -s + # ./usertools/dpdk-devbind.py -s - Network devices using kernel driver - =================================== - 0000:18:00.0 'Device 159b' if=ens785f0 drv=ice unused=vfio-pci + Network devices using kernel driver + =================================== + 0000:18:00.0 'Device 159b' if=ens785f0 drv=ice unused=vfio-pci - DMA devices using kernel driver - =============================== - 0000:00:04.0 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=vfio-pci - 0000:00:04.1 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=vfio-pci + DMA devices using kernel driver + =============================== + 0000:00:01.0 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=vfio-pci + 0000:00:01.1 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=vfio-pci Test case ========= @@ -69,286 +81,540 @@ Common steps ------------ 1. Bind 1 NIC port and CBDMA channels to vfio-pci:: - # ./usertools/dpdk-devbind.py -b vfio-pci - # ./usertools/dpdk-devbind.py -b vfio-pci + # ./usertools/dpdk-devbind.py -b vfio-pci + # ./usertools/dpdk-devbind.py -b vfio-pci - For example, bind 2 CBDMA channels: - # ./usertools/dpdk-devbind.py -b vfio-pci 0000:00:04.0 0000:00:04.1 + For example, bind 2 CBDMA channels: + # ./usertools/dpdk-devbind.py -b vfio-pci 0000:00:01.0 0000:00:01.1 -Test Case 1: Loopback packed ring all path multi-queues payload check with server mode and cbdma enable -------------------------------------------------------------------------------------------------------- +Test Case 1: Loopback packed ring inorder mergeable path multi-queues payload check with server mode and cbdma enable +--------------------------------------------------------------------------------------------------------------------- This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user packed ring -all path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. Both iova as VA and PA mode test. +inorder mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -1. Bind 8 CBDMA channel to vfio-pci, as common step 1. +1. Bind 1 CBDMA channels to vfio-pci, as common step 1. -2. Launch vhost by below command:: +2. Launch vhost-user by below command:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 \ - -a 0000:00:04.0 -a 0000:00:04.1 -a 0000:00:04.2 -a 0000:00:04.3 -a 0000:00:04.4 -a 0000:00:04.5 -a 0000:00:04.6 -a 0000:00:04.7 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]' \ - --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 \ - --lcore-dma=[lcore11@0000:00:04.0,lcore11@0000:00:04.1,lcore12@0000:00:04.2,lcore12@0000:00:04.3,lcore13@0000:00:04.4,lcore13@0000:00:04.5,lcore14@0000:00:04.6,lcore14@0000:00:04.7] + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 -a 0000:00:01.0 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.0;txq5@0000:00:01.0;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.0;rxq5@0000:00:01.0;rxq6@0000:00:01.0;rxq7@0000:00:01.0]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 -3. Launch virtio-user with packed ring mergeable inorder path:: +3. Launch virtio-user with packed ring inorder mergeable path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-6 -n 4 --file-prefix=virtio-user0 --no-pci \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,packed_vq=1,server=1 \ -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd mac + testpmd> start 4. Attach pdump secondary process to primary process by same file-prefix:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ - --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ - --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' -5. Send large pkts from vhost, check loopback performance can get expected and each queue can receive packets:: +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: - testpmd> set fwd csum + testpmd> set fwd mac testpmd> set txpkts 64,64,64,2000,2000,2000 testpmd> set burst 1 testpmd> start tx_first 1 + testpmd> show port stats all testpmd> stop 6. Quit pdump, check all the packets length are 6192 Byte and the payload in receive packets are same in each pcap file. -7. Quit and relaunch vhost and rerun step 4-6. +Test Case 2: Loopback packed ring mergeable path multi-queues payload check with server mode and cbdma enable +------------------------------------------------------------------------------------------------------------- +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user packed ring +mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -8. Quit and relaunch virtio with packed ring mergeable path as below:: +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.1;rxq5@0000:00:01.1;rxq6@0000:00:01.1;rxq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with packed ring mergeable path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-6 -n 4 --file-prefix=virtio-user0 --no-pci \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,packed_vq=1,server=1 \ -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd mac + testpmd> start + +4. Attach pdump secondary process to primary process by same file-prefix:: -9. Rerun steps 4-7. + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd mac + testpmd> set txpkts 64,64,64,2000,2000,2000 + testpmd> set burst 1 + testpmd> start tx_first 1 + testpmd> show port stats all + testpmd> stop + +6. Quit pdump, check all the packets length are 6192 Byte and the payload in receive packets are same in each pcap file. + +Test Case 3: Loopback packed ring inorder non-mergeable path multi-queues payload check with server mode and cbdma enable +------------------------------------------------------------------------------------------------------------------------- +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user packed ring +inorder non-mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -10. Quit and relaunch virtio with packed ring non-mergeable path as below:: +1. Bind 4 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 -a 0000:00:01.2 -a 0000:00:01.3 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.1;txq3@0000:00:01.1;txq4@0000:00:01.2;txq5@0000:00:01.2;rxq2@0000:00:01.1;rxq3@0000:00:01.1;rxq4@0000:00:01.2;rxq5@0000:00:01.2;rxq6@0000:00:01.3;rxq7@0000:00:01.3]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with packed ring inorder non-mergeable path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-6 -n 4 --file-prefix=virtio-user0 --no-pci \ - --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1 \ + --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1 \ -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start -11. Rerun step 4. +4. Attach pdump secondary process to primary process by same file-prefix:: -12. Send pkts from vhost, check loopback performance can get expected and each queue can receive packets:: + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' - testpmd> set fwd csum +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd mac testpmd> set txpkts 64,128,256,512 testpmd> set burst 1 testpmd> start tx_first 1 + testpmd> show port stats all testpmd> stop -13. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. +6. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. -14. Quit and relaunch vhost and rerun step 11-13. +Test Case 4: Loopback packed ring non-mergeable path multi-queues payload check with server mode and cbdma enable +----------------------------------------------------------------------------------------------------------------- +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user packed ring +non-mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -15. Quit and relaunch virtio with packed ring inorder non-mergeable path as below:: +1. Bind 8 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 -a 0000:00:04.2 -a 0000:00:04.3 -a 0000:00:04.4 -a 0000:00:04.5 -a 0000:00:04.6 -a 0000:00:04.7 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.1;txq2@0000:00:04.2;txq3@0000:00:04.3;txq4@0000:00:04.4;txq5@0000:00:04.5;rxq2@0000:00:04.2;rxq3@0000:00:04.3;rxq4@0000:00:04.4;rxq5@0000:00:04.5;rxq6@0000:00:04.6;rxq7@0000:00:04.7]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with packed ring non-mergeable path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-6 -n 4 --file-prefix=virtio-user0 --no-pci \ - --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1 \ + --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1 \ -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start + +4. Attach pdump secondary process to primary process by same file-prefix:: -16. Rerun step 11-14. + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' -17. Quit and relaunch virtio with packed ring vectorized path as below:: +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd mac + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 + testpmd> show port stats all + testpmd> stop + +6. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. + +Test Case 5: Loopback packed ring vectorized path multi-queues payload check with server mode and cbdma enable +-------------------------------------------------------------------------------------------------------------- +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user packed ring +vectorized path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. + +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.1;rxq5@0000:00:01.1;rxq6@0000:00:01.1;rxq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with packed ring vectorized path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-6 -n 4 --file-prefix=virtio-user0 --no-pci --force-max-simd-bitwidth=512 \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,server=1 \ -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start + +4. Attach pdump secondary process to primary process by same file-prefix:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd mac + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 + testpmd> show port stats all + testpmd> stop + +6. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. + +Test Case 6: Loopback packed ring vectorized path and ring size is not power of 2 multi-queues payload check with server mode and cbdma enable +---------------------------------------------------------------------------------------------------------------------------------------------- +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user packed ring vectorized path and +ring size is not power of 2, multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -18. Rerun step 11-14. +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. -19. Quit and relaunch virtio with packed ring vectorized path and ring size is not power of 2 as below:: +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.1;rxq5@0000:00:01.1;rxq6@0000:00:01.1;rxq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with packed ring vectorized path and ring size is not power of 2:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-6 -n 4 --file-prefix=virtio-user0 --no-pci --force-max-simd-bitwidth=512 \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queue_size=1025,server=1 \ -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1025 --rxd=1025 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start -20. Rerun step 11-14. +4. Attach pdump secondary process to primary process by same file-prefix:: -21. Quit and relaunch vhost w/ iova=pa:: + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-14 -n 4 \ - -a 0000:00:04.0 -a 0000:00:04.1 -a 0000:00:04.2 -a 0000:00:04.3 -a 0000:00:04.4 -a 0000:00:04.5 -a 0000:00:04.6 -a 0000:00:04.7 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq6;txq7;rxq0;rxq1;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]' \ - --iova=pa -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 \ - --lcore-dma=[lcore11@0000:00:04.0,lcore11@0000:00:04.1,lcore12@0000:00:04.2,lcore12@0000:00:04.3,lcore13@0000:00:04.4,lcore13@0000:00:04.5,lcore14@0000:00:04.6,lcore14@0000:00:04.7] +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: -22. Rerun steps 3-6. + testpmd> set fwd mac + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 + testpmd> show port stats all + testpmd> stop + +6. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. -Test Case 2: Loopback split ring all path multi-queues payload check with server mode and cbdma enable ------------------------------------------------------------------------------------------------------- +Test Case 7: Loopback split ring inorder mergeable path multi-queues payload check with server mode and cbdma enable +-------------------------------------------------------------------------------------------------------------------- This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user split ring -all path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. Both iova as VA and PA mode test. +inorder mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -1. Bind 3 CBDMA channel to vfio-pci, as common step 1. +1. Bind 1 CBDMA channels to vfio-pci, as common step 1. -2. Launch vhost by below command:: +2. Launch vhost-user by below command:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:04.0 -a 0000:00:04.1 -a 0000:00:04.2 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]' \ - --iova=va -- -i --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 \ - --lcore-dma=[lcore11@0000:00:04.0,lcore12@0000:00:04.0,lcore13@0000:00:04.1,lcore13@0000:00:04.2,lcore14@0000:00:04.1,lcore14@0000:00:04.2,lcore15@0000:00:04.1,lcore15@0000:00:04.2] + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:01.0 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.0;txq5@0000:00:01.0;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.0;rxq5@0000:00:01.0;rxq6@0000:00:01.0;rxq7@0000:00:01.0]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 -3. Launch virtio-user with split ring mergeable inorder path:: +3. Launch virtio-user with split ring inorder mergeable path:: dpdk dir># ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ -vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1 \ - -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start 4. Attach pdump secondary process to primary process by same file-prefix:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ - --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ - --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd mac + testpmd> set txpkts 64,64,64,2000,2000,2000 + testpmd> set burst 1 + testpmd> start tx_first 1 + testpmd> show port stats all + testpmd> stop + +6. Quit pdump, check all the packets length are 6192 Byte and the payload in receive packets are same in each pcap file. + +Test Case 8: Loopback split ring mergeable path multi-queues payload check with server mode and cbdma enable +------------------------------------------------------------------------------------------------------------ +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user split ring +mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. + +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: -5. Send large pkts from vhost, check loopback performance can get expected and each queue can receive packets:: + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.1;rxq5@0000:00:01.1;rxq6@0000:00:01.1;rxq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 +3. Launch virtio-user with split ring mergeable path:: + + dpdk dir># ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ + -vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1 \ + - -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 testpmd> set fwd csum + testpmd> start + +4. Attach pdump secondary process to primary process by same file-prefix:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd mac testpmd> set txpkts 64,64,64,2000,2000,2000 testpmd> set burst 1 testpmd> start tx_first 1 + testpmd> show port stats all testpmd> stop 6. Quit pdump, check all the packets length are 6192 Byte and the payload in receive packets are same in each pcap file. -7. Quit and relaunch vhost and rerun step 4-6. +Test Case 9: Loopback split ring inorder non-mergeable path multi-queues payload check with server mode and cbdma enable +------------------------------------------------------------------------------------------------------------------------ +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user split ring +inorder non-mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -8. Quit and relaunch virtio with split ring mergeable path as below:: +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.1;rxq5@0000:00:01.1;rxq6@0000:00:01.1;rxq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with split ring inorder non-mergeable path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ - --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,server=1 \ + --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,server=1 \ -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start -9. Rerun steps 4-7. +4. Attach pdump secondary process to primary process by same file-prefix:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: -10. Quit and relaunch virtio with split ring non-mergeable path as below:: + testpmd> set fwd mac + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 + testpmd> show port stats all + testpmd> stop + +6. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. + +Test Case 10: Loopback split ring non-mergeable path multi-queues payload check with server mode and cbdma enable +----------------------------------------------------------------------------------------------------------------- +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user split ring +non-mergeable path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. + +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.1;rxq5@0000:00:01.1;rxq6@0000:00:01.1;rxq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with split ring non-mergeable path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,server=1 \ -- -i --enable-hw-vlan-strip --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start -11. Rerun step 4. +4. Attach pdump secondary process to primary process by same file-prefix:: -12. Send pkts from vhost, check loopback performance can get expected and each queue can receive packets:: + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' - testpmd> set fwd csum +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd mac testpmd> set txpkts 64,128,256,512 testpmd> set burst 1 testpmd> start tx_first 1 + testpmd> show port stats all testpmd> stop -13. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. +6. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. -14. Quit and relaunch vhost and rerun step 11-13. +Test Case 11: Loopback split ring vectorized path multi-queues payload check with server mode and cbdma enable +-------------------------------------------------------------------------------------------------------------- +This case tests the payload is valid after forwading large chain packets in loopback vhost-user/virtio-user split ring +vectorized path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. -15. Quit and relaunch virtio with split ring inorder non-mergeable path as below:: +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ - --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,server=1 \ - -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start +2. Launch vhost-user by below command:: -16. Rerun step 11-14. + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;rxq2@0000:00:01.0;rxq3@0000:00:01.0;rxq4@0000:00:01.1;rxq5@0000:00:01.1;rxq6@0000:00:01.1;rxq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 -17. Quit and relaunch virtio with split ring vectorized path as below:: +3. Launch virtio-user with split ring vectorized path:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,server=1 \ -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 - testpmd>set fwd csum - testpmd>start + testpmd> set fwd csum + testpmd> start -18. Rerun step 11-14. +4. Attach pdump secondary process to primary process by same file-prefix:: -19. Quit and relaunch vhost w/ iova=pa:: + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:04.0 -a 0000:00:04.1 -a 0000:00:04.2 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]' \ - --iova=pa -- -i --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 \ - --lcore-dma=[lcore11@0000:00:04.0,lcore12@0000:00:04.0,lcore13@0000:00:04.1,lcore13@0000:00:04.2,lcore14@0000:00:04.1,lcore14@0000:00:04.2,lcore15@0000:00:04.1,lcore15@0000:00:04.2] +5. Send large packets from vhost, check loopback performance can get expected and each queue can receive packets:: -20. Rerun steps 3-6. + testpmd> set fwd mac + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 + testpmd> show port stats all + testpmd> stop -Test Case 3: Loopback split ring large chain packets stress test with server mode and cbdma enable --------------------------------------------------------------------------------------------------- -This is a stress test case about forwading large chain packets in loopback vhost-user/virtio-user split ring with server mode -when vhost uses the asynchronous operations with CBDMA channels. Both iova as VA and PA mode test. +6. Quit pdump, check all the packets length are 960 Byte and the payload in receive packets are same in each pcap file. -1. Bind 1 CBDMA channel to vfio-pci, as common step 1. +Test Case 12: Loopback split ring large chain packets stress test with server mode and cbdma enable +--------------------------------------------------------------------------------------------------- +This is a stress test case about forwading large chain packets in loopback vhost-user/virtio-user split ring with server mode +when vhost uses the asynchronous operations with CBDMA channels. -2. Launch vhost by below command:: +1. Bind 1 CBDMA channels to vfio-pci, as common step 1. - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 -a 0000:00:04.0 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0;rxq0]' --iova=va -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@0000:00:04.0] +2. Launch vhost-user by below command:: -3. Launch virtio and start testpmd:: + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 -a 0000:00:01.0 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0@0000:00:01.0;rxq0@0000:00:01.0]' --iova=va -- -i --nb-cores=1 --mbuf-size=65535 + +3. Launch virtio-user and start testpmd:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=testpmd0 --no-pci \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,server=1,mrg_rxbuf=1,in_order=0,vectorized=1,queue_size=2048 \ -- -i --rxq=1 --txq=1 --txd=2048 --rxd=2048 --nb-cores=1 - testpmd>start + testpmd> start -4. Send large packets from vhost, check virtio can receive packets:: +4. Send large packets from vhost, check packets can loop normally:: - testpmd> set txpkts 65535,65535,65535,65535,65535 + testpmd> set txpkts 65535,65535 testpmd> start tx_first 32 testpmd> show port stats all -5. Stop and quit vhost testpmd and relaunch vhost with iova=pa:: - - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 -a 0000:00:04.0 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0;rxq0]' --iova=pa -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@0000:00:04.0] - -6. Rerun steps 4. - -Test Case 4: Loopback packed ring large chain packets stress test with server mode and cbdma enable ---------------------------------------------------------------------------------------------------- -This is a stress test case about forwading large chain packets in loopback vhost-user/virtio-user packed ring with server mode -when vhost uses the asynchronous operations with dsa dpdk driver. Both iova as VA and PA mode test. +Test Case 13: Loopback packed ring large chain packets stress test with server mode and cbdma enable +---------------------------------------------------------------------------------------------------- +This is a stress test case about forwading large chain packets in loopback vhost-user/virtio-user +packed ring with server mode when vhost uses the asynchronous operations with CBDMA channels. -1. Bind 1 CBDMA channel to vfio-pci, as common step 1. +1. Bind 1 CBDMA channels to vfio-pci, as common step 1. -2. Launch vhost by below command:: +2. Launch vhost-user by below command:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 -a 0000:00:04.0 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=1,dmas=[txq0;rxq0],client=1' --iova=va -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@0000:00:04.0] + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 -a 0000:00:01.0 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=1,dmas=[txq0@0000:00:01.0;rxq0@0000:00:01.0],client=1' --iova=va -- -i --nb-cores=1 --mbuf-size=65535 -3. Launch virtio and start testpmd:: +3. Launch virtio-user and start testpmd:: # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=testpmd0 --no-pci \ --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,mrg_rxbuf=1,in_order=0,vectorized=1,packed_vq=1,queue_size=2048,server=1 \ -- -i --rxq=1 --txq=1 --txd=2048 --rxd=2048 --nb-cores=1 - testpmd>start + testpmd> start -4. Send large packets from vhost, check virtio can receive packets:: +4. Send large packets from vhost, check packets can loop normally:: - testpmd> set txpkts 65535,65535,65535,65535,65535 + testpmd> set txpkts 65535,65535 testpmd> start tx_first 32 testpmd> show port stats all -5. Stop and quit vhost testpmd and relaunch vhost with iova=pa:: +Test Case 14: PV split and packed ring test txonly mode with cbdma enable +------------------------------------------------------------------------- +This case tests that vhost pmd can work normally with txonly/rxonly mode when vhost uses the asynchronous operations with CBDMA channels. + +1. Bind 2 CBDMA channels to vfio-pci, as common step 1. + +2. Launch vhost-user by below command:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 -a 0000:00:01.0 -a 0000:00:01.1 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0@0000:00:01.0;txq1@0000:00:01.0;txq2@0000:00:01.0;txq3@0000:00:01.0;txq4@0000:00:01.1;txq5@0000:00:01.1;txq6@0000:00:01.1;txq7@0000:00:01.1]' \ + --iova=va -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + +3. Launch virtio-user with split ring inorder mergeable path:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ + --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1 \ + -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + testpmd> set fwd rxonly + testpmd> start + +4. Attach pdump secondary process to primary process by same file-prefix:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + +5. Send large packets from vhost:: + + testpmd> set fwd txonly + testpmd> async_vhost tx poll completed on + testpmd> set txpkts 64,64,64,2000,2000,2000 + testpmd> set burst 1 + testpmd> start tx_first 1 + +6. Check the Rx-pps>0 and each queue can receive packets with 6192 Byte from virtio-user. + +7. Quit pdump, check packets with 6192 Byte in each pcap file. + +8. Relaunch virtio-user with packed ring vectorized path with ring size is not power of 2:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci --force-max-simd-bitwidth=512 \ + --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,packed_vq=1,server=1,queue_size=1025 \ + -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1025 --rxd=1025 + testpmd> set fwd rxonly + testpmd> start + +9. Attach pdump secondary process to primary process by same file-prefix:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio-user0 -- \ + --pdump 'device_id=net_virtio_user0,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user0,queue=1,rx-dev=./pdump-virtio-rx-q1.pcap,mbuf-size=8000' + +10. Send packets from vhost:: + + testpmd> set fwd txonly + testpmd> async_vhost tx poll completed on + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 -a 0000:00:04.0 \ - --vdev 'eth_vhost0,iface=vhost-net0,queues=1,dmas=[txq0],client=1' --iova=pa -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@0000:00:04.0] +11. Check each queue can receive packets with 960 Byte from virtio-user. -6. Rerun steps 4. +12. Quit pdump, check packets with 960 Byte in each pcap file. From patchwork Tue Nov 22 09:19: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: 120089 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 52CC0A0580; Tue, 22 Nov 2022 10:25:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E63F42D59; Tue, 22 Nov 2022 10:25:56 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id AA6EF42D57 for ; Tue, 22 Nov 2022 10:25:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669109153; x=1700645153; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hSF3IxYnxNpFYAMMWXw54E8rxN5mtWIKCl/ElhJmi0I=; b=PLvpvmAH/L7ZaZk7C5XM/oNzRg7+LK91Rkp/25U1Ywk+n7wJuM8fxZRE p8v28CcDcJb2fYjZsq0ZzUkFYvaMzJB72uKKhEyP9sWQ3uDa1e43xItZU /8s8fwJgbmHcCO/jouPnq90GyUEYCwVTzkwaI2+fE25aNDqDLmPoP9XzB PS8sXAM/DE3WmpetoFx3sVIdv/uRUYR5ZZNNgn14KX/hRMHPn9VKPo8zW D17oCNh/j9dZfWk9FDpE9xoICoETPL+Lsy4C4vihYVypEyiRfxtacA/dI Tb3bfM8rNHeq/QqAPldFFqQIifNPHxkPkvm5S9ExO2PBpQu0Mx7lpFoVT w==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="312475938" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208,223";a="312475938" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 01:25:47 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="635481675" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208,223";a="635481675" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 01:25:45 -0800 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V3 2/2] tests/loopback_virtio_user_server_mode_cbdma: modify the dmas parameter by DPDK changed Date: Tue, 22 Nov 2022 17:19:59 +0800 Message-Id: <20221122091959.2899932-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 From DPDK-22.11, the dmas parameter have changed, so modify the dmas parameter in the testsuite. Signed-off-by: Wei Ling --- ..._loopback_virtio_user_server_mode_cbdma.py | 889 ++++++++++++------ 1 file changed, 605 insertions(+), 284 deletions(-) diff --git a/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py index 81fae50c..40db831e 100644 --- a/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py +++ b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py @@ -42,7 +42,7 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): Run before each test case. """ self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") - self.dut.send_expect("rm -rf ./vhost-net*", "#") + self.dut.send_expect("rm -rf /root/dpdk/vhost-net*", "#") self.table_header = [ "Mode", "Pkt_size", @@ -60,45 +60,59 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): return True if out == "2048" else False def send_6192_packets_from_vhost(self): - """ - start the testpmd of vhost-user, start to send 8k packets - """ - time.sleep(3) - self.vhost_user_pmd.execute_cmd("set fwd csum") self.vhost_user_pmd.execute_cmd("set txpkts 64,64,64,2000,2000,2000") self.vhost_user_pmd.execute_cmd("set burst 1") self.vhost_user_pmd.execute_cmd("start tx_first 1") - self.vhost_user_pmd.execute_cmd("stop") def send_960_packets_from_vhost(self): - """ - start the testpmd of vhost-user, start to send 8k packets - """ - time.sleep(3) - self.vhost_user_pmd.execute_cmd("set fwd csum") self.vhost_user_pmd.execute_cmd("set txpkts 64,128,256,512") self.vhost_user_pmd.execute_cmd("set burst 1") self.vhost_user_pmd.execute_cmd("start tx_first 1") - self.vhost_user_pmd.execute_cmd("stop") def send_chain_packets_from_vhost(self): - time.sleep(3) - self.vhost_user_pmd.execute_cmd("set txpkts 65535,65535,65535,65535,65535") + self.vhost_user_pmd.execute_cmd("set txpkts 65535,65535") self.vhost_user_pmd.execute_cmd("start tx_first 32", timeout=30) def verify_virtio_user_receive_packets(self): results = 0.0 - time.sleep(3) - for _ in range(10): - out = self.virtio_user_pmd.execute_cmd("show port stats all") + for _ in range(5): + out = self.virtio_user_pmd.execute_cmd("show port stats 0") lines = re.search("Rx-pps:\s*(\d*)", out) result = lines.group(1) results += float(result) - Mpps = results / (1000000 * 10) + Mpps = results / (1000000 * 5) self.logger.info(Mpps) self.verify(Mpps > 0, "virtio-user can not receive packets") - def launch_pdump_to_capture_pkt(self, capture_all_queue=True): + def check_each_queue_has_packets_info_on_virtio_user( + self, queues, check_rx=True, check_tx=True + ): + """ + check each queue has receive packets on virtio-user0 side + """ + out = self.virtio_user_pmd.execute_cmd("stop") + for queue_index in range(0, queues): + queue = re.search("Port= 0/Queue=\s*%d" % queue_index, out) + queue = queue.group() + index = out.find(queue) + if check_rx: + rx = re.search("RX-packets:\s*(\d*)", out[index:]) + rx_packets = int(rx.group(1)) + self.verify( + rx_packets > 0, + "The queue %d rx-packets is 0 about " % queue_index + + "rx-packets:%d" % rx_packets, + ) + if check_tx: + tx = re.search("TX-packets:\s*(\d*)", out[index:]) + tx_packets = int(tx.group(1)) + self.verify( + tx_packets > 0, + "The queue %d tx-packets is 0 about " % queue_index + + "tx-packets:%d" % tx_packets, + ) + + def launch_pdump_to_capture_pkt(self): command = ( self.app_pdump + " " @@ -110,24 +124,26 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): command % (self.dump_pcap_q0, self.dump_pcap_q1), "Port" ) - def check_packet_payload_valid(self, pkt_len): + def check_packet_payload_valid(self, pkt_len, check_payload=True): self.pdump_session.send_expect("^c", "# ", 60) dump_file_list = [self.dump_pcap_q0, self.dump_pcap_q1] for pcap in dump_file_list: - self.dut.session.copy_file_from(src="%s" % pcap, dst="%s" % pcap) pkt = Packet() - pkts = pkt.read_pcapfile(pcap) + self.logger.info("Check capture file: %s payload " % pcap) + pkts = pkt.read_pcapfile(pcap, crb=self.dut) expect_data = str(pkts[0]["Raw"]) for i in range(len(pkts)): self.verify( len(pkts[i]) == pkt_len, - "virtio-user0 receive packet's length not equal %s Byte" % pkt_len, - ) - check_data = str(pkts[i]["Raw"]) - self.verify( - check_data == expect_data, - "the payload in receive packets has been changed from %s" % i, + "virtio-user0 receive packet's length %s not equal %s Byte" + % (len(pkts[i]), pkt_len), ) + if check_payload: + check_data = str(pkts[i]["Raw"]) + self.verify( + check_data == expect_data, + "the payload in receive packets has been changed from %s" % i, + ) def start_vhost_testpmd(self, cores, eal_param, param, ports, iova_mode="va"): eal_param += " --iova=" + iova_mode @@ -141,7 +157,12 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ) def start_virtio_testpmd_with_vhost_net0( - self, cores, eal_param, param, set_fwd_csum=True + self, + cores, + eal_param, + param, + set_fwd_csum=True, + set_fwd_rxonly=False, ): """ launch the testpmd as virtio with vhost_net0 @@ -158,6 +179,8 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ) if set_fwd_csum: self.virtio_user_pmd.execute_cmd("set fwd csum") + if set_fwd_rxonly: + self.virtio_user_pmd.execute_cmd("set fwd rxonly") self.virtio_user_pmd.execute_cmd("start") @staticmethod @@ -224,47 +247,45 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.dut.close_session(self.vhost_user) self.dut.close_session(self.virtio_user) - def test_loopback_packed_ring_all_path_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + def test_loopback_packed_ring_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( self, ): """ - Test Case 1: Loopback packed ring all path multi-queues payload check with server mode and cbdma enable + Test Case 1: Loopback packed ring inorder mergeable path multi-queues payload check with server mode and cbdma enable """ - self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=8) - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'" - lcore_dma = ( - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s" + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" % ( - self.vhost_core_list[1], self.cbdma_list[0], - self.vhost_core_list[1], - self.cbdma_list[1], - self.vhost_core_list[2], - self.cbdma_list[2], - self.vhost_core_list[2], - self.cbdma_list[3], - self.vhost_core_list[3], - self.cbdma_list[4], - self.vhost_core_list[3], - self.cbdma_list[5], - self.vhost_core_list[4], - self.cbdma_list[6], - self.vhost_core_list[4], - self.cbdma_list[7], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], ) ) - vhost_param = ( - " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]" - % lcore_dma + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas ) - + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -272,18 +293,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,packed_vq=1,server=1" virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) - self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_6192_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=6192) - self.vhost_user_pmd.quit() + def test_loopback_packed_ring_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 2: Loopback packed ring mergeable path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -291,21 +351,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.virtio_user_pmd.quit() virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,packed_vq=1,server=1" virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_6192_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=6192) - self.vhost_user_pmd.quit() + def test_loopback_packed_ring_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 3: Loopback packed ring inorder non-mergeable path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=4) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[2], + self.cbdma_list[2], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[2], + self.cbdma_list[2], + self.cbdma_list[3], + self.cbdma_list[3], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -313,21 +409,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.virtio_user_pmd.quit() - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1" + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1" virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_960_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=960) - self.vhost_user_pmd.quit() + def test_loopback_packed_ring_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 4: Loopback packed ring non-mergeable path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=8) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[2], + self.cbdma_list[3], + self.cbdma_list[4], + self.cbdma_list[5], + self.cbdma_list[2], + self.cbdma_list[3], + self.cbdma_list[4], + self.cbdma_list[5], + self.cbdma_list[6], + self.cbdma_list[7], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -335,21 +467,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.virtio_user_pmd.quit() - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1" + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1" virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_960_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=960) - self.vhost_user_pmd.quit() + def test_loopback_packed_ring_vectorized_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 5: Loopback packed ring vectorized path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -357,21 +525,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.virtio_user_pmd.quit() - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,server=1" + virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,server=1" virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_960_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=960) - self.vhost_user_pmd.quit() + def test_loopback_packed_ring_vectorized_not_power_of_2_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 6: Loopback packed ring vectorized path and ring size is not power of 2 multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -379,102 +583,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.virtio_user_pmd.quit() - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queue_size=1025,server=1" + virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queue_size=1025,server=1" virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1025 --rxd=1025" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_960_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=960) - self.vhost_user_pmd.quit() - self.start_vhost_testpmd( - cores=self.vhost_core_list, - eal_param=vhost_eal_param, - param=vhost_param, - ports=self.cbdma_list, - iova_mode="va", - ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - if not self.check_2M_env: - self.virtio_user_pmd.quit() - self.vhost_user_pmd.quit() - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq6;txq7;rxq0;rxq1;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'" - vhost_param = ( - " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]" - % lcore_dma - ) - self.start_vhost_testpmd( - cores=self.vhost_core_list, - eal_param=vhost_eal_param, - param=vhost_param, - ports=self.cbdma_list, - iova_mode="pa", - ) - - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,packed_vq=1,server=1" - virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" - self.logger.info("Launch virtio with packed ring mergeable inorder path") - self.start_virtio_testpmd_with_vhost_net0( - cores=self.virtio0_core_list, - eal_param=virtio_eal_param, - param=virtio_param, - ) - - self.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - def test_loopback_split_ring_all_path_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + def test_loopback_split_ring_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( self, ): """ - Test Case 2: Loopback split ring all path multi-queues payload check with server mode and cbdma enable - """ - self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=3) - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'" - lcore_dma = ( - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s," - "lcore%s@%s" + Test Case 7: Loopback split ring inorder mergeable path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" % ( - self.vhost_core_list[1], self.cbdma_list[0], - self.vhost_core_list[2], self.cbdma_list[0], - self.vhost_core_list[3], - self.cbdma_list[1], - self.vhost_core_list[3], - self.cbdma_list[2], - self.vhost_core_list[4], - self.cbdma_list[1], - self.vhost_core_list[4], - self.cbdma_list[2], - self.vhost_core_list[5], - self.cbdma_list[1], - self.vhost_core_list[5], - self.cbdma_list[2], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], ) ) - vhost_param = ( - " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]" - % lcore_dma + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas ) - + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -482,18 +641,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1" - virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) - self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_6192_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=6192) - self.vhost_user_pmd.quit() + def test_loopback_split_ring_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 8: Loopback split ring mergeable path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -501,45 +699,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.virtio_user_pmd.quit() virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,server=1" - virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_6192_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=6192) - self.vhost_user_pmd.quit() - self.start_vhost_testpmd( - cores=self.vhost_core_list, - eal_param=vhost_eal_param, - param=vhost_param, - ports=self.cbdma_list, - iova_mode="va", - ) - self.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.virtio_user_pmd.quit() - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,server=1" - virtio_param = ( - "--enable-hw-vlan-strip --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + def test_loopback_split_ring_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 9: Loopback split ring inorder non-mergeable path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=4) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[2], + self.cbdma_list[2], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[2], + self.cbdma_list[2], + self.cbdma_list[3], + self.cbdma_list[3], + ) ) - self.start_virtio_testpmd_with_vhost_net0( - cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.vhost_user_pmd.quit() + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -547,21 +757,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.virtio_user_pmd.quit() virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,server=1" - virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_960_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=960) - self.vhost_user_pmd.quit() + def test_loopback_split_ring_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 10: Loopback split ring non-mergeable path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -569,21 +815,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.virtio_user_pmd.quit() - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,server=1" - virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,server=1" + virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_960_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=960) - self.vhost_user_pmd.quit() + def test_loopback_split_ring_vectorized_multi_queues_payload_check_with_server_mode_and_cbdma_enable( + self, + ): + """ + Test Case 11: Loopback split ring vectorized path multi-queues payload check with server mode and cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "rxq2@%s;" + "rxq3@%s;" + "rxq4@%s;" + "rxq5@%s;" + "rxq6@%s;" + "rxq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -591,51 +873,35 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,vectorized=1,server=1" + virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param + ) self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd mac") self.send_960_packets_from_vhost() + self.vhost_user_pmd.execute_cmd("show port stats all") + self.vhost_user_pmd.execute_cmd("stop") self.check_packet_payload_valid(pkt_len=960) - if not self.check_2M_env: - self.virtio_user_pmd.quit() - self.vhost_user_pmd.quit() - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'" - vhost_param = ( - " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]" - % lcore_dma - ) - self.start_vhost_testpmd( - cores=self.vhost_core_list, - eal_param=vhost_eal_param, - param=vhost_param, - ports=self.cbdma_list, - iova_mode="pa", - ) - - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1" - virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" - self.logger.info("Launch virtio with packed ring mergeable inorder path") - self.start_virtio_testpmd_with_vhost_net0( - cores=self.virtio0_core_list, - eal_param=virtio_eal_param, - param=virtio_param, - ) - - self.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - def test_loopback_split_ring_large_chain_packets_stress_test_with_server_mode_and_cbdma_enable( + def test_loopback_split_ring_large_chain_packets_stress_test_with_server_moede_and_cbdma_enable( self, ): """ - Test Case 3: Loopback split ring large chain packets stress test with server mode and cbdma enable + Test Case 12: Loopback split ring large chain packets stress test with server mode and cbdma enable """ if not self.check_2M_env: self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1) - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0;rxq0]'" - lcore_dma = "lcore%s@%s" % (self.vhost_core_list[1], self.cbdma_list[0]) - - vhost_param = " --nb-cores=1 --mbuf-size=65535 --lcore-dma=[%s]" % lcore_dma + dmas = "txq0@%s;" "rxq0@%s" % ( + self.cbdma_list[0], + self.cbdma_list[0], + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[%s]'" + % dmas + ) + vhost_param = "--nb-cores=1 --mbuf-size=65535" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -643,7 +909,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,server=1,mrg_rxbuf=1,in_order=0,vectorized=1,queue_size=2048" virtio_param = " --nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048" self.start_virtio_testpmd_with_vhost_net0( @@ -652,33 +917,26 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): param=virtio_param, set_fwd_csum=False, ) - - self.send_chain_packets_from_vhost() - self.verify_virtio_user_receive_packets() - - self.vhost_user_pmd.quit() - self.start_vhost_testpmd( - cores=self.vhost_core_list, - eal_param=vhost_eal_param, - param=vhost_param, - ports=self.cbdma_list, - iova_mode="pa", - ) self.send_chain_packets_from_vhost() self.verify_virtio_user_receive_packets() - def test_loopback_packed_ring_large_chain_packets_stress_test_with_server_mode_and_cbdma_enable( + def test_loopback_packed_ring_large_chain_packets_stress_test_with_server_moede_and_cbdma_enable( self, ): """ - Test Case 4: Loopback packed ring large chain packets stress test with server mode and cbdma enable + Test Case 13: Loopback packed ring large chain packets stress test with server mode and cbdma enable """ if not self.check_2M_env: self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1) - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0;rxq0]'" - lcore_dma = "lcore%s@%s" % (self.vhost_core_list[1], self.cbdma_list[0]) - - vhost_param = " --nb-cores=1 --mbuf-size=65535 --lcore-dma=[%s]" % lcore_dma + dmas = "txq0@%s;" "rxq0@%s" % ( + self.cbdma_list[0], + self.cbdma_list[0], + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[%s]'" + % dmas + ) + vhost_param = "--nb-cores=1 --mbuf-size=65535" self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -686,7 +944,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ports=self.cbdma_list, iova_mode="va", ) - virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,server=1,mrg_rxbuf=1,in_order=0,vectorized=1,packed_vq=1,queue_size=2048" virtio_param = " --nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048" self.start_virtio_testpmd_with_vhost_net0( @@ -695,20 +952,84 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): param=virtio_param, set_fwd_csum=False, ) - self.send_chain_packets_from_vhost() self.verify_virtio_user_receive_packets() - self.vhost_user_pmd.quit() - self.start_vhost_testpmd( - cores=self.vhost_core_list, - eal_param=vhost_eal_param, - param=vhost_param, - ports=self.cbdma_list, - iova_mode="pa", + def test_pv_split_and_packed_test_txonly_mode_with_cbdma_enable(self): + """ + Test Case 14: PV split and packed ring test txonly mode with cbdma enable + """ + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) + dmas = ( + "txq0@%s;" + "txq1@%s;" + "txq2@%s;" + "txq3@%s;" + "txq4@%s;" + "txq5@%s;" + "txq6@%s;" + "txq7@%s" + % ( + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[0], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], + self.cbdma_list[1], ) - self.send_chain_packets_from_vhost() - self.verify_virtio_user_receive_packets() + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + ports=self.cbdma_list, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1" + virtio_param = "--nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=False, + set_fwd_rxonly=True, + ) + self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd txonly") + self.vhost_user_pmd.execute_cmd("async_vhost tx poll completed on") + self.send_6192_packets_from_vhost() + self.verify_virtio_user_receive_packets() + self.check_each_queue_has_packets_info_on_virtio_user( + queues=8, check_rx=True, check_tx=False + ) + self.check_packet_payload_valid(pkt_len=6192, check_payload=False) + + self.vhost_user_pmd.execute_cmd("stop") + self.virtio_user_pmd.quit() + virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,packed_vq=1,server=1,queue_size=1025" + virtio_param = "--nb-cores=1 --rxq=8 --txq=8 --txd=1025 --rxd=1025" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=False, + set_fwd_rxonly=True, + ) + self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd txonly") + self.vhost_user_pmd.execute_cmd("async_vhost tx poll completed on") + self.send_960_packets_from_vhost() + self.verify_virtio_user_receive_packets() + self.check_each_queue_has_packets_info_on_virtio_user( + queues=8, check_rx=True, check_tx=False + ) + self.check_packet_payload_valid(pkt_len=960, check_payload=False) def tear_down(self): """