From patchwork Fri Apr 29 08:12:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 110508 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 1ADBBA034C; Fri, 29 Apr 2022 10:13:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14AEC42819; Fri, 29 Apr 2022 10:13:16 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 5F890410E3 for ; Fri, 29 Apr 2022 10:13:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651219994; x=1682755994; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=51VBDtGTvMYNusqij9emq4Ni0QS0kyVnuO4x5ImJgog=; b=SAWoMfwTMwpNXuDkhrPOvDuBigiVAdEVsvZE1vU/TMLSVT9vyMTzxJAZ K140owc4e91IWA69zg0xsa5E/Xnmp1vNeg5aIq+HlZU7ETS6dYI9ceUWL kgqhW01/jVoR7K0uOlgkoOyVkFAJtrN+8ZG8cWlN8QwbPinQjYrZXic/W ADYDou8NEF8wYqdVyz1eUsOlUhcYqD2V4vqgIxJ0GgVL7kI5xyFHuqPf6 tQ0b0xwRP9ixGzTCIootT+rPY8LI/TJSdeVMS0S02c7PjGzK8hj3NU3xL kbqrqqZLQCzrwGFqWskqVG14MyGFSvYp3yIRGKEPOG+ph0jUaxi036iql w==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="291741005" X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="291741005" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 01:13:13 -0700 X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="514714464" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 01:13:12 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 1/3] test_plans/index: add loopback_virtio_user_server_mode_cbdma Date: Fri, 29 Apr 2022 08:12:57 +0000 Message-Id: <20220429081257.21765-1-weix.ling@intel.com> X-Mailer: git-send-email 2.34.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 v1: As commit 53d3f4778c(vhost: integrate dmadev in asynchronous data-path), add new testsuite loopback_virtio_user_server_mode_cbdma for coverage the loopback virtio-user server mode with cbdma. 1) Add new loopback_virtio_user_server_mode_cbdma_test_plan into test_plans/index.rst. Signed-off-by: Wei Ling --- test_plans/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/test_plans/index.rst b/test_plans/index.rst index f8118d14..a6a396c7 100644 --- a/test_plans/index.rst +++ b/test_plans/index.rst @@ -121,6 +121,7 @@ The following are the test plans for the DPDK DTS automated test system. linux_modules_test_plan loopback_multi_paths_port_restart_test_plan loopback_virtio_user_server_mode_test_plan + loopback_virtio_user_server_mode_cbdma_test_plan mac_filter_test_plan macsec_for_ixgbe_test_plan metering_and_policing_test_plan From patchwork Fri Apr 29 08:13:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 110509 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 545FCA034C; Fri, 29 Apr 2022 10:13:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4ACBC4161A; Fri, 29 Apr 2022 10:13:30 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 12722410E3 for ; Fri, 29 Apr 2022 10:13:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651220008; x=1682756008; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=j2zqcpiuav7mhIISSKqRat2bR96zDHgaGO5Lp+9e/gI=; b=C9o83xwia4D+snNn+OTYFeCe6R0/i6pWa+fYYDUnPLOvzWMbavNCpTmr Ysk7EdcXBKI5s/y8VYEkTUcyLycLuOkXaFcZMXbWHsch/5w5WyzMJ/bZ4 0AhWiPwKlwCJpZp5z4GpF9JCOM2L0jYAQtxLmlkSKrsGZOa+DhMCfTN/3 JbTlKEkhxNNHeXVai+r4HwXQsYw7SqPyKlEJS/df9RCznrJ40up7AKSC5 7M74gwyYLF3IGRchBrYE0FMSqYEvNj7gwffxai1OlPzSd6IQabbHBW58a zo8z0r/n68orAWxjmmrUB94INIJYSmYQq6vEHBuBnh4LOaUyhdKnNtTKL Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="291741033" X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="291741033" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 01:13:26 -0700 X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="731951138" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 01:13:24 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 2/3] test_plans/loopback_virtio_user_server_mode_cbdma_test_plan: add add loopback_virtio_user_server_mode_cbdma testplan Date: Fri, 29 Apr 2022 08:13:10 +0000 Message-Id: <20220429081310.21791-1-weix.ling@intel.com> X-Mailer: git-send-email 2.34.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 v1: As commit 53d3f4778c(vhost: integrate dmadev in asynchronous data-path), add new testsuite loopback_virtio_user_server_mode_cbdma for coverage the loopback virtio-user server mode with cbdma. 1) Add new testplan loopback_virtio_user_server_mode_cbdma_test_plan into test_plans. v2: Modify the `Description` content in test_plan. Signed-off-by: Wei Ling --- ...irtio_user_server_mode_cbdma_test_plan.rst | 385 ++++++++++++++++++ 1 file changed, 385 insertions(+) create mode 100644 test_plans/loopback_virtio_user_server_mode_cbdma_test_plan.rst 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 new file mode 100644 index 00000000..97ab202a --- /dev/null +++ b/test_plans/loopback_virtio_user_server_mode_cbdma_test_plan.rst @@ -0,0 +1,385 @@ +.. Copyright (c) <2022>, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOgit T LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +============================================================ +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. + +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. +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. + +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 +============= + +Topology +-------- +Test flow: Virtio-user-->Vhost-user-->Testpmd-->Vhost-user-->Virtio-user + +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 + +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 + + 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 + +Test case +========= + +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 + + 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 +----------------------------------------------------------------------------------------------------- +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. + +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 \ + -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] + +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 \ + --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 + 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_user1,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user1,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:: + + testpmd> set fwd csum + testpmd> set txpkts 64,64,64,2000,2000,2000 + testpmd> set burst 1 + testpmd> start tx_first 1 + 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. + +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 \ + --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 + testpmd>set fwd csum + testpmd>start + +9. Rerun steps 4-7. + +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 \ + --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 + testpmd>set fwd csum + testpmd>start + +11. Rerun step 4. + +12. Send pkts from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd csum + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 + 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. + +14. Quit and relaunch vhost and rerun step 11-13. + +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 \ + --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 + testpmd>set fwd csum + testpmd>start + +16. Rerun step 11-14. + +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 \ + --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 + testpmd>set fwd csum + testpmd>start + +18. Rerun step 11-14. + +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 \ + --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 + testpmd>set fwd csum + testpmd>start + +20. Rerun step 11-14. + +21. 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 -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] + +22. Rerun steps 3-6. + +Test Case 2: loopback split ring all path cbdma test payload check with server mode and multi-queues +---------------------------------------------------------------------------------------------------- +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. + +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]' \ + --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] + +3. Launch virtio-user with split ring mergeable inorder 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_user1,queue=0,rx-dev=./pdump-virtio-rx-q0.pcap,mbuf-size=8000' \ + --pdump 'device_id=net_virtio_user1,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:: + + testpmd> set fwd csum + testpmd> set txpkts 64,64,64,2000,2000,2000 + testpmd> set burst 1 + testpmd> start tx_first 1 + 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. + +8. Quit and relaunch virtio with split ring mergeable path as below:: + + # ./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 \ + -- -i --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024 + testpmd>set fwd csum + testpmd>start + +9. Rerun steps 4-7. + +10. Quit and relaunch virtio with split 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 \ + --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 + +11. Rerun step 4. + +12. Send pkts from vhost, check loopback performance can get expected and each queue can receive packets:: + + testpmd> set fwd csum + testpmd> set txpkts 64,128,256,512 + testpmd> set burst 1 + testpmd> start tx_first 1 + 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. + +14. Quit and relaunch vhost and rerun step 11-13. + +15. Quit and relaunch virtio with split 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 \ + --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 + +16. Rerun step 11-14. + +17. Quit and relaunch virtio with split ring vectorized path as below:: + + # ./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 + +18. Rerun step 11-14. + +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]' \ + --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 +--------------------------------------------------------------------------------------------------- +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. + +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] + +3. Launch virtio 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 + +4. Send large packets from vhost, check virtio can receive packets:: + + testpmd> set txpkts 65535,65535,65535,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]' --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 +---------------------------------------------------------------------------------------------------- +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. + +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] + +3. Launch virtio 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 + +4. Send large packets from vhost, check virtio can receive packets:: + + testpmd> set txpkts 65535,65535,65535,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,dmas=[txq0],client=1' --iova=pa -- -i --nb-cores=1 --mbuf-size=65535 --lcore-dma=[lcore3@0000:00:04.0] + +6. Rerun steps 4. From patchwork Fri Apr 29 08:13:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 110510 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 9071AA034C; Fri, 29 Apr 2022 10:13:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87157415D7; Fri, 29 Apr 2022 10:13:46 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 1FE51410E3 for ; Fri, 29 Apr 2022 10:13:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651220024; x=1682756024; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sww7W2VHbervm2LSPDXMrY80ECgApf0heclRn2/xAEc=; b=CxWTQfmmPaqvf2rKEK296qa0oOTOvXRIh4nXfgQIvmLKjS03bCnWqlSo FaAnGCVQ6PuthRoJRaE3PwqOI1lLEBopphANRwYmBAwEwLzH2/DS+84gc Lct2tUad3GQU7NSHYwkYAiwtfMtnzW88jUsbsV0M9eG9WUuIYd+vm0er5 P/88rTzdlC5j/5e/fMgLRjd/0upkLVZFrY5p0P0v4btNrgye11zK03844 tyqm1hNlvOjHxwgpArlFjbCbLo/abOVpNPB/t/MpuDcX2TH26DzNf78yA wlArkQoMFusin+rtqhDpazaLcgmEkgZmhc3t1JwbIb52KYi5gN1k8MAwO Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="265419915" X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="265419915" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 01:13:39 -0700 X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="731951190" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 01:13:37 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 3/3] tests/loopback_virtio_user_server_mode_cbdma: add loopback_virtio_user_server_mode_cbdma testsuite Date: Fri, 29 Apr 2022 08:13:21 +0000 Message-Id: <20220429081321.21817-1-weix.ling@intel.com> X-Mailer: git-send-email 2.34.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 As commit 53d3f4778c(vhost: integrate dmadev in asynchronous data-path), add new testsuite loopback_virtio_user_server_mode_cbdma for coverage the loopback virtio-user server mode with cbdma. 1) Add new testsuite TestSuite_loopback_virtio_user_server_mode_cbdma.py into tests. Signed-off-by: Wei Ling Tested-by: Chenyu Huang --- ..._loopback_virtio_user_server_mode_cbdma.py | 983 ++++++++++++++++++ 1 file changed, 983 insertions(+) create mode 100644 tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py diff --git a/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py new file mode 100644 index 00000000..93e8575c --- /dev/null +++ b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py @@ -0,0 +1,983 @@ +# +# BSD LICENSE +# +# Copyright(c) <2022> Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +""" +DPDK Test suite. +Test loopback virtio-user server mode +""" +import re +import time + +from framework.packet import Packet +from framework.pmd_output import PmdOutput +from framework.test_case import TestCase + + +class TestLoopbackVirtioUserServerModeCbama(TestCase): + def set_up_all(self): + """ + Run at the start of each test suite. + """ + self.dut_ports = self.dut.get_ports() + 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.path = self.dut.apps_name["test-pmd"] + self.testpmd_name = self.path.split("/")[-1] + self.app_pdump = self.dut.apps_name["pdump"] + self.dump_pcap_q0 = "/root/pdump-rx-q0.pcap" + self.dump_pcap_q1 = "/root/pdump-rx-q1.pcap" + self.device_str = None + self.cbdma_dev_infos = [] + self.vhost_user = self.dut.new_session(suite="vhost_user") + self.virtio_user = self.dut.new_session(suite="virtio-user") + self.pdump_session = self.dut.new_session(suite="pdump") + self.vhost_user_pmd = PmdOutput(self.dut, self.vhost_user) + self.virtio_user_pmd = PmdOutput(self.dut, self.virtio_user) + + def set_up(self): + """ + 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.table_header = [ + "Mode", + "Pkt_size", + "Throughput(Mpps)", + "Queue Number", + "Cycle", + ] + self.result_table_create(self.table_header) + + @property + def check_2M_env(self): + out = self.dut.send_expect( + "cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'", "# " + ) + 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("start tx_first 32") + + 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") + + def launch_pdump_to_capture_pkt(self, capture_all_queue=True): + command = ( + self.app_pdump + + " " + + "-v --file-prefix=virtio-user0 -- " + + "--pdump 'device_id=net_virtio_user0,queue=0,rx-dev=%s,mbuf-size=8000' " + + "--pdump 'device_id=net_virtio_user0,queue=1,rx-dev=%s,mbuf-size=8000'" + ) + self.pdump_session.send_expect( + command % (self.dump_pcap_q0, self.dump_pcap_q1), "Port" + ) + + def check_packet_payload_valid(self, pkt_len): + 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) + 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, + ) + + def start_vhost_testpmd(self, cores, eal_param, param, ports, iova_mode="va"): + eal_param += " --iova=" + iova_mode + self.vhost_user_pmd.start_testpmd( + cores=cores, + eal_param=eal_param, + param=param, + ports=ports, + prefix="vhost", + fixed_prefix=True, + ) + + def start_virtio_testpmd_with_vhost_net0(self, cores, eal_param, param): + """ + launch the testpmd as virtio with vhost_net0 + """ + if self.check_2M_env: + eal_param += " --single-file-segments" + self.virtio_user_pmd.start_testpmd( + cores=cores, + eal_param=eal_param, + param=param, + no_pci=True, + prefix="virtio-user0", + fixed_prefix=True, + ) + self.virtio_user_pmd.execute_cmd("set fwd csum") + self.virtio_user_pmd.execute_cmd("start") + + @staticmethod + def generate_dms_param(queues): + das_list = [] + for i in range(queues): + das_list.append("txq{}".format(i)) + das_param = "[{}]".format(";".join(das_list)) + return das_param + + def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num, allow_diff_socket=False): + """ + get and bind cbdma ports into DPDK driver + """ + self.all_cbdma_list = [] + self.cbdma_list = [] + self.cbdma_str = "" + out = self.dut.send_expect( + "./usertools/dpdk-devbind.py --status-dev dma", "# ", 30 + ) + device_info = out.split("\n") + for device in device_info: + pci_info = re.search("\s*(0000:\S*:\d*.\d*)", device) + if pci_info is not None: + dev_info = pci_info.group(1) + # the numa id of ioat dev, only add the device which on same socket with nic dev + bus = int(dev_info[5:7], base=16) + if bus >= 128: + cur_socket = 1 + else: + cur_socket = 0 + if allow_diff_socket: + self.all_cbdma_list.append(pci_info.group(1)) + else: + if self.ports_socket == cur_socket: + self.all_cbdma_list.append(pci_info.group(1)) + self.verify( + len(self.all_cbdma_list) >= cbdma_num, "There no enough cbdma device" + ) + self.cbdma_list = self.all_cbdma_list[0:cbdma_num] + self.cbdma_str = " ".join(self.cbdma_list) + self.dut.send_expect( + "./usertools/dpdk-devbind.py --force --bind=%s %s" + % (self.drivername, self.cbdma_str), + "# ", + 60, + ) + + def bind_cbdma_device_to_kernel(self): + self.dut.send_expect("modprobe ioatdma", "# ") + self.dut.send_expect( + "./usertools/dpdk-devbind.py -u %s" % self.cbdma_str, "# ", 30 + ) + self.dut.send_expect( + "./usertools/dpdk-devbind.py --force --bind=ioatdma %s" % self.cbdma_str, + "# ", + 60, + ) + + def close_all_session(self): + """ + close session of vhost-user and virtio-user + """ + 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( + self, + ): + """ + Test Case 1: loopback packed ring all path cbdma test payload check with server mode and multi-queues + """ + 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] + 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}]" + ) + vhost_param = ( + " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + + " --lcore-dma={}".format(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="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=1 --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="va", + ) + 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="va", + ) + 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="va", + ) + 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="va", + ) + 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="va", + ) + 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 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_param = ( + " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + + " --lcore-dma={}".format(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=1 --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 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( + self, + ): + """ + Test Case 2: loopback split ring all path cbdma test payload check with server mode and multi-queues + """ + 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] + 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}]" + ) + vhost_param = ( + " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + + " --lcore-dma={}".format(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="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.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="va", + ) + 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" + 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="va", + ) + 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="va", + ) + 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="va", + ) + 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="va", + ) + 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 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_param = ( + " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + + " --lcore-dma={}".format(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=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" + 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): + """ + Test Case 3: loopback split ring large chain packets stress test with server mode and cbdma enqueue + """ + 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.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=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, + ) + + 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, + 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_server_mode_packed_ring_large_chain_packets_stress_test_with_cbdma(self): + """ + Test Case 4: loopback split packed large chain packets stress test with server mode and cbdma enqueue + """ + 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.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=1,mrg_rxbuf=1,in_order=0,vectorized=1,packed_vq=1,queue_size=2048,server=1" + 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, + ) + + 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, + 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 tear_down(self): + """ + 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.bind_cbdma_device_to_kernel() + + def tear_down_all(self): + """ + Run after each test suite. + """ + self.close_all_session()