From patchwork Wed Jan 26 09:21:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 106571 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 925A2A04A8; Wed, 26 Jan 2022 10:21:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85B8D4270B; Wed, 26 Jan 2022 10:21:52 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id E73A94069D for ; Wed, 26 Jan 2022 10:21:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643188911; x=1674724911; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Mv9Un1eEvIqDb6FDcPxtEnd7I0er5mCAfL9vljzvAmw=; b=B2bxp1rv/gC7VlFowbu/vmD6a75lgPLNh1O6HAdaOAxCgoTGLycWIzrE dyyvyErpWsnyTL8u7SS22do6ICvfTZPk9wDY2oenHf3cBU5YdQA+qJO7E vm0jtAwYLwMCdVeBrMbDoLBFr8Ct81XPKuuN9Ny3X80ejIlpDUNLaxvoG JUR0/+1cZjQjG7AHR0WLqcaJHmkMzI2wp/mcyPNrixM++SWSzKQq9B7cG COaU38K2v5FPTkOIdhVBntuk4j8E3bYvF5b6lCTK1YHfojwDV1+/5UzpB G5Bwk6hFXCll+hWqX+HoKUkiL7pvwK1AX5JZA5DnbyCNm7HuhHQ8YX3N+ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="307228191" X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="307228191" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:21:49 -0800 X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="674305691" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:21:30 -0800 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V4 1/3] conf/vhost_cbdma: modify config sync with test plan change Date: Wed, 26 Jan 2022 17:21:26 +0800 Message-Id: <20220126092126.916317-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 Modify config sync with test plan change. Signed-off-by: Wei Ling --- conf/vhost_cbdma.cfg | 62 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/conf/vhost_cbdma.cfg b/conf/vhost_cbdma.cfg index 66981031..a22fa32c 100644 --- a/conf/vhost_cbdma.cfg +++ b/conf/vhost_cbdma.cfg @@ -1,6 +1,62 @@ [suite] update_expected = True -test_parameters = {64: [1024], 1518: [1024]} -test_duration = 60 +test_parameters = {'imix': [1024],} +test_duration = 20 accepted_tolerance = 2 -expected_throughput = {'test_perf_dynamic_queue_number_cbdma_vhost_enqueue_operations': {'dynamic_queue2': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'virtio_user_dynamic_queue2_change_to_1': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'Relaunch_dynamic_queue2': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'vhost_userRelaunch_dynamic_queue2_change_to_1': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'Relaunch_vhost_2_cbdma': {64: {1024: 0.00}, 1518: {1024: 0.00}}}, 'test_perf_pvp_spilt_all_path_with_cbdma_vhost_enqueue_operations': {'inorder_mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'inorder_mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'inorder_non_mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'inorder_non_mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'non_mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'non_mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'vector_rx_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'vector_rx_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}},'test_perf_packed_dynamic_queue_number_cbdma_vhost_enqueue_operations': {'dynamic_queue2': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'virtio_user_dynamic_queue2_change_to_1': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'Relaunch_dynamic_queue2': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'vhost_userRelaunch_dynamic_queue2_change_to_1': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'Relaunch_vhost_2_cbdma': {64: {1024: 0.00}, 1518: {1024: 0.00}}},'test_perf_pvp_packed_all_path_with_cbdma_vhost_enqueue_operations': {'inorder_mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'inorder_mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'inorder_non_mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'inorder_non_mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'non_mergeable_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'non_mergeable_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'vector_rx_path': {64: {1024: 0.00}, 1518: {1024: 0.00}}, 'vector_rx_path_RestartVhost': {64: {1024: 0.00}, 1518: {1024: 0.00}}},} +expected_throughput = { + 'test_perf_pvp_spilt_ring_all_path_vhost_enqueue_operations_with_cbdma':{ + 'inorder_mergeable_path_VA': {'imix': {1024: 0.0},}, + 'inorder_mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_VA': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'mergeable_path_VA': {'imix': {1024: 0.0},}, + 'mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'non_mergeable_path_VA': {'imix': {1024: 0.0},}, + 'non_mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'vector_rx_path_VA': {'imix': {1024: 0.0},}, + 'vector_rx_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'inorder_mergeable_path_PA': {'imix': {1024: 0.0},}, + 'inorder_mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_PA': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'mergeable_path_PA': {'imix': {1024: 0.0},}, + 'mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'non_mergeable_path_PA': {'imix': {1024: 0.0},}, + 'non_mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'vector_rx_path_PA': {'imix': {1024: 0.0},}, + 'vector_rx_path_PA_RestartVhost': {'imix': {1024: 0.0},}}, + 'test_perf_pvp_spilt_ring_all_dynamic_queue_number_vhost_enqueue_operations_with_cbdma':{ + 'with_0_cbdma': {'imix': {1024: 0.0},}, + 'with_4_cbdma': {'imix': {1024: 0.0},}, + 'with_8_cbdma': {'imix': {1024: 0.0},}, + 'with_6_cbdma': {'imix': {1024: 0.0},}}, + 'test_perf_pvp_packed_ring_all_path_vhost_enqueue_operations_with_cbdma':{ + 'inorder_mergeable_path_VA': {'imix': {1024: 0.0},}, + 'inorder_mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_VA': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'mergeable_path_VA': {'imix': {1024: 0.0},}, + 'mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'non_mergeable_path_VA': {'imix': {1024: 0.0},}, + 'non_mergeable_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'vector_rx_path_VA': {'imix': {1024: 0.0},}, + 'vector_rx_path_VA_RestartVhost': {'imix': {1024: 0.0},}, + 'vector_rx_path_not_power_of_2_VA':{'imix': {1024: 0.0},}, + 'vector_rx_path_not_power_of_2_VA_RestartVhost':{'imix': {1024: 0.0},}, + 'inorder_mergeable_path_PA': {'imix': {1024: 0.0},}, + 'inorder_mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_PA': {'imix': {1024: 0.0},}, + 'inorder_non_mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'mergeable_path_PA': {'imix': {1024: 0.0},}, + 'mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'non_mergeable_path_PA': {'imix': {1024: 0.0},}, + 'non_mergeable_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'vector_rx_path_PA': {'imix': {1024: 0.0},}, + 'vector_rx_path_PA_RestartVhost': {'imix': {1024: 0.0},}, + 'vector_rx_path_not_power_of_2_PA':{'imix': {1024: 0.0},}, + 'vector_rx_path_not_power_of_2_PA_RestartVhost':{'imix': {1024: 0.0},}}, + 'test_perf_pvp_packed_ring_all_dynamic_queue_number_vhost_enqueue_operations_with_cbdma':{ + 'with_0_cbdma': {'imix': {1024: 0.0},}, + 'with_4_cbdma': {'imix': {1024: 0.0},}, + 'with_8_cbdma': {'imix': {1024: 0.0},}, + 'with_6_cbdma': {'imix': {1024: 0.0},}},} \ No newline at end of file From patchwork Wed Jan 26 09:21:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 106572 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 B860AA04A9; Wed, 26 Jan 2022 10:21:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B07214270A; Wed, 26 Jan 2022 10:21:53 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 5A8764069D for ; Wed, 26 Jan 2022 10:21:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643188912; x=1674724912; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YGoqvG5+r2kDGkZi30n9qGASy9zkHO/dDR9Qr4uvP4g=; b=nCxk46v0Old92qlXE+h2nBH+7287ltYSJlZkaxb/5hNp0NDFmj0Vuw+S H1YMwc7IHLjUyHgjng1nxW2N6vcxqnyICBdMXUcdwjdLQnnHQqUxUrAa3 4T7eYIEwhFV4Q9PweTg9fn9GVSRFvsew9oBiZ0lQWakyHI4QjScwFJPH1 c73gaPO6OO4jWh+YOXpPqxYkfkVTH2y6+Z9eHsQI+jZG4iEwrM6vIl4Yo Xd8k+/+mUrEk1378jYFeuasmuHZ4kSgzXjZpksWoIjumxOxCQFv9Tu/lu C80eImIXYfzZHG0dwyImbiuqz6xNGTQuBqNI9Lb3dqscRZrBQgQ3HqFXx A==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="307228194" X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="307228194" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:21:50 -0800 X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="674305699" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:21:45 -0800 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V4 2/3] test_plans/vhost_cbdma: modify test plan to coverage more test point Date: Wed, 26 Jan 2022 17:21:41 +0800 Message-Id: <20220126092141.916424-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 Modify test plan to coverage more test point. Fix test plan make html format issue. Signed-off-by: Wei Ling --- v1:Add more test point. v2:Fix test plan WARNING. test_plans/vhost_cbdma_test_plan.rst | 365 ++++++++++++++++----------- 1 file changed, 211 insertions(+), 154 deletions(-) diff --git a/test_plans/vhost_cbdma_test_plan.rst b/test_plans/vhost_cbdma_test_plan.rst index 3d0e518a..c8f8b8c5 100644 --- a/test_plans/vhost_cbdma_test_plan.rst +++ b/test_plans/vhost_cbdma_test_plan.rst @@ -1,34 +1,34 @@ .. Copyright (c) <2021>, 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 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. + 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. ========================================================== DMA-accelerated Tx operations for vhost-user PMD test plan @@ -38,41 +38,42 @@ Overview -------- This feature supports to offload large data movement in vhost enqueue operations -from the CPU to the I/OAT device for every queue. Note that I/OAT acceleration -is just enabled for split rings now. In addition, a queue can only use one I/OAT -device, and I/OAT devices cannot be shared among vhost ports and queues. That is, -an I/OAT device can only be used by one queue at a time. DMA devices used by -queues are assigned by users; for a queue without assigning a DMA device, the -PMD will leverages librte_vhost to perform vhost enqueue operations. Moreover, -users cannot enable I/OAT acceleration for live-migration. Large copies are -offloaded from the CPU to the DMA engine in an asynchronous manner. The CPU just -submits copy jobs to the DMA engine and without waiting for DMA copy completion; +from the CPU to the I/OAT(a DMA engine in Intel's processor) device for every queue. +In addition, a queue can only use one I/OAT device, and I/OAT devices cannot be shared +among vhost ports and queues. That is, an I/OAT device can only be used by one queue at +a time. DMA devices(e.g.,CBDMA) used by queues are assigned by users; for a queue without +assigning a DMA device, the PMD will leverages librte_vhost to perform vhost enqueue +operations. Moreover, users cannot enable I/OAT acceleration for live-migration. Large +copies are offloaded from the CPU to the DMA engine in an asynchronous manner. The CPU +just submits copy jobs to the DMA engine and without waiting for DMA copy completion; there is no CPU intervention during DMA data transfer. By overlapping CPU computation and DMA copy, we can save precious CPU cycles and improve the overall throughput for vhost-user PMD based applications, like OVS. Due to startup overheads associated with DMA engines, small copies are performed by the CPU. +DPDK 21.11 adds vfio support for DMA device in vhost. 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. -We introduce a new vdev parameter to enable DMA acceleration for Tx -operations of queues: - - - dmas: This parameter is used to specify the assigned DMA device of - a queue. +We introduce a new vdev parameter to enable DMA acceleration for Tx operations of queues: +- dmas: This parameter is used to specify the assigned DMA device of a queue. Here is an example: - $ ./dpdk-testpmd -c f -n 4 \ - --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@80:04.0]' +./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c f -n 4 \ +--vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@0000:00:04.0] \ +--iova=va -- -i' -Test Case 1: PVP Split all path with DMA-accelerated vhost enqueue -================================================================== +Test Case 1: PVP split ring all path vhost enqueue operations with cbdma +======================================================================== -Packet pipeline: +Packet pipeline: ================ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG -1. Bind one cbdma port and one nic port to vfio-pci, then launch vhost by below command:: +1. Bind 1 CBDMA port and 1 NIC port to vfio-pci, then launch vhost by below command:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@80:04.0]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@0000:00:04.0]' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start @@ -80,11 +81,11 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=1,queues=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start -3. Send imix packets [64,1518] from packet generator, check the throughput can get expected data, restart vhost port, then check throughput again:: +3. Send imix packets [64,1518] from packet generator, check the throughput can get expected data, restart vhost port and send imix pkts again, check get same throuhput:: testpmd>show port stats all testpmd>stop @@ -95,7 +96,7 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=0,queues=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start @@ -103,7 +104,7 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=1,queues=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start @@ -111,77 +112,99 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=0,queues=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start 7. Relaunch virtio-user with vector_rx path, then repeat step 3:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 \ - --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=0,queues=1 \ + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=0,vectorized=1,queues=1 \ -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start -Test Case 2: Split ring dynamic queue number test for DMA-accelerated vhost Tx operations -========================================================================================= +8. Quit all testpmd and relaunch vhost with iova=pa by below command:: -1. Bind 8 cbdma channels and one nic port to vfio-pci, then launch vhost by below command:: + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@0000:00:04.0]' \ + --iova=pa -- -i --nb-cores=1 --txd=1024 --rxd=1024 + >set fwd mac + >start + +9. Rerun steps 2-7. - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 - >set fwd mac - >start +Test Case 2: PVP split ring dynamic queue number vhost enqueue operations with cbdma +===================================================================================== + +1. Bind 8 CBDMA ports and 1 NIC port to vfio-pci, then launch vhost by below command:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + >set fwd mac + >start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 30-31 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=1,queues=8,server=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 >set fwd mac >start -3. Send imix packets from packet generator with random ip, check perforamnce can get target. +3. Send imix packets[64,1518] from packet generator with random ip, check perforamnce can get target. 4. Stop vhost port, check vhost RX and TX direction both exist packtes in 8 queues from vhost log. -5. Quit vhost port and relaunch vhost with 4 queues w/ cbdma:: +5. Quit and relaunch vhost with 4 queues w/ cbdma and 4 queues w/o cbdma:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=4,client=1,dmas=[txq0@00:04.0;txq1@00:04.1;txq2@00:04.2;txq3@00:04.3]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=4 --rxq=4 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@0000:00:04.0;txq1@0000:00:04.1;txq2@0000:00:04.2;txq3@0000:00:04.3]' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 >set fwd mac >start -6. Send imix packets from packet generator with random ip, check perforamnce can get target. +6. Send imix packets[64,1518] from packet generator with random ip, check perforamnce can get target. -7. Stop vhost port, check vhost RX and TX direction both exist packtes in 4 queues from vhost log. +7. Stop vhost port, check vhost RX and TX direction both exist packtes in 8 queues from vhost log. -8. Quit vhost port and relaunch vhost with 8 queues w/ cbdma:: +8. Quit and relaunch vhost with 8 queues w/ cbdma:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@80:04.0;txq1@80:04.1;txq2@80:04.2;txq3@80:04.3;txq4@80:04.4;txq5@80:04.5;txq6@80:04.6;txq7@80:04.7]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@0000:00:04.0;txq1@0000:00:04.1;txq2@0000:00:04.2;txq3@0000:00:04.3;txq4@0000:00:04.4;txq5@0000:00:04.5;txq6@0000:00:04.6;txq7@0000:00:04.7]' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 >set fwd mac >start -9. Send imix packets from packet generator with random ip, check perforamnce can get target. +9. Send imix packets[64,1518] from packet generator with random ip, check perforamnce can get target. 10. Stop vhost port, check vhost RX and TX direction both exist packtes in 8 queues from vhost log. -Test Case 3: PVP packed ring all path with DMA-accelerated vhost enqueue -======================================================================== +11. Quit and relaunch vhost with iova=pa, 6 queues w/ cbdma and 2 queues w/o cbdma:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@0000:00:04.0;txq1@0000:00:04.1;txq2@0000:00:04.2;txq3@0000:00:04.3;txq4@0000:00:04.4;txq5@0000:00:04.5]' \ + --iova=pa -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + >set fwd mac + >start + +12. Send imix packets[64,1518] from packet generator with random ip, check perforamnce can get target. + +13. Stop vhost port, check vhost RX and TX direction both exist packtes in 8 queues from vhost log. + +Test Case 3: PVP packed ring all path vhost enqueue operations with cbdma +========================================================================= -Packet pipeline: +Packet pipeline: ================ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG -1. Bind one cbdma port and one nic port to vfio-pci, then launch vhost by below command:: +1. Bind 1 CBDMA port and 1 NIC port to vfio-pci, then launch vhost by below command:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@80:04.0]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@0000:80:04.0]' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start @@ -189,11 +212,11 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=1,queues=1,packed_vq=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start -3. Send imix packets [64,1518] from packet generator, check the throughput can get expected data, restart vhost port, then check throughput again:: +3. Send imix packets [64,1518] from packet generator, check the throughput can get expected data, restart vhost port and send imix pkts again, check get same throuhput:: testpmd>show port stats all testpmd>stop @@ -204,7 +227,7 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=0,queues=1,packed_vq=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start @@ -212,7 +235,7 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=1,queues=1,packed_vq=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start @@ -220,44 +243,52 @@ TG --> NIC --> Vhost --> Virtio--> Vhost --> NIC --> TG ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=0,queues=1,packed_vq=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start 7. Relaunch virtio-user with vectorized path, then repeat step 3:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 \ - --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=1,queues=1,packed_vq=1 \ + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio --force-max-simd-bitwidth=512 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queues=1 \ -- -i --nb-cores=1 --txd=1024 --rxd=1024 >set fwd mac >start -8. Relaunch virtio-user with vector_rx path, then repeat step 3:: +8. Relaunch virtio-user with vectorized path and ring size is not power of 2, then repeat step 3:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 \ - --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=1,queues=1,packed_vq=1 \ - -- -i --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio --force-max-simd-bitwidth=512 \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queues=1,queue_size=1025 \ + -- -i --nb-cores=1 --txd=1025 --rxd=1025 >set fwd mac >start -Test Case 4: Packed ring dynamic queue number test for DMA-accelerated vhost Tx operations -========================================================================================== +9. Quit all testpmd and relaunch vhost with iova=pa by below command:: -1. Bind 8 cbdma channels and one nic port to vfio-pci, then launch vhost by below command:: + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@0000:80:04.0]' \ + --iova=pa -- -i --nb-cores=1 --txd=1024 --rxd=1024 + >set fwd mac + >start + +10. Rerun steps 2-8. + +Test Case 4: PVP packed ring dynamic queue number vhost enqueue operations with cbdma +===================================================================================== - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 - >set fwd mac - >start +1. Bind 8 CBDMA ports and 1 NIC port to vfio-pci, then launch vhost by below command:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + >set fwd mac + >start 2. Launch virtio-user by below command:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 30-31 --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=1,queues=8,server=1,packed_vq=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=0,queues=8,server=1,packed_vq=1 \ + -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 >set fwd mac >start @@ -265,11 +296,11 @@ Test Case 4: Packed ring dynamic queue number test for DMA-accelerated vhost Tx 4. Stop vhost port, check vhost RX and TX direction both exist packtes in 8 queues from vhost log. -5. Quit vhost port and relaunch vhost with 4 queues w/ cbdma:: +5. Quit and relaunch vhost with 4 queues w/ cbdma and 4 queues w/o cbdma:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=4,client=1,dmas=[txq0@80:04.0;txq1@80:04.1;txq2@80:04.2;txq3@80:04.3]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=4 --rxq=4 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@0000:80:04.0;txq1@0000:80:04.1;txq2@0000:80:04.2;txq3@0000:80:04.3]' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 >set fwd mac >start @@ -277,11 +308,11 @@ Test Case 4: Packed ring dynamic queue number test for DMA-accelerated vhost Tx 7. Stop vhost port, check vhost RX and TX direction both exist packtes in 4 queues from vhost log. -8. Quit vhost port and relaunch vhost with 8 queues w/ cbdma:: +8. Quit and relaunch vhost with 8 queues w/ cbdma:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 \ - --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@80:04.0;txq1@80:04.1;txq2@80:04.2;txq3@80:04.3;txq4@80:04.4;txq5@80:04.5;txq6@80:04.6;txq7@80:04.7]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@0000:80:04.0;txq1@0000:80:04.1;txq2@0000:80:04.2;txq3@0000:80:04.3;txq4@0000:80:04.4;txq5@0000:80:04.5;txq6@0000:80:04.6;txq7@0000:80:04.7]' \ + --iova=va -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 >set fwd mac >start @@ -289,59 +320,85 @@ Test Case 4: Packed ring dynamic queue number test for DMA-accelerated vhost Tx 10. Stop vhost port, check vhost RX and TX direction both exist packtes in 8 queues from vhost log. -Test Case 5: Compare PVP split ring performance between CPU copy, CBDMA copy and Sync copy -========================================================================================== +11. Quit and relaunch vhost with iova=pa, 6 queues w/ cbdma and 2 queues w/o cbdma:: -1. Bind one cbdma port and one nic port which on same numa to vfio-pci, then launch vhost by below command:: + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 28-29 --file-prefix=vhost \ + --vdev 'net_vhost0,iface=/tmp/s0,queues=8,client=1,dmas=[txq0@0000:80:04.0;txq1@0000:80:04.1;txq2@0000:80:04.2;txq3@0000:80:04.3;txq4@0000:80:04.4;txq5@0000:80:04.5]' \ + --iova=pa -- -i --nb-cores=1 --txd=1024 --rxd=1024 --txq=8 --rxq=8 + >set fwd mac + >start - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=1,client=1,dmas=[txq0@00:01.0]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 - >set fwd mac - >start +12. Send imix packets from packet generator with random ip, check perforamnce can get target. -2. Launch virtio-user with inorder mergeable path:: +13. Stop vhost port, check vhost RX and TX direction both exist packtes in 8 queues from vhost log. - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=1,queues=1,server=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 - >set fwd mac - >start +Test Case 5: loopback split ring large chain packets stress test with cbdma enqueue +==================================================================================== -3. Send packets with 64b and 1518b seperately from packet generator, record the throughput as sync copy throughput for 64b and cbdma copy for 1518b:: +Packet pipeline: +================ +Vhost <--> Virtio - testpmd>show port stats all +1. Bind 1 CBDMA channel to vfio-pci and launch vhost:: -4.Quit vhost side, relaunch with below cmd:: + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=1,dmas=[txq0@0000:00:04.0]' \ + --iova=va -- -i --nb-cores=1 --mbuf-size=65535 - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=1,client=1,dmas=[txq0@00:01.0]' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 - >set fwd mac +2. 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,queue_size=2048 \ + -- -i --rxq=1 --txq=1 --txd=2048 --rxd=2048 --nb-cores=1 >start -5. Send packets with 1518b from packet generator, record the throughput as sync copy throughput for 1518b:: +3. Send large packets from vhost, check virtio can receive packets:: - testpmd>show port stats all + testpmd> vhost enable tx all + testpmd> set txpkts 65535,65535,65535,65535,65535 + testpmd> start tx_first 32 + testpmd> show port stats all -6. Quit two testpmd, relaunch vhost by below command:: +4. Quit all testpmd and relaunch vhost with iova=pa:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-3 --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,queues=1' \ - -- -i --nb-cores=1 --txd=1024 --rxd=1024 - >set fwd mac - >start + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=1,dmas=[txq0@0000:00:04.0]' \ + --iova=pa -- -i --nb-cores=1 --mbuf-size=65535 -7. Launch virtio-user with inorder mergeable path:: +5. Rerun steps 2-3. - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio \ - --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,mrg_rxbuf=1,in_order=1,queues=1 \ - -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 - >set fwd mac +Test Case 6: loopback packed ring large chain packets stress test with cbdma enqueue +==================================================================================== + +Packet pipeline: +================ +Vhost <--> Virtio + +1. Bind 1 CBDMA channel to vfio-pci and launch vhost:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=1,dmas=[txq0@0000:00:04.0]' \ + --iova=va -- -i --nb-cores=1 --mbuf-size=65535 + +2. 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 \ + -- -i --rxq=1 --txq=1 --txd=2048 --rxd=2048 --nb-cores=1 >start -8. Send packets with 64b from packet generator, record the throughput as cpu copy for 64b:: +3. Send large packets from vhost, check virtio can receive packets:: - testpmd>show port stats all + testpmd> vhost enable tx all + testpmd> set txpkts 65535,65535,65535,65535,65535 + testpmd> start tx_first 32 + testpmd> show port stats all + +4. Quit all testpmd and relaunch vhost with iova=pa:: -9. Check performance can meet below requirement:: + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 2-3 -n 4 \ + --vdev 'eth_vhost0,iface=vhost-net0,queues=1,dmas=[txq0@0000:00:04.0]' --iova=pa -- -i --nb-cores=1 --mbuf-size=65535 - (1)CPU copy vs. sync copy delta < 10% for 64B packet size - (2)CBDMA copy vs sync copy delta > 5% for 1518 packet size +5. Rerun steps 2-3. From patchwork Wed Jan 26 09:21:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 106573 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 E3C95A04A8; Wed, 26 Jan 2022 10:22:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA80642708; Wed, 26 Jan 2022 10:22:05 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 45D2D4069D for ; Wed, 26 Jan 2022 10:22:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643188924; x=1674724924; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=luAgxa6gDRXl9q0mklTsgWek+djae1xel0dz0hZuSlU=; b=ZmGXC12ObUP0eQvLQQrDTzGNjlgEZKnZMeSRhhShb4sNGdgMaSseK2e2 mgX9nulu3PFUADN+j70RTUbKvuIK3TFDqobBUbJVmMdFOxkYcaNfEPo9s TMlu8VhulQhn3TVNY9HQ/Imvbbys7vmvQbN4en0UKLATqWDtTZ8BdEePn 9+KKEUv4stHs07dpySyLMhPOAsAwF6MJgQw2h7Tl3JOss/yWXuLD+X1y6 pjtBj7M5prSRkfWuZw2hlAmSraZL67LVLaPFzViYfkNfq3zRef3mdRH/f oHUL7+ytX3OiekscS3JaTCC3WVsZMgPuQvSASPp9BZmDat1g4i/MK6AFQ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="307228210" X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="307228210" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:22:03 -0800 X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="674305713" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:21:57 -0800 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V4 3/3] tests/vhost_cbdma: modify test suite sync with test plan change Date: Wed, 26 Jan 2022 17:21:51 +0800 Message-Id: <20220126092151.916483-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 Modify test suite sync with test plan change. Add '--force-max-simd-bitwidth=512' param in case3. Add skip step when case running on 2M hugepage size testbed. Signed-off-by: Wei Ling --- v1:Modify test suite sync with test plan change. v2:Add '--force-max-simd-bitwidth=512' param in case3. v3:Add skip step when case running on 2M hugepage size testbed. tests/TestSuite_vhost_cbdma.py | 521 +++++++++++++++++---------------- 1 file changed, 275 insertions(+), 246 deletions(-) diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py index 02d7e25e..8a1fd731 100644 --- a/tests/TestSuite_vhost_cbdma.py +++ b/tests/TestSuite_vhost_cbdma.py @@ -37,7 +37,7 @@ operations of queues: a queue. Here is an example: - $ ./testpmd -c f -n 4 \ + $ ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c f -n 4 \ --vdev 'net_vhost0,iface=/tmp/s0,queues=1,dmas=[txq0@80:04.0]' """ import json @@ -56,7 +56,6 @@ from framework.test_case import TestCase class TestVirTioVhostCbdma(TestCase): def set_up_all(self): - # Get and verify the ports self.dut_ports = self.dut.get_ports() self.number_of_ports = 1 self.vhost_user = self.dut.new_session(suite="vhost-user") @@ -64,8 +63,6 @@ class TestVirTioVhostCbdma(TestCase): self.virtio_user1 = self.dut.new_session(suite="virtio-user1") self.pmdout_vhost_user = PmdOutput(self.dut, self.vhost_user) self.pmdout_virtio_user = PmdOutput(self.dut, self.virtio_user) - self.pmdout_virtio_user1 = PmdOutput(self.dut, self.virtio_user1) - self.frame_sizes = [64, 1518] self.virtio_mac = "00:01:02:03:04:05" self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip'] self.pci_info = self.dut.ports_info[0]['pci'] @@ -73,7 +70,6 @@ class TestVirTioVhostCbdma(TestCase): self.cores = self.dut.get_core_list("all", socket=self.socket) self.cbdma_dev_infos = [] self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) - # the path of pcap file self.out_path = '/tmp/%s' % self.suite_name out = self.tester.send_expect('ls -d %s' % self.out_path, '# ') if 'No such file or directory' in out: @@ -94,14 +90,9 @@ class TestVirTioVhostCbdma(TestCase): self.table_header.append("Mpps") self.table_header.append("% linerate") self.result_table_create(self.table_header) - # test parameters include: frames size, descriptor numbers self.test_parameters = self.get_suite_cfg()['test_parameters'] - # traffic duraion in second self.test_duration = self.get_suite_cfg()['test_duration'] - # initialize throughput attribution - # {'TestCase':{ 'Mode': {'$framesize':{"$nb_desc": 'throughput'}}} self.throughput = {} - # Accepted tolerance in Mpps self.gap = self.get_suite_cfg()['accepted_tolerance'] self.test_result = {} self.nb_desc = self.test_parameters.get(list(self.test_parameters.keys())[0])[0] @@ -120,8 +111,7 @@ class TestVirTioVhostCbdma(TestCase): 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 + # 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 @@ -167,326 +157,379 @@ class TestVirTioVhostCbdma(TestCase): self.verify(int(self.result_first[0]) > 1 and int(self.result_secondary[0]) > 1, "forward packets no correctly") @property - def check_2m_env(self): + 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 launch_testpmd_as_vhost_user(self, command, cores="Default", dev="", ports = ""): - self.pmdout_vhost_user.start_testpmd(cores=cores, param=command, vdevs=[dev], ports=ports, prefix="vhost") - self.vhost_user.send_expect('set fwd mac', 'testpmd> ', 120) - self.vhost_user.send_expect('start', 'testpmd> ', 120) - - def launch_testpmd_as_virtio_user1(self, command, cores="Default", dev=""): - eal_params = "" - if self.check_2m_env: - eal_params += " --single-file-segments" - self.pmdout_virtio_user1.start_testpmd(cores, command, vdevs=[dev], no_pci=True, prefix="virtio1", eal_param=eal_params) - self.virtio_user1.send_expect('set fwd mac', 'testpmd> ', 30) - self.virtio_user1.send_expect('start', 'testpmd> ', 30) - self.virtio_user1.send_expect('show port info all', 'testpmd> ', 30) - - def launch_testpmd_as_virtio_user(self, command, cores="Default", dev=""): - eal_params = "" - if self.check_2m_env: - eal_params += " --single-file-segments" - self.pmdout_virtio_user.start_testpmd(cores, command, vdevs=[dev],no_pci=True, prefix="virtio", eal_param=eal_params) - self.virtio_user.send_expect('set fwd mac', 'testpmd> ', 120) - self.virtio_user.send_expect('start', 'testpmd> ', 120) - self.virtio_user.send_expect('show port info all', 'testpmd> ', 30) - - def diff_param_launch_send_and_verify(self, mode, params, dev, cores, is_quit=True, launch_virtio=True): + def launch_testpmd_as_vhost_user(self, command, cores="Default", dev="", ports = "", iova_mode='pa', set_pmd_param=True): + if iova_mode: + iova_parm = "--iova=" + iova_mode + else: + iova_parm = "" + self.pmdout_vhost_user.start_testpmd(cores=cores, param=command, vdevs=[dev], ports=ports, prefix="vhost", eal_param=iova_parm) + if set_pmd_param: + self.vhost_user.send_expect('set fwd mac', 'testpmd> ', 30) + self.vhost_user.send_expect('start', 'testpmd> ', 30) + + def launch_testpmd_as_virtio_user(self, command, cores="Default", dev="", set_pmd_param=True, eal_param=""): + if self.check_2M_env: + eal_param += " --single-file-segments" + self.pmdout_virtio_user.start_testpmd(cores, command, vdevs=[dev], no_pci=True, prefix="virtio", eal_param=eal_param) + if set_pmd_param: + self.virtio_user.send_expect('set fwd mac', 'testpmd> ', 30) + self.virtio_user.send_expect('start', 'testpmd> ', 30) + self.virtio_user.send_expect('show port info all', 'testpmd> ', 30) + + def diff_param_launch_send_and_verify(self, mode, params, dev, cores, eal_param="", is_quit=True, launch_virtio=True): if launch_virtio: - self.launch_testpmd_as_virtio_user(params, cores, dev=dev) + self.launch_testpmd_as_virtio_user(params, cores, dev=dev, eal_param=eal_param) self.send_and_verify(mode) if is_quit: self.virtio_user.send_expect("quit", "# ") time.sleep(3) - def test_perf_pvp_spilt_all_path_with_cbdma_vhost_enqueue_operations(self): + def test_perf_pvp_spilt_ring_all_path_vhost_enqueue_operations_with_cbdma(self): """ - Test Case 1: PVP Split all path with DMA-accelerated vhost enqueue + Test Case 1: PVP split ring all path vhost enqueue operations with cbdma """ self.test_target = self.running_case self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target] txd_rxd = 1024 - eal_tx_rxd = ' --nb-cores=%d --txd=%d --rxd=%d' - queue = 1 - used_cbdma_num = 1 - self.get_cbdma_ports_info_and_bind_to_dpdk(used_cbdma_num) + vhost_param = ' --nb-cores=%d --txd=%d --rxd=%d' + nb_cores = 1 + queues = 1 + self.get_cbdma_ports_info_and_bind_to_dpdk(1) vhost_vdevs = f"'net_vhost0,iface=/tmp/s0,queues=%d,dmas=[txq0@{self.device_str}]'" - dev_path_mode_mapper = { + virtio_path_dict = { "inorder_mergeable_path": 'mrg_rxbuf=1,in_order=1', "mergeable_path": 'mrg_rxbuf=1,in_order=0', "inorder_non_mergeable_path": 'mrg_rxbuf=0,in_order=1', "non_mergeable_path": 'mrg_rxbuf=0,in_order=0', - "vector_rx_path": 'mrg_rxbuf=0,in_order=0', + "vector_rx_path": 'mrg_rxbuf=0,in_order=0,vectorized=1', } - pvp_split_all_path_virtio_params = "--tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=%d --txd=%d --rxd=%d" % (queue, txd_rxd, txd_rxd) allow_pci = [self.dut.ports_info[0]['pci']] - for index in range(used_cbdma_num): + for index in range(1): allow_pci.append(self.cbdma_dev_infos[index]) - self.launch_testpmd_as_vhost_user(eal_tx_rxd % (queue, txd_rxd, txd_rxd), self.cores[0:2], dev=vhost_vdevs % (queue), ports=allow_pci) - for key, path_mode in dev_path_mode_mapper.items(): - if key == "vector_rx_path": - pvp_split_all_path_virtio_params = eal_tx_rxd % (queue, txd_rxd, txd_rxd) - vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % queue - self.diff_param_launch_send_and_verify(key, pvp_split_all_path_virtio_params, vdevs, self.cores[2:4], is_quit=False) - self.mode_list.append(key) - # step3 restart vhost port, then check throughput again - key += "_RestartVhost" + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd), self.cores[0:2], + dev=vhost_vdevs % (nb_cores), ports=allow_pci, iova_mode='va') + for key, path_mode in virtio_path_dict.items(): + if key == "non_mergeable_path": + virtio_param = " --enable-hw-vlan-strip --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, txd_rxd, txd_rxd) + else: + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, txd_rxd, txd_rxd) + vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % nb_cores + mode = key + "_VA" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], is_quit=False, launch_virtio=True) self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) self.vhost_user.send_expect('stop', 'testpmd> ', 10) self.vhost_user.send_expect('start', 'testpmd> ', 10) self.vhost_user.send_expect('show port info all', 'testpmd> ', 30) self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) - self.diff_param_launch_send_and_verify(key, pvp_split_all_path_virtio_params, vdevs, - self.cores[2:4], launch_virtio=False) - self.mode_list.append(key) - self.vhost_user.send_expect("quit", "# ") + mode += "_RestartVhost" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], is_quit=True, launch_virtio=False) + + if not self.check_2M_env: + self.logger.info("Quit and relaunch vhost testpmd with PA mode") + self.vhost_user.send_expect("quit", "# ") + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd), self.cores[0:2], + dev=vhost_vdevs % (nb_cores), ports=allow_pci, iova_mode='pa') + for key, path_mode in virtio_path_dict.items(): + if key == "non_mergeable_path": + virtio_param = " --enable-hw-vlan-strip --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, txd_rxd, txd_rxd) + else: + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, txd_rxd, txd_rxd) + vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % queues + mode = key + "_PA" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], is_quit=False, + launch_virtio=True) + self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) + self.vhost_user.send_expect('stop', 'testpmd> ', 10) + self.vhost_user.send_expect('start', 'testpmd> ', 10) + self.vhost_user.send_expect('show port info all', 'testpmd> ', 30) + self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) + mode += "_RestartVhost" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], is_quit=True, + launch_virtio=False) self.result_table_print() self.handle_expected(mode_list=self.mode_list) self.handle_results(mode_list=self.mode_list) - def test_perf_dynamic_queue_number_cbdma_vhost_enqueue_operations(self): + def test_perf_pvp_spilt_ring_all_dynamic_queue_number_vhost_enqueue_operations_with_cbdma(self): """ - Test Case2: Split ring dynamic queue number test for DMA-accelerated vhost Tx operations + Test Case2: PVP split ring dynamic queue number vhost enqueue operations with cbdma """ self.test_target = self.running_case self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target] - used_cbdma_num = 8 - queue = 8 - txd_rxd = 1024 nb_cores = 1 + txd_rxd = 1024 + queues = 8 virtio_path = "/tmp/s0" path_mode = 'mrg_rxbuf=1,in_order=1' - self.get_cbdma_ports_info_and_bind_to_dpdk(used_cbdma_num) - eal_params = " --nb-cores=1 --txd=1024 --rxd=1024 --txq=%d --rxq=%d " - dynamic_queue_number_cbdma_virtio_params = f" --tx-offloads=0x0 --enable-hw-vlan-strip {eal_params % (queue,queue)}" - virtio_dev = f"net_virtio_user0,mac={self.virtio_mac},path={virtio_path},{path_mode},queues={queue},server=1" + self.get_cbdma_ports_info_and_bind_to_dpdk(8) + vhost_param = " --nb-cores=%d --txd=%d --rxd=%d --txq=%d --rxq=%d " + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d --txq=%d --rxq=%d " vhost_dev = f"'net_vhost0,iface={virtio_path},queues=%d,client=1,%s'" - # launch vhost testpmd + virtio_dev = f"net_virtio_user0,mac={self.virtio_mac},path={virtio_path},{path_mode},queues={queues},server=1" allow_pci = [self.dut.ports_info[0]['pci']] - for index in range(used_cbdma_num): + for index in range(8): allow_pci.append(self.cbdma_dev_infos[index]) + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues,''), ports=[allow_pci[0]], iova_mode='va') + self.mode_list.append("with_0_cbdma") + self.launch_testpmd_as_virtio_user(virtio_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[2:4], + dev=virtio_dev) + self.send_and_verify("with_0_cbdma", queue_list=range(queues)) - # no cbdma to launch vhost - self.launch_testpmd_as_vhost_user(eal_params % (queue,queue), self.cores[0:2], dev=vhost_dev % (queue,''), ports=[allow_pci[0]]) - mode = "no_cbdma" - self.mode_list.append(mode) - self.launch_testpmd_as_virtio_user(dynamic_queue_number_cbdma_virtio_params, self.cores[2:4], dev=virtio_dev) - self.send_and_verify(mode, queue_list=range(queue)) self.vhost_user.send_expect("quit", "#") - - # used 4 cbdma_num and 4 queue to launch vhost - vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]};txq2@{self.used_cbdma[2]};txq3@{self.used_cbdma[3]}]" - self.launch_testpmd_as_vhost_user(eal_params % (queue/2,queue/2), self.cores[0:2], dev=vhost_dev % (int(queue/2),vhost_dmas), ports=allow_pci[:5]) - self.send_and_verify("used_4_cbdma_num", queue_list=range(int(queue/2))) - self.mode_list.append("used_4_cbdma_num") - self.vhost_user.send_expect("quit", "#") + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues, vhost_dmas), ports=allow_pci[:5], iova_mode='va') + self.mode_list.append("with_4_cbdma") + self.send_and_verify("with_4_cbdma", queue_list=range(int(queues/2))) - #used 8 cbdma_num to launch vhost + self.vhost_user.send_expect("quit", "#") vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]};txq2@{self.used_cbdma[2]};txq3@{self.used_cbdma[3]};txq4@{self.used_cbdma[4]};txq5@{self.used_cbdma[5]};txq6@{self.used_cbdma[6]};txq7@{self.used_cbdma[7]}]" - self.launch_testpmd_as_vhost_user(eal_params % (queue, queue), self.cores[0:2], - dev=vhost_dev % (queue,vhost_dmas), ports=allow_pci) - self.send_and_verify("used_8_cbdma_num", queue_list=range(queue)) - self.mode_list.append("used_8_cbdma_num") - self.send_and_verify("used_8_cbdma_num_1", queue_list=range(queue)) - self.mode_list.append("used_8_cbdma_num_1") - self.virtio_user.send_expect("stop", "testpmd> ", 60) - time.sleep(5) + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues, vhost_dmas), ports=allow_pci, iova_mode='va') + self.mode_list.append("with_8_cbdma") + self.send_and_verify("with_8_cbdma", queue_list=range(queues)) + + if not self.check_2M_env: + self.logger.info("Quit and relaunch vhost testpmd with PA mode") + self.vhost_user.send_expect("quit", "#") + vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]};txq2@{self.used_cbdma[2]};txq3@{self.used_cbdma[3]};txq4@{self.used_cbdma[4]};txq5@{self.used_cbdma[5]}]" + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues, vhost_dmas), ports=allow_pci, iova_mode='pa') + self.mode_list.append("with_6_cbdma") + self.send_and_verify("with_6_cbdma", queue_list=range(queues)) + self.virtio_user.send_expect("quit", "# ") self.vhost_user.send_expect("quit", "# ") self.result_table_print() - # result_rows = [[], [64, 'dynamic_queue2', 7.4959375, 12.593175], [1518, 'dynamic_queue2', 1.91900225, 59.028509209999996]] - result_rows = self.result_table_getrows() # self.handle_expected(mode_list=self.mode_list) self.handle_results(mode_list=self.mode_list) - def test_perf_pvp_packed_all_path_with_cbdma_vhost_enqueue_operations(self): + def test_perf_pvp_packed_ring_all_path_vhost_enqueue_operations_with_cbdma(self): """ - Test Case 3: PVP packed ring all path with DMA-accelerated vhost enqueue + Test Case 3: PVP packed ring all path vhost enqueue operations with cbdma """ self.test_target = self.running_case self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target] txd_rxd = 1024 - eal_tx_rxd = ' --nb-cores=%d --txd=%d --rxd=%d' - queue = 1 - used_cbdma_num = 1 - self.get_cbdma_ports_info_and_bind_to_dpdk(used_cbdma_num) + vhost_param = ' --nb-cores=%d --txd=%d --rxd=%d' + nb_cores = 1 + queues = 1 + self.get_cbdma_ports_info_and_bind_to_dpdk(1) vhost_vdevs = f"'net_vhost0,iface=/tmp/s0,queues=%d,dmas=[txq0@{self.device_str}]'" - dev_path_mode_mapper = { + virtio_path_dict = { "inorder_mergeable_path": 'mrg_rxbuf=1,in_order=1,packed_vq=1', "mergeable_path": 'mrg_rxbuf=1,in_order=0,packed_vq=1', "inorder_non_mergeable_path": 'mrg_rxbuf=0,in_order=1,packed_vq=1', "non_mergeable_path": 'mrg_rxbuf=0,in_order=0,packed_vq=1', - "vector_rx_path": 'mrg_rxbuf=0,in_order=0,packed_vq=1', + "vector_rx_path": 'mrg_rxbuf=0,in_order=1,vectorized=1,packed_vq=1', + "vector_rx_path_not_power_of_2": 'mrg_rxbuf=0,in_order=1,vectorized=1,packed_vq=1,queue_size=1025' } - pvp_split_all_path_virtio_params = "--tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=%d --txd=%d --rxd=%d" % (queue, txd_rxd, txd_rxd) allow_pci = [self.dut.ports_info[0]['pci']] - for index in range(used_cbdma_num): + for index in range(1): allow_pci.append(self.cbdma_dev_infos[index]) - self.launch_testpmd_as_vhost_user(eal_tx_rxd % (queue, txd_rxd, txd_rxd), self.cores[0:2], dev=vhost_vdevs % (queue), ports=allow_pci) - for key, path_mode in dev_path_mode_mapper.items(): - if key == "vector_rx_path": - pvp_split_all_path_virtio_params = eal_tx_rxd % (queue, txd_rxd, txd_rxd) - vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % queue - self.diff_param_launch_send_and_verify(key, pvp_split_all_path_virtio_params, vdevs, self.cores[2:4], is_quit=False) - self.mode_list.append(key) - # step3 restart vhost port, then check throughput again - key += "_RestartVhost" + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd), self.cores[0:2], + dev=vhost_vdevs % (nb_cores), ports=allow_pci, iova_mode='va') + for key, path_mode in virtio_path_dict.items(): + if key == "vector_rx_path_not_power_of_2": + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, (txd_rxd + 1), (txd_rxd + 1)) + else: + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, txd_rxd, txd_rxd) + if "vector_rx_path" in key: + eal_param = "--force-max-simd-bitwidth=512" + else: + eal_param = "" + vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % queues + mode = key + "_VA" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], eal_param=eal_param, + is_quit=False, launch_virtio=True) self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) self.vhost_user.send_expect('stop', 'testpmd> ', 10) self.vhost_user.send_expect('start', 'testpmd> ', 10) self.vhost_user.send_expect('show port info all', 'testpmd> ', 30) self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) - self.diff_param_launch_send_and_verify(key, pvp_split_all_path_virtio_params, vdevs, - self.cores[2:4], launch_virtio=False) - self.mode_list.append(key) - self.vhost_user.send_expect("quit", "# ") + mode += "_RestartVhost" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], is_quit=True, + launch_virtio=False) + if not self.check_2M_env: + self.logger.info("Quit and relaunch vhost testpmd with PA mode") + self.vhost_user.send_expect("quit", "# ") + self.launch_testpmd_as_vhost_user(vhost_param % (queues, txd_rxd, txd_rxd), self.cores[0:2], + dev=vhost_vdevs % (queues), ports=allow_pci, iova_mode='pa') + for key, path_mode in virtio_path_dict.items(): + if key == "vector_rx_path_not_power_of_2": + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, (txd_rxd + 1), (txd_rxd + 1)) + else: + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d" % (nb_cores, txd_rxd, txd_rxd) + if "vector_rx_path" in key: + eal_param = "--force-max-simd-bitwidth=512" + else: + eal_param = "" + vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % queues + mode = key + "_PA" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], eal_param=eal_param, + is_quit=False, launch_virtio=True) + + self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) + self.vhost_user.send_expect('stop', 'testpmd> ', 10) + self.vhost_user.send_expect('start', 'testpmd> ', 10) + self.vhost_user.send_expect('show port info all', 'testpmd> ', 30) + self.vhost_user.send_expect('show port stats all', 'testpmd> ', 10) + mode += "_RestartVhost" + self.mode_list.append(mode) + self.diff_param_launch_send_and_verify(mode, virtio_param, vdevs, self.cores[2:4], is_quit=True, + launch_virtio=False) + self.result_table_print() self.handle_expected(mode_list=self.mode_list) self.handle_results(mode_list=self.mode_list) - def test_perf_packed_dynamic_queue_number_cbdma_vhost_enqueue_operations(self): + def test_perf_pvp_packed_ring_all_dynamic_queue_number_vhost_enqueue_operations_with_cbdma(self): """ - Test Case4: Packed ring dynamic queue number test for DMA-accelerated vhost Tx operations + Test Case 4: PVP packed ring dynamic queue number vhost enqueue operations with cbdma """ self.test_target = self.running_case self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target] - used_cbdma_num = 8 - queue = 8 - txd_rxd = 1024 nb_cores = 1 + txd_rxd = 1024 + queues = 8 virtio_path = "/tmp/s0" path_mode = 'mrg_rxbuf=1,in_order=1,packed_vq=1' - self.get_cbdma_ports_info_and_bind_to_dpdk(used_cbdma_num) - vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]}]" - eal_params = " --nb-cores=1 --txd=1024 --rxd=1024 --txq=%d --rxq=%d " - dynamic_queue_number_cbdma_virtio_params = f" --tx-offloads=0x0 --enable-hw-vlan-strip {eal_params % (queue, queue)}" - virtio_dev = f"net_virtio_user0,mac={self.virtio_mac},path={virtio_path},{path_mode},queues={queue},server=1" - vhost_dev = f"'net_vhost0,iface={virtio_path},queues=%s,client=1,%s'" - # launch vhost testpmd + self.get_cbdma_ports_info_and_bind_to_dpdk(8) + vhost_param = " --nb-cores=%d --txd=%d --rxd=%d --txq=%d --rxq=%d " + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d --txq=%d --rxq=%d " + vhost_dev = f"'net_vhost0,iface={virtio_path},queues=%d,client=1,%s'" + virtio_dev = f"net_virtio_user0,mac={self.virtio_mac},path={virtio_path},{path_mode},queues={queues},server=1" allow_pci = [self.dut.ports_info[0]['pci']] - for index in range(used_cbdma_num): + for index in range(8): allow_pci.append(self.cbdma_dev_infos[index]) + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues, ''), ports=[allow_pci[0]], iova_mode='va') + self.mode_list.append("with_0_cbdma") + self.launch_testpmd_as_virtio_user(virtio_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[2:4], + dev=virtio_dev) + self.send_and_verify("with_0_cbdma", queue_list=range(queues)) - # no cbdma to launch vhost - self.launch_testpmd_as_vhost_user(eal_params % (queue,queue), self.cores[0:2], dev=vhost_dev % (queue,''), ports= [allow_pci[0]]) - mode = "no_cbdma" - self.mode_list.append(mode) - self.launch_testpmd_as_virtio_user(dynamic_queue_number_cbdma_virtio_params, self.cores[2:4], dev=virtio_dev) - self.send_and_verify(mode, queue_list=range(queue)) self.vhost_user.send_expect("quit", "#") - - # used 4 cbdma_num and 4 queue to launch vhost vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]};txq2@{self.used_cbdma[2]};txq3@{self.used_cbdma[3]}]" - self.launch_testpmd_as_vhost_user(eal_params % (queue/2,queue/2), self.cores[0:2], - dev=vhost_dev % (int(queue/2),vhost_dmas), ports=allow_pci[:5]) - self.send_and_verify("used_4_cbdma_num", queue_list=range(int(queue/2))) - self.mode_list.append("used_4_cbdma_num") - self.vhost_user.send_expect("quit", "#") + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues, vhost_dmas), ports=allow_pci[:5], iova_mode='va') + self.mode_list.append("with_4_cbdma") + self.send_and_verify("with_4_cbdma", queue_list=range(int(queues / 2))) - #used 8 cbdma_num to launch vhost + self.vhost_user.send_expect("quit", "#") vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]};txq2@{self.used_cbdma[2]};txq3@{self.used_cbdma[3]};txq4@{self.used_cbdma[4]};txq5@{self.used_cbdma[5]};txq6@{self.used_cbdma[6]};txq7@{self.used_cbdma[7]}]" - self.launch_testpmd_as_vhost_user(eal_params % (queue, queue), self.cores[0:2], - dev=vhost_dev % (queue,vhost_dmas), ports=allow_pci) - self.send_and_verify("used_8_cbdma_num", queue_list=range(queue)) - self.mode_list.append("used_8_cbdma_num") - self.send_and_verify("used_8_cbdma_num_1", queue_list=range(queue)) - self.mode_list.append("used_8_cbdma_num_1") - self.virtio_user.send_expect("stop", "testpmd> ", 60) - time.sleep(5) + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues, vhost_dmas), ports=allow_pci, iova_mode='va') + self.mode_list.append("with_8_cbdma") + self.send_and_verify("with_8_cbdma", queue_list=range(queues)) + + if not self.check_2M_env: + self.logger.info("Quit and relaunch vhost testpmd with PA mode") + self.vhost_user.send_expect("quit", "#") + vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]};txq2@{self.used_cbdma[2]};txq3@{self.used_cbdma[3]};txq4@{self.used_cbdma[4]};txq5@{self.used_cbdma[5]}]" + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores, txd_rxd, txd_rxd, queues, queues), self.cores[0:2], + dev=vhost_dev % (queues, vhost_dmas), ports=allow_pci, iova_mode='pa') + self.mode_list.append("with_6_cbdma") + self.send_and_verify("with_6_cbdma", queue_list=range(queues)) + self.virtio_user.send_expect("quit", "# ") self.vhost_user.send_expect("quit", "# ") self.result_table_print() - # result_rows = [[], [64, 'dynamic_queue2', 7.4959375, 12.593175], [1518, 'dynamic_queue2', 1.91900225, 59.028509209999996]] - result_rows = self.result_table_getrows() # self.handle_expected(mode_list=self.mode_list) self.handle_results(mode_list=self.mode_list) + def send_chain_packets_and_verify(self): + self.pmdout_virtio_user.execute_cmd("clear port stats all") + self.pmdout_virtio_user.execute_cmd("start") + self.pmdout_vhost_user.execute_cmd("vhost enable tx all") + self.pmdout_vhost_user.execute_cmd("set txpkts 65535,65535,65535,65535,65535") + self.pmdout_vhost_user.execute_cmd("start tx_first 32") + self.pmdout_vhost_user.execute_cmd("show port stats all") + out = self.pmdout_virtio_user.execute_cmd("show port stats all") + rx_pkts = int(re.search("RX-packets: (\d+)", out).group(1)) + self.verify(rx_pkts > 0, "virtio-user can not received packets") - def test_perf_compare_pvp_split_ring_performance(self): + def test_loopback_split_ring_large_chain_packets_stress_test_with_cbdma_enqueue(self): """ - Test Case5: Compare PVP split ring performance between CPU copy, CBDMA copy and Sync copy + Test Case5: loopback split ring large chain packets stress test with cbdma enqueue """ - used_cbdma_num = 1 - queue = 1 - txd_rxd = 1024 - eal_tx_rxd = ' --nb-cores=%d --txd=%d --rxd=%d' - path_mode = 'mrg_rxbuf=1,in_order=1,server=1' - allow_pci = [self.dut.ports_info[0]['pci']] - self.get_cbdma_ports_info_and_bind_to_dpdk(used_cbdma_num) - for index in range(used_cbdma_num): + nb_cores = 1 + queues = 1 + txd_rxd = 2048 + txq_rxq = 1 + virtio_path = "/tmp/s0" + path_mode = 'mrg_rxbuf=1,in_order=0,vectorized=1,queue_size=2048' + self.get_cbdma_ports_info_and_bind_to_dpdk(1) + vhost_param = " --nb-cores=%d --mbuf-size=65535" + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d --txq=%d --rxq=%d " + virtio_dev = f"net_virtio_user0,mac={self.virtio_mac},path={virtio_path},{path_mode},queues=%d" + vhost_vdevs = f"'net_vhost0,iface=/tmp/s0,queues=%d,dmas=[txq0@{self.device_str}]'" + allow_pci = [] + for index in range(1): allow_pci.append(self.cbdma_dev_infos[index]) - path_mode = 'mrg_rxbuf=1,in_order=1' - vhost_vdevs = f"'net_vhost0,iface=/tmp/s0,queues=%d,client=1,dmas=[txq0@{self.device_str}]'" - compare_pvp_split_ring_performance = "--tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=%d --txd=%d --rxd=%d" % (queue, txd_rxd, txd_rxd) - dev_path_mode_mapper = { - "sync_cbdma": '', - "cpu": '', - } - for key in dev_path_mode_mapper.items(): - if key == "cpu": - vhost_vdevs = f"'net_vhost0,iface=/tmp/s0,queues=1'" - self.launch_testpmd_as_vhost_user(eal_tx_rxd % (queue, txd_rxd, txd_rxd), self.cores[0:2], dev=vhost_vdevs, ports=[allow_pci[0]]) - vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % queue - self.launch_testpmd_as_virtio_user(compare_pvp_split_ring_performance, self.cores[2:4], dev=vdevs) - mode = "cpu_copy_64" - self.mode_list.append(mode) - self.send_and_verify(mode, frame_sizes=[64], pkt_length_mode='fixed') - perf_cpu_copy_64 = self.throughput[mode][64][self.nb_desc] - self.virtio_user.send_expect('show port stats all', 'testpmd> ', 10) - self.virtio_user.send_expect("quit", "# ") - self.vhost_user.send_expect("quit", "# ") - else: - self.launch_testpmd_as_vhost_user(eal_tx_rxd % (queue, txd_rxd, txd_rxd), self.cores[0:2],dev=vhost_vdevs % (queue), ports=allow_pci) - vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d,server=1'" % queue - self.launch_testpmd_as_virtio_user(compare_pvp_split_ring_performance, self.cores[2:4],dev=vdevs) - mode = "sync_copy_64" - self.mode_list.append(mode) - self.send_and_verify(mode,frame_sizes=[64],pkt_length_mode='fixed') - perf_sync_copy_64 = self.throughput[mode][64][self.nb_desc] - mode = "cbdma_copy_1518" - self.mode_list.append(mode) - self.send_and_verify(mode,frame_sizes=[1518],pkt_length_mode='fixed') - perf_cbdma_copy_1518 = self.throughput[mode][1518][self.nb_desc] - self.virtio_user.send_expect('show port stats all', 'testpmd> ', 10) - self.vhost_user.send_expect("quit", "# ") - time.sleep(3) - self.launch_testpmd_as_vhost_user(eal_tx_rxd % (queue, txd_rxd, txd_rxd), self.cores[0:2],dev=vhost_vdevs % (queue), ports=allow_pci) - mode = "sync_copy_1518" - self.mode_list.append(mode) - self.send_and_verify(mode,frame_sizes=[1518],pkt_length_mode='fixed') - perf_sync_copy_1518 = self.throughput[mode][1518][self.nb_desc] - self.check_port_stats_result(self.virtio_user) - self.virtio_user.send_expect("quit", "# ") - self.vhost_user.send_expect("quit", "# ") - self.result_table_print() - self.verify(abs(perf_sync_copy_64 - perf_cpu_copy_64)/perf_sync_copy_64 < 0.1, "sync_copy_64 vs. cpu_copy_64 delta > 10%" ) - self.verify(abs(perf_cbdma_copy_1518 - perf_sync_copy_1518)/perf_sync_copy_1518 > 0.05,"cbdma_copy_1518 vs sync_copy_1518 delta < 5%") - - @staticmethod - def vhost_or_virtio_set_one_queue(session): - session.send_expect('stop', 'testpmd> ', 120) - session.send_expect('port stop all', 'testpmd> ', 120) - session.send_expect('port config all rxq 1', 'testpmd> ', 120) - session.send_expect('port config all txq 1', 'testpmd> ', 120) - session.send_expect('port start all', 'testpmd> ', 120) - session.send_expect('start', 'testpmd> ', 120) - session.send_expect('show port info all', 'testpmd> ', 30) - session.send_expect('show port stats all', 'testpmd> ', 120) - time.sleep(5) + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores), self.cores[0:2], + dev=vhost_vdevs % (queues), ports=allow_pci, iova_mode='va', set_pmd_param=False) + self.launch_testpmd_as_virtio_user(virtio_param % (nb_cores, txd_rxd, txd_rxd, txq_rxq, txq_rxq), self.cores[2:4], + dev=virtio_dev % (queues), set_pmd_param=False) + self.send_chain_packets_and_verify() + + if not self.check_2M_env: + self.logger.info("Quit and relaunch vhost testpmd with PA mode") + self.pmdout_virtio_user.execute_cmd("quit", "#") + self.pmdout_vhost_user.execute_cmd("quit", "#") + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores), self.cores[0:2], + dev=vhost_vdevs % (queues), ports=allow_pci, iova_mode='pa', set_pmd_param=False) + self.launch_testpmd_as_virtio_user(virtio_param % (nb_cores, txd_rxd, txd_rxd, txq_rxq, txq_rxq),self.cores[2:4], + dev=virtio_dev % (queues), set_pmd_param=False) + self.send_chain_packets_and_verify() + + def test_loopback_packed_ring_large_chain_packets_stress_test_with_cbdma_enqueue(self): + """ + Test Case6: loopback packed ring large chain packets stress test with cbdma enqueue + """ + nb_cores = 1 + queues = 1 + txd_rxd = 2048 + txq_rxq = 1 + virtio_path = "/tmp/s0" + path_mode = 'mrg_rxbuf=1,in_order=0,vectorized=1,packed_vq=1,queue_size=2048' + self.get_cbdma_ports_info_and_bind_to_dpdk(1) + vhost_param = " --nb-cores=%d --mbuf-size=65535" + virtio_param = " --nb-cores=%d --txd=%d --rxd=%d --txq=%d --rxq=%d " + virtio_dev = f"net_virtio_user0,mac={self.virtio_mac},path={virtio_path},{path_mode},queues=%d" + vhost_vdevs = f"'net_vhost0,iface=/tmp/s0,queues=%d,dmas=[txq0@{self.device_str}]'" + allow_pci = [] + for index in range(1): + allow_pci.append(self.cbdma_dev_infos[index]) + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores), self.cores[0:2], + dev=vhost_vdevs % (queues), ports=allow_pci, iova_mode='va', set_pmd_param=False) + self.launch_testpmd_as_virtio_user(virtio_param % (nb_cores, txd_rxd, txd_rxd, txq_rxq, txq_rxq), self.cores[2:4], + dev=virtio_dev % (queues), set_pmd_param=False) + self.send_chain_packets_and_verify() + + if not self.check_2M_env: + self.logger.info("Quit and relaunch vhost testpmd with PA mode") + self.pmdout_virtio_user.execute_cmd("quit", "#") + self.pmdout_vhost_user.execute_cmd("quit", "#") + self.launch_testpmd_as_vhost_user(vhost_param % (nb_cores), self.cores[0:2], + dev=vhost_vdevs % (queues), ports=allow_pci, iova_mode='pa', set_pmd_param=False) + self.launch_testpmd_as_virtio_user(virtio_param % (nb_cores, txd_rxd, txd_rxd, txq_rxq, txq_rxq),self.cores[2:4], + dev=virtio_dev % (queues), set_pmd_param=False) + self.send_chain_packets_and_verify() - @property - def check_value(self): - check_dict = dict.fromkeys(self.frame_sizes) - linerate = {64: 0.085, 128: 0.12, 256: 0.20, 512: 0.35, 1024: 0.50, 1280: 0.55, 1518: 0.60} - for size in self.frame_sizes: - speed = self.wirespeed(self.nic, size, self.number_of_ports) - check_dict[size] = round(speed * linerate[size], 2) - return check_dict def send_imix_and_verify(self, mode, multiple_queue=True, queue_list=[]): """ @@ -529,7 +572,6 @@ class TestVirTioVhostCbdma(TestCase): results_row.append(throughput) self.result_table_add(results_row) if queue_list: - # check RX/TX can work normally in each queues self.check_packets_of_each_queue(queue_list=queue_list) def send_and_verify(self, mode, multiple_queue=True, queue_list=[], frame_sizes=None, pkt_length_mode='imix'): @@ -569,7 +611,6 @@ class TestVirTioVhostCbdma(TestCase): results_row.append(throughput) self.result_table_add(results_row) if queue_list: - # check RX/TX can work normally in each queues self.check_packets_of_each_queue(queue_list=queue_list) def handle_expected(self, mode_list): @@ -590,14 +631,6 @@ class TestVirTioVhostCbdma(TestCase): def handle_results(self, mode_list): """ results handled process: - 1, save to self.test_results - table_header = ['Frame', 'Mode/RXD-TXD', 'Mpps', '% linerate', 'nb_desc', 'Expected Throughput', 'Throughput Difference'] - ret_datas = {1024: {'Frame': 64, 'Mode/RXD-TXD': 'dynamic_queue2', 'Mpps': '7.537 Mpps', '% linerate': '12.662%', - 'nb_desc': 1024, 'Expected Throughput': '7.537 Mpps', 'Throughput Difference': '-0.000 Mpps'}} - self.test_result = {'dynamic_queue2': {64: {1024: {'Frame': 64, 'Mode/RXD-TXD': 'dynamic_queue2', 'Mpps': '7.537 Mpps', - '% linerate': '12.662%', 'nb_desc': 1024, 'Expected Throughput': '7.537 Mpps', 'Throughput Difference': '-0.000 Mpps'}}}} - 2, create test results table - 3, save to json file for Open Lab """ header = self.table_header header.append("nb_desc") @@ -704,12 +737,9 @@ class TestVirTioVhostCbdma(TestCase): def tear_down(self): """ Run after each test case. - Clear qemu and testpmd to avoid blocking the following TCs """ self.dut.send_expect("killall -I %s" % self.testpmd_name, '#', 20) self.bind_cbdma_device_to_kernel() - if self.running_case == 'test_check_threshold_value_with_cbdma': - self.bind_nic_driver(self.dut_ports, self.drivername) def tear_down_all(self): """ @@ -717,5 +747,4 @@ class TestVirTioVhostCbdma(TestCase): """ self.dut.close_session(self.vhost_user) self.dut.close_session(self.virtio_user) - self.dut.close_session(self.virtio_user1) self.dut.kill_all()