From patchwork Wed Aug 3 01:52:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 114554 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 8E795A00C5; Wed, 3 Aug 2022 03:58:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86A09427F6; Wed, 3 Aug 2022 03:58:04 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 714B040141 for ; Wed, 3 Aug 2022 03:58:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659491883; x=1691027883; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+iXRsaN+JDA0xQonyZYLQPOmnTGzg2J5cCJkjHSgs0A=; b=GTngkbJ64nVenpK1gNQ6M3C7jkVSaXX50IUGu46paz5ui0oa7FidhFXt pOMfDAnG7FxmbmI6miMpZ0Runab3ujraafOtp/QLMYJkiY/6nwOxIFg5j LhL/uhhOr6RmDXptsKdkLr0R8Dt6PjzXAxGJNTerrn614SFX+W4Dgz4E1 Ds9ujDYBe+XDZFaGzKewQ6TvkitsldbOHKRymeLZLE8JZl+MNCAq8gIjH +EOLt2x9UeTvCzNR2jpjpdpMq2DWQ+BhXUd4mjSyed8ggnX8WbPS5pOQj MqQxIzhKQOzJiz5RL+TWJz5Q5QQit+3ntVQuIqhyDzB8k5Mvl0h0QGsIY w==; X-IronPort-AV: E=McAfee;i="6400,9594,10427"; a="353563731" X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208,223";a="353563731" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 18:58:02 -0700 X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208,223";a="630953267" 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 18:58:01 -0700 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 testplan to test virtio dequeue Date: Tue, 2 Aug 2022 21:52:23 -0400 Message-Id: <20220803015223.1123105-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.07, virtio support async dequeue for split and packed ring path, so modify loopback_virtio_user_server_mode_cbdma testplan to test the split and packed ring async dequeue feature. Signed-off-by: Wei Ling --- ...irtio_user_server_mode_cbdma_test_plan.rst | 120 +++++++++--------- 1 file changed, 59 insertions(+), 61 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 8e083bfe..83d12db5 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,20 +1,20 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2022 Intel Corporation -============================================================ +=========================================================== 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. Vhost enqueue operation with CBDMA channels is supported -in both split and packed ring. +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. This document provides the test plan for testing the following features when Vhost-user using asynchronous data path with -CBDMA channels in loopback virtio-user topology. +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, @@ -43,24 +43,24 @@ General set up -------------- 1. Compile DPDK:: - # CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib -Dexamples=all --default-library= - # ninja -C -j 110 - For example: - CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib -Dexamples=all --default-library=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:: - # ./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: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 Test case ========= @@ -69,33 +69,32 @@ 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:04.0,0000:00:04.1 -Test Case 1: loopback packed ring all path cbdma test payload check with server mode and multi-queues ------------------------------------------------------------------------------------------------------ +Test Case 1: Loopback packed ring all 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 enqueue operations with CBDMA channels. Both -iova as VA and PA mode test. +all path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. Both iova as VA and PA mode test. 1. Bind 8 CBDMA channel to vfio-pci, as common step 1. 2. Launch vhost by below command:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 \ + # ./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]' \ - --iova=va -- -i --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 \ - --lcore-dma=[lcore11@0000:00:04.0,lcore11@0000:00:04.7,lcore12@0000:00:04.1,lcore12@0000:00:04.2,lcore12@0000:00:04.3,lcore13@0000:00:04.2,lcore13@0000:00:04.3,lcore13@0000:00:04.4,lcore14@0000:00:04.2,lcore14@0000:00:04.3,lcore14@0000:00:04.4,lcore14@0000:00:04.5,lcore15@0000:00:04.0,lcore15@0000:00:04.1,lcore15@0000:00:04.2,lcore15@0000:00:04.3,lcore15@0000:00:04.4,lcore15@0000:00:04.5,lcore15@0000:00:04.6,lcore15@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] 3. Launch virtio-user with packed ring mergeable inorder path:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ + # ./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=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 testpmd>set fwd csum testpmd>start @@ -119,9 +118,9 @@ iova as VA and PA mode test. 8. Quit and relaunch virtio with packed ring mergeable path as below:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ + # ./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=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 testpmd>set fwd csum testpmd>start @@ -129,9 +128,9 @@ iova as VA and PA mode test. 10. Quit and relaunch virtio with packed ring non-mergeable path as below:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ + # ./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 \ - -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 testpmd>set fwd csum testpmd>start @@ -151,9 +150,9 @@ iova as VA and PA mode test. 15. Quit and relaunch virtio with packed ring inorder non-mergeable path as below:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci \ + # ./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 \ - -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 testpmd>set fwd csum testpmd>start @@ -161,9 +160,9 @@ iova as VA and PA mode test. 17. Quit and relaunch virtio with packed ring vectorized path as below:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci --force-max-simd-bitwidth=512 \ + # ./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=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 testpmd>set fwd csum testpmd>start @@ -171,9 +170,9 @@ iova as VA and PA mode test. 19. Quit and relaunch virtio with packed ring vectorized path and ring size is not power of 2 as below:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 30,31 -n 4 --file-prefix=virtio-user0 --no-pci --force-max-simd-bitwidth=512 \ + # ./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=1 --rxq=8 --txq=8 --txd=1025 --rxd=1025 + -- -i --nb-cores=4 --rxq=8 --txq=8 --txd=1025 --rxd=1025 testpmd>set fwd csum testpmd>start @@ -181,26 +180,25 @@ iova as VA and PA mode test. 21. Quit and relaunch vhost w/ iova=pa:: - # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 10-18 -n 4 \ + # ./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]' \ - --iova=pa -- -i --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 \ - --lcore-dma=[lcore11@0000:00:04.0,lcore11@0000:00:04.7,lcore12@0000:00:04.1,lcore12@0000:00:04.2,lcore12@0000:00:04.3,lcore13@0000:00:04.2,lcore13@0000:00:04.3,lcore13@0000:00:04.4,lcore14@0000:00:04.2,lcore14@0000:00:04.3,lcore14@0000:00:04.4,lcore14@0000:00:04.5,lcore15@0000:00:04.0,lcore15@0000:00:04.1,lcore15@0000:00:04.2,lcore15@0000:00:04.3,lcore14@0000:00:04.4,lcore14@0000:00:04.5,lcore15@0000:00:04.6,lcore15@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] 22. Rerun steps 3-6. -Test Case 2: loopback split ring all path cbdma test payload check with server mode and multi-queues ----------------------------------------------------------------------------------------------------- +Test Case 2: Loopback split ring all 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 enqueue operations with CBDMA channels. Both -iova as VA and PA mode test. +all path multi-queues with server mode when vhost uses the asynchronous operations with CBDMA channels. Both iova as VA and PA mode test. 1. Bind 3 CBDMA channel to vfio-pci, as common step 1. 2. Launch vhost 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;txq6]' \ + --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] @@ -285,23 +283,23 @@ iova as VA and PA mode test. 19. Quit and relaunch vhost w/ iova=pa:: # ./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;txq6]' \ + --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] 20. Rerun steps 3-6. -Test Case 3: loopback split ring large chain packets stress test with server mode and cbdma enqueue ---------------------------------------------------------------------------------------------------- +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 enqueue operations with CBDMA channels. Both iova as VA and PA mode test. +when vhost uses the asynchronous operations with CBDMA channels. Both iova as VA and PA mode test. 1. Bind 1 CBDMA channel to vfio-pci, as common step 1. 2. Launch vhost 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,client=1,dmas=[txq0]' --iova=va -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@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] 3. Launch virtio and start testpmd:: @@ -319,21 +317,21 @@ when vhost uses the asynchronous enqueue operations with CBDMA channels. Both io 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]' --iova=pa -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@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 enqueue ----------------------------------------------------------------------------------------------------- +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 enqueue operations with dsa dpdk driver. Both iova as VA and PA mode test. +when vhost uses the asynchronous operations with dsa dpdk driver. Both iova as VA and PA mode test. 1. Bind 1 CBDMA channel to vfio-pci, as common step 1. 2. Launch vhost 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],client=1' --iova=va -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@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] 3. Launch virtio and start testpmd:: From patchwork Wed Aug 3 01:53:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 114555 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 D9618A00C5; Wed, 3 Aug 2022 03:58:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8E3240A84; Wed, 3 Aug 2022 03:58:54 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6406540141 for ; Wed, 3 Aug 2022 03:58:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659491932; x=1691027932; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eCQU5TyoAEpE6h5KWRHbvqyQOi5NI/9iLgmyC+9ORqA=; b=JpzZTw0TgIWtuwcJXhrd1AYJw1QF6UgXITcDEZF0GYoZTR3Jxi4835b+ 2bfmuBKLMaW9xC1r3XO/s/vYPFKnAaDQk5ahXwA1VZcj93g6CyPDadv2K uNWrmgKH21M64uOTp4FC/8xXGPX5IPG63Sboja5iE734gvkkjxfCSu0Oq WFzLIhygMfS86aX5VSAX1px0FxRrsJ0D2g7ZXT0jqD7LcengMJly+7DLM T6HWtfdJOQQ8h5Xtyq2oQ7VyZsM/nVSv8wMn8DXdOqiagnOpNn7xGShMY rjNhorr2gvJeVQ6jdI5n7A2IZWRABiNTqEEnf7BZqYIEiWZw5qB7txIxl A==; X-IronPort-AV: E=McAfee;i="6400,9594,10427"; a="276472202" X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208,223";a="276472202" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 18:58:51 -0700 X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208,223";a="630953413" 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 18:58:49 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V3 2/2] tests/loopback_virtio_user_server_mode_cbdma: modify testsuite to test virtio dequeue Date: Tue, 2 Aug 2022 21:53:12 -0400 Message-Id: <20220803015312.1123175-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.07, virtio support async dequeue for split and packed ring path, so modify loopback_virtio_user_server_mode_cbdma testplan to test the split and packed ring async dequeue feature. Signed-off-by: Wei Ling Acked-by: Xingguang He Tested-by: Chenyu Huang Acked-by: Lijuan Tu --- ..._loopback_virtio_user_server_mode_cbdma.py | 515 +++++------------- 1 file changed, 143 insertions(+), 372 deletions(-) diff --git a/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py index 5b49eaf9..81fae50c 100644 --- a/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py +++ b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py @@ -23,7 +23,7 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) self.core_list = self.dut.get_core_list(config="all", socket=self.ports_socket) self.vhost_core_list = self.core_list[0:9] - self.virtio0_core_list = self.core_list[10:12] + self.virtio0_core_list = self.core_list[10:15] self.path = self.dut.apps_name["test-pmd"] self.testpmd_name = self.path.split("/")[-1] self.app_pdump = self.dut.apps_name["pdump"] @@ -41,8 +41,8 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): """ Run before each test case. """ - self.dut.send_expect("rm -rf ./vhost-net*", "#") self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") + self.dut.send_expect("rm -rf ./vhost-net*", "#") self.table_header = [ "Mode", "Pkt_size", @@ -84,13 +84,19 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): 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("start tx_first 32") + self.vhost_user_pmd.execute_cmd("start tx_first 32", timeout=30) def verify_virtio_user_receive_packets(self): - out = self.virtio_user_pmd.execute_cmd("show port stats all") - self.logger.info(out) - rx_pkts = int(re.search("RX-packets: (\d+)", out).group(1)) - self.verify(rx_pkts > 0, "virtio-user can not received packets") + results = 0.0 + time.sleep(3) + for _ in range(10): + out = self.virtio_user_pmd.execute_cmd("show port stats all") + lines = re.search("Rx-pps:\s*(\d*)", out) + result = lines.group(1) + results += float(result) + Mpps = results / (1000000 * 10) + 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): command = ( @@ -134,7 +140,9 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): fixed_prefix=True, ) - def start_virtio_testpmd_with_vhost_net0(self, cores, eal_param, param): + def start_virtio_testpmd_with_vhost_net0( + self, cores, eal_param, param, set_fwd_csum=True + ): """ launch the testpmd as virtio with vhost_net0 """ @@ -148,7 +156,8 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): prefix="virtio-user0", fixed_prefix=True, ) - self.virtio_user_pmd.execute_cmd("set fwd csum") + if set_fwd_csum: + self.virtio_user_pmd.execute_cmd("set fwd csum") self.virtio_user_pmd.execute_cmd("start") @staticmethod @@ -215,38 +224,47 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.dut.close_session(self.vhost_user) self.dut.close_session(self.virtio_user) - def test_server_mode_packed_ring_all_path_multi_queues_payload_check_with_cbdma( + def test_loopback_packed_ring_all_path_multi_queues_payload_check_with_server_mode_and_cbdma_enable( self, ): """ - Test Case 1: loopback packed ring all path cbdma test payload check with server mode and multi-queues + Test Case 1: Loopback packed ring all path multi-queues payload check with server mode and cbdma enable """ - self.get_cbdma_ports_info_and_bind_to_dpdk(8) - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq6;txq7]'" - core1 = self.vhost_core_list[1] - core2 = self.vhost_core_list[2] - core3 = self.vhost_core_list[3] - core4 = self.vhost_core_list[4] - core5 = self.vhost_core_list[5] - cbdma1 = self.cbdma_list[0] - cbdma2 = self.cbdma_list[1] - cbdma3 = self.cbdma_list[2] - cbdma4 = self.cbdma_list[3] - cbdma5 = self.cbdma_list[4] - cbdma6 = self.cbdma_list[5] - cbdma7 = self.cbdma_list[6] - cbdma8 = self.cbdma_list[7] + 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 = ( - f"[lcore{core1}@{cbdma1},lcore{core1}@{cbdma8}," - f"lcore{core2}@{cbdma2},lcore{core2}@{cbdma3},lcore{core2}@{cbdma4}," - f"lcore{core3}@{cbdma3},lcore{core3}@{cbdma4},lcore{core3}@{cbdma5}," - f"lcore{core4}@{cbdma3},lcore{core4}@{cbdma4},lcore{core4}@{cbdma5},lcore{core4}@{cbdma6}," - f"lcore{core5}@{cbdma1},lcore{core5}@{cbdma2},lcore{core5}@{cbdma3},lcore{core5}@{cbdma4},lcore{core5}@{cbdma5},lcore{core5}@{cbdma6},lcore{core5}@{cbdma7},lcore{core5}@{cbdma8}]" + "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.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], + ) ) vhost_param = ( - " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024" - + " --lcore-dma={}".format(lcore_dma) + " --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, @@ -256,8 +274,7 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ) 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=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" - self.logger.info("Launch virtio with packed ring mergeable inorder path") + 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 ) @@ -266,7 +283,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch vhost and rerun step 4-6") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -279,10 +295,9 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch virtio with packed ring mergeable path") 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=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 ) @@ -290,7 +305,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch vhost and rerun step 4-6") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -303,10 +317,9 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch virtio with packed ring non-mergeable path") 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_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 ) @@ -314,7 +327,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost and rerun step 10-12") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -327,12 +339,9 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info( - "Quit and relaunch virtio with packed ring inorder non-mergeable path" - ) 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_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 ) @@ -340,7 +349,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost and rerun step 10-12") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -353,12 +361,31 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info( - "Quit and relaunch virtio with packed ring vectorized path and ring size is not power of 2 " + 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_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.send_960_packets_from_vhost() + 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) + 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_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1025 --rxd=1025" + 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 ) @@ -366,7 +393,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost and rerun step 10-12") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -379,14 +405,13 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost w/ iova=pa, Rerun steps 2-19") 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]'" + 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=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024" - + " --lcore-dma={}".format(lcore_dma) + " --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, @@ -397,7 +422,7 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ) 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=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + 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, @@ -409,156 +434,47 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch vhost and rerun step 4-6") - 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.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.logger.info("Quit and relaunch virtio with packed ring mergeable path") - 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=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, - ) - self.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.logger.info("Quit and relaunch vhost and rerun step 4-6") - 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.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.logger.info( - "Quit and relaunch virtio with packed ring non-mergeable path" - ) - 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_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, - ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info("Quit and relaunch vhost and rerun step 10-12") - 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.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info( - "Quit and relaunch virtio with packed ring inorder non-mergeable path" - ) - 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_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, - ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info("Quit and relaunch vhost and rerun step 10-12") - 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.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info( - "Quit and relaunch virtio with packed ring vectorized path and ring size is not power of 2 " - ) - 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_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, - ) - self.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info("Quit and relaunch vhost and rerun step 10-12") - 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.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - def test_server_mode_split_ring_all_path_multi_queues_payload_check_with_cbdma( + def test_loopback_split_ring_all_path_multi_queues_payload_check_with_server_mode_and_cbdma_enable( self, ): """ - Test Case 2: loopback split ring all path cbdma test payload check with server mode and multi-queues + 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(3) - vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;txq6]'" - core1 = self.vhost_core_list[1] - core2 = self.vhost_core_list[2] - core3 = self.vhost_core_list[3] - core4 = self.vhost_core_list[4] - core5 = self.vhost_core_list[5] - cbdma1 = self.cbdma_list[0] - cbdma2 = self.cbdma_list[1] - cbdma3 = self.cbdma_list[2] + 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 = ( - f"[lcore{core1}@{cbdma1}," - f"lcore{core2}@{cbdma1}," - f"lcore{core3}@{cbdma2},lcore{core3}@{cbdma3}," - f"lcore{core4}@{cbdma2},lcore{core4}@{cbdma3}," - f"lcore{core5}@{cbdma2},lcore{core5}@{cbdma3}]" + "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.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], + ) ) vhost_param = ( - " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024" - + " --lcore-dma={}".format(lcore_dma) + " --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, @@ -569,15 +485,14 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): 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.logger.info("Launch virtio with split 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) - self.logger.info("Quit and relaunch vhost and rerun step 4-6") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -590,7 +505,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch virtio with split ring mergeable path") 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" @@ -601,7 +515,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch vhost and rerun step 4-6") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -614,11 +527,10 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info("Quit and relaunch virtio with split ring non-mergeable path") 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" + "--enable-hw-vlan-strip --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 @@ -627,7 +539,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost and rerun step 11-12") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -640,9 +551,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info( - "Quit and relaunch virtio with split ring inorder non-mergeable path" - ) 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" @@ -653,7 +561,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost and rerun step 11-12") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -666,7 +573,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch virtio with split ring vectorized path") 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" @@ -677,7 +583,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost and rerun step 11-12") self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -690,14 +595,13 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_960_packets_from_vhost() self.check_packet_payload_valid(pkt_len=960) - self.logger.info("Quit and relaunch vhost w/ iova=pa, Rerun steps 2-19") 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;txq6]'" + 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={}".format(lcore_dma) + " --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, @@ -708,153 +612,30 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): ) 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.logger.info("Launch virtio with split 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) - - self.logger.info("Quit and relaunch vhost and rerun step 4-6") - 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.launch_pdump_to_capture_pkt() - self.send_6192_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=6192) - - self.logger.info("Quit and relaunch virtio with split ring mergeable path") - 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.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) - self.logger.info("Quit and relaunch vhost and rerun step 4-6") - 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.launch_pdump_to_capture_pkt() self.send_6192_packets_from_vhost() self.check_packet_payload_valid(pkt_len=6192) - self.logger.info( - "Quit and relaunch virtio with split ring non-mergeable path" - ) - 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" - 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_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info("Quit and relaunch vhost and rerun step 11-12") - 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.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info( - "Quit and relaunch virtio with split ring inorder non-mergeable path" - ) - 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" - 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_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info("Quit and relaunch vhost and rerun step 11-12") - 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.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info("Quit and relaunch virtio with split ring vectorized path") - 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" - 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_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - self.logger.info("Quit and relaunch vhost and rerun step 11-12") - 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.launch_pdump_to_capture_pkt() - self.send_960_packets_from_vhost() - self.check_packet_payload_valid(pkt_len=960) - - def test_server_mode_split_ring_large_chain_packets_stress_test_with_cbdma(self): + def test_loopback_split_ring_large_chain_packets_stress_test_with_server_mode_and_cbdma_enable( + self, + ): """ - Test Case 3: loopback split ring large chain packets stress test with server mode and cbdma enqueue + Test Case 3: 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(1) - vhost_eal_param = ( - "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0]'" - ) - core1 = self.vhost_core_list[1] - cbdma1 = self.cbdma_list[0] - lcore_dma = f"[lcore{core1}@{cbdma1}]" - vhost_param = " --nb-cores=1 --mbuf-size=65535" + " --lcore-dma={}".format( - lcore_dma - ) + 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 self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -865,19 +646,16 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): 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.logger.info("Launch virtio with split ring vectorized path") self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param, + set_fwd_csum=False, ) self.send_chain_packets_from_vhost() self.verify_virtio_user_receive_packets() - self.logger.info( - "Stop and quit vhost testpmd and relaunch vhost with iova=pa" - ) self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -889,21 +667,18 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): self.send_chain_packets_from_vhost() self.verify_virtio_user_receive_packets() - def test_server_mode_packed_ring_large_chain_packets_stress_test_with_cbdma(self): + def test_loopback_packed_ring_large_chain_packets_stress_test_with_server_mode_and_cbdma_enable( + self, + ): """ - Test Case 4: loopback split packed large chain packets stress test with server mode and cbdma enqueue + Test Case 4: 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(1) - vhost_eal_param = ( - "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0]'" - ) - core1 = self.vhost_core_list[1] - cbdma1 = self.cbdma_list[0] - lcore_dma = f"[lcore{core1}@{cbdma1}]" - vhost_param = " --nb-cores=1 --mbuf-size=65535" + " --lcore-dma={}".format( - lcore_dma - ) + 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 self.start_vhost_testpmd( cores=self.vhost_core_list, eal_param=vhost_eal_param, @@ -912,21 +687,18 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): iova_mode="va", ) - virtio_eal_param = "--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" + 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.logger.info("Launch virtio with split ring vectorized path") self.start_virtio_testpmd_with_vhost_net0( cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param, + set_fwd_csum=False, ) self.send_chain_packets_from_vhost() self.verify_virtio_user_receive_packets() - self.logger.info( - "Stop and quit vhost testpmd and relaunch vhost with iova=pa" - ) self.vhost_user_pmd.quit() self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -942,9 +714,8 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase): """ Run after each test case. """ - self.virtio_user_pmd.quit() - self.vhost_user_pmd.quit() self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") + self.dut.kill_all() self.bind_cbdma_device_to_kernel() def tear_down_all(self):