From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CF3CA04FD; Fri, 29 Jul 2022 09:32:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A85442C0C; Fri, 29 Jul 2022 09:32:29 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 6AF6C40151 for ; Fri, 29 Jul 2022 09:32: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=1659079947; x=1690615947; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zltdxH/ewgfGonkznhz0efVH6fJ93x/PfGTGlyy+DJ4=; b=ad6dXHRnoIMgK/iZOfgA0w+pg2BTeMBnvX5fOvpHufWW6VaIja6TXhBB EygP/h43y7cvtCi7OjcocwXNZsEd48x/43ZLvQhLz6LdLX0/9Fwm/8Tyg ngRa5/46LHB1KAy4UrTkK08pk7dv2qz6MQmEp1qLiKD513lfpWEvj1HY/ 9rnUFKgyroZZIo7MuOxwzoxmgJ3UyOeEmwORxhbJ2gQpv6Ca+w22Z9acR /GFQWrOow4KIAKXNYhkImjyaLkFOO6eoyQcN+F2Y025V+czuWQPBepG4G fktrS1lIN0XVv5eff2Pyb4ZwXQtOTb04ZNX67hhnvhf12utR6gxM6xU+X Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10422"; a="314512436" X-IronPort-AV: E=Sophos;i="5.93,200,1654585200"; d="scan'208,223";a="314512436" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2022 00:32:26 -0700 X-IronPort-AV: E=Sophos;i="5.93,200,1654585200"; d="scan'208,223";a="598177261" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2022 00:32:24 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 2/2] tests/vm2vm_virtio_pmd_cbdma: modify testsuite to test virito dequeue Date: Fri, 29 Jul 2022 03:27:28 -0400 Message-Id: <20220729072728.1007912-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org >From DPDK-22.07, virtio support async dequeue for split and packed ring path, so modify vm2vm_virtio_pmd_cbdma testsuite to test the split and packed ring async dequeue feature. Signed-off-by: Wei Ling --- tests/TestSuite_vm2vm_virtio_pmd_cbdma.py | 546 +++++++++++++++++----- 1 file changed, 420 insertions(+), 126 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py b/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py index b926534e..f64032e2 100644 --- a/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py +++ b/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py @@ -1,6 +1,31 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2022 Intel Corporation # +# 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. @@ -20,7 +45,7 @@ from framework.test_case import TestCase from framework.virt_common import VM -class TestVM2VMVirtioPmdCbdma(TestCase): +class TestVM2VMVirtioPmdCBDMA(TestCase): def set_up_all(self): self.dut_ports = self.dut.get_ports() self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) @@ -48,6 +73,7 @@ class TestVM2VMVirtioPmdCbdma(TestCase): self.result_table_create(self.table_header) self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + self.dut.send_expect("killall -s INT perf", "#") self.dut.send_expect("rm -rf %s/vhost-net*" % self.base_dir, "#") self.vm_num = 2 self.vm_dut = [] @@ -91,33 +117,6 @@ class TestVM2VMVirtioPmdCbdma(TestCase): 60, ) - @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 - - @staticmethod - def generate_lcore_dma_param(cbdma_list, core_list): - group_num = int(len(cbdma_list) / len(core_list)) - lcore_dma_list = [] - if len(cbdma_list) == 1: - for core in core_list: - lcore_dma_list.append("lcore{}@{}".format(core, cbdma_list[0])) - elif len(core_list) == 1: - for cbdma in cbdma_list: - lcore_dma_list.append("lcore{}@{}".format(core_list[0], cbdma)) - else: - for cbdma in cbdma_list: - core_list_index = int(cbdma_list.index(cbdma) / group_num) - lcore_dma_list.append( - "lcore{}@{}".format(core_list[core_list_index], cbdma) - ) - lcore_dma_param = "[{}]".format(",".join(lcore_dma_list)) - return lcore_dma_param - def start_vhost_testpmd(self, cores, ports, prefix, eal_param, param): """ launch the testpmd with different parameters @@ -130,6 +129,7 @@ class TestVM2VMVirtioPmdCbdma(TestCase): def start_vms( self, vm_queue, + mergeable=True, packed=False, server_mode=True, restart_vm1=False, @@ -152,14 +152,22 @@ class TestVM2VMVirtioPmdCbdma(TestCase): else: vm_params["opt_path"] = self.base_dir + "/vhost-net%d" % i + ",server" vm_params["opt_mac"] = "52:54:00:00:00:0%d" % (i + 1) - if not packed: + if mergeable: + mrg_rxbuf = "on" + else: + mrg_rxbuf = "off" + if packed: vm_params[ "opt_settings" - ] = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on" + ] = "disable-modern=false,mrg_rxbuf={},mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on,packed=on".format( + mrg_rxbuf + ) else: vm_params[ "opt_settings" - ] = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on,packed=on" + ] = "disable-modern=false,mrg_rxbuf={},mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on".format( + mrg_rxbuf + ) vm_info.set_vm_device(**vm_params) time.sleep(3) try: @@ -172,32 +180,42 @@ class TestVM2VMVirtioPmdCbdma(TestCase): self.vm_dut.append(vm_dut) self.vm.append(vm_info) - def start_vm0_testpmd(self): - param = "--tx-offloads=0x00 --enable-hw-vlan-strip --txq=8 --rxq=8 --txd=1024 --rxd=1024 --max-pkt-len=9600 --rx-offloads=0x00002000" - self.vm0_pmd.start_testpmd(cores="default", param=param) - self.vm0_pmd.execute_cmd("set fwd mac") - self.vm0_pmd.execute_cmd("start") - - def start_vm1_testpmd(self, resend=False): - param = "--tx-offloads=0x00 --enable-hw-vlan-strip --txq=8 --rxq=8 --txd=1024 --rxd=1024 --max-pkt-len=9600 --rx-offloads=0x00002000" - if not resend: - self.vm1_pmd.start_testpmd(cores="default", param=param) - self.vm1_pmd.execute_cmd("set fwd mac") - self.vm1_pmd.execute_cmd( - "set txpkts 64,256,512,1024,2000,64,256,512,1024,2000" + def start_vm_testpmd(self, vm_pmd, queues, mergeable=True): + if mergeable: + param = "--enable-hw-vlan-strip --txq={} --rxq={} --txd=1024 --rxd=1024 --max-pkt-len=9600 --tx-offloads=0x00 --rx-offloads=0x00002000".format( + queues, queues ) - self.vm1_pmd.execute_cmd("start tx_first 1") else: - self.vm1_pmd.execute_cmd("stop") - self.vm0_pmd.execute_cmd("start") - self.vm0_pmd.execute_cmd("clear port stats all") - self.vhost_user_pmd.execute_cmd("clear port stats all") - self.vm1_pmd.execute_cmd("clear port stats all") - self.vm1_pmd.execute_cmd("start tx_first 1") + param = "--enable-hw-vlan-strip --txq={} --rxq={} --txd=1024 --rxd=1024 --tx-offloads=0x00".format( + queues, queues + ) + vm_pmd.start_testpmd(cores="default", param=param) + vm_pmd.execute_cmd("set fwd mac") + + def send_big_imix_packets_from_vm1(self): + self.vm1_pmd.execute_cmd("set txpkts 64,256,512,1024,2000,64,256,512,1024,2000") + self.vm1_pmd.execute_cmd("start tx_first 32") + self.vm1_pmd.execute_cmd("show port stats all") + + def send_small_imix_packets_from_vm1(self): + self.vm1_pmd.execute_cmd("set txpkts 64,256,512") + self.vm1_pmd.execute_cmd("start tx_first 32") + self.vm1_pmd.execute_cmd("show port stats all") + + def send_small_imix_packets_from_vm1(self): + self.vm1_pmd.execute_cmd("set txpkts 64,256,512") + self.vm1_pmd.execute_cmd("start tx_first 32") + self.vm1_pmd.execute_cmd("show port stats all") + + def send_64b_packets_from_vm1(self): + self.vm1_pmd.execute_cmd("stop") + self.vm1_pmd.execute_cmd("start tx_first 32") + self.vm1_pmd.execute_cmd("show port stats all") def check_packets_of_each_queue(self, vm_pmd, queues): vm_pmd.execute_cmd("show port stats all") out = vm_pmd.execute_cmd("stop") + self.logger.info(out) for queue in range(queues): reg = "Queue= %d" % queue index = out.find(reg) @@ -211,28 +229,94 @@ class TestVM2VMVirtioPmdCbdma(TestCase): + "rx-packets: {}, tx-packets: {}".format(rx_packets, tx_packets), ) - def test_vm2vm_virtio_pmd_split_ring_mergeable_path_8_queues_cbdma_enable_with_server_mode_stable_test( + def dynamic_change_queue_size(self, dut_pmd, queues): + dut_pmd.execute_cmd("stop") + dut_pmd.execute_cmd("port stop all") + dut_pmd.execute_cmd("port config all rxq {}".format(queues)) + dut_pmd.execute_cmd("port config all txq {}".format(queues)) + dut_pmd.execute_cmd("port start all") + dut_pmd.execute_cmd("start") + + def get_and_verify_func_name_of_perf_top(self, func_name_list): + self.dut.send_expect("rm -fr perf_top.log", "# ", 120) + self.dut.send_expect("perf top > perf_top.log", "", 120) + time.sleep(10) + self.dut.send_expect("^C", "#") + out = self.dut.send_expect("cat perf_top.log", "# ", 120) + self.logger.info(out) + for func_name in func_name_list: + self.verify( + func_name in out, + "the func_name {} is not in the perf top output".format(func_name), + ) + + def test_vm2vm_virtio_pmd_split_ring_mergeable_path_dynamic_queue_size_with_cbdma_enable_and_server_mode( self, ): """ - Test Case 1: VM2VM virtio-pmd split ring mergeable path 8 queues CBDMA enable with server mode stable test + Test Case 1: VM2VM virtio-pmd split ring mergeable path dynamic queue size with cbdma enable and server mode """ + self.check_path = ["virtio_dev_rx_async", "virtio_dev_tx_async"] self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, allow_diff_socket=True) - dmas = self.generate_dms_param(8) - lcore_dma = self.generate_lcore_dma_param( - cbdma_list=self.cbdma_list, core_list=self.vhost_core_list[1:] + lcore_dma = ( + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s" + % ( + self.vhost_core_list[1], + self.cbdma_list[0], + self.vhost_core_list[1], + self.cbdma_list[1], + self.vhost_core_list[1], + self.cbdma_list[2], + self.vhost_core_list[1], + self.cbdma_list[3], + self.vhost_core_list[2], + self.cbdma_list[4], + self.vhost_core_list[2], + self.cbdma_list[5], + self.vhost_core_list[2], + self.cbdma_list[6], + self.vhost_core_list[2], + self.cbdma_list[7], + self.vhost_core_list[3], + self.cbdma_list[8], + self.vhost_core_list[3], + self.cbdma_list[9], + self.vhost_core_list[3], + self.cbdma_list[10], + self.vhost_core_list[3], + self.cbdma_list[11], + self.vhost_core_list[4], + self.cbdma_list[12], + self.vhost_core_list[4], + self.cbdma_list[13], + self.vhost_core_list[4], + self.cbdma_list[14], + self.vhost_core_list[4], + self.cbdma_list[15], + ) ) eal_param = ( - "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas={}'".format( - dmas - ) - + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas={}'".format( - dmas - ) + "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;rxq0;rxq1;rxq2;rxq3]'" + + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;rxq0;rxq1;rxq2;rxq3]'" ) param = ( - "--nb-cores=4 --txd=1024 --rxd=1024 --rxq=8 --txq=8" - + " --lcore-dma={}".format(lcore_dma) + "--nb-cores=4 --txd=1024 --rxd=1024 --rxq=4 --txq=4" + + " --lcore-dma=[%s]" % lcore_dma ) self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -241,16 +325,35 @@ class TestVM2VMVirtioPmdCbdma(TestCase): eal_param=eal_param, param=param, ) - self.start_vms(vm_queue=8, packed=False, server_mode=True) + self.start_vms(vm_queue=8, mergeable=True, packed=False, server_mode=True) self.vm0_pmd = PmdOutput(self.vm_dut[0]) self.vm1_pmd = PmdOutput(self.vm_dut[1]) - self.start_vm0_testpmd() - self.start_vm1_testpmd(resend=False) + self.start_vm_testpmd(vm_pmd=self.vm0_pmd, queues=8, mergeable=True) + self.vm0_pmd.execute_cmd("start") + self.start_vm_testpmd(vm_pmd=self.vm1_pmd, queues=8, mergeable=True) + self.send_big_imix_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) + self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=4) + self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=4) + + self.dynamic_change_queue_size(dut_pmd=self.vhost_user_pmd, queues=8) + self.vm0_pmd.execute_cmd("start") + self.send_64b_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=8) self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=8) - for _ in range(10): + + for _ in range(5): self.logger.info("Quit and relaunch vhost side testpmd") - self.vhost_user_pmd.execute_cmd("quit", "#") + self.vhost_user_pmd.quit() + eal_param = ( + "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'" + + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'" + ) + param = ( + "--nb-cores=4 --txd=1024 --rxd=1024 --rxq=8 --txq=8" + + " --lcore-dma=[%s]" % lcore_dma + ) self.start_vhost_testpmd( cores=self.vhost_core_list, ports=self.cbdma_list, @@ -258,32 +361,78 @@ class TestVM2VMVirtioPmdCbdma(TestCase): eal_param=eal_param, param=param, ) - self.start_vm1_testpmd(resend=True) + self.vm0_pmd.execute_cmd("start") + self.send_64b_packets_from_vm1() self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=8) self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=8) - def test_vm2vm_virtio_pmd_split_ring_mergeable_path_dynamic_queue_size_cbdma_enable_with_server_mode_test( + def test_vm2vm_virtio_pmd_split_ring_non_mergeable_path_dynamic_queue_size_with_cbdma_enable_and_server_mode( self, ): """ - Test Case 2: VM2VM virtio-pmd split ring mergeable path dynamic queue size CBDMA enable with server mode test + Test Case 2: VM2VM virtio-pmd split ring non-mergeable path dynamic queue size with cbdma enable and server mode """ + self.check_path = ["virtio_dev_rx_async", "virtio_dev_tx_async"] self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, allow_diff_socket=True) - dmas = self.generate_dms_param(4) - lcore_dma = self.generate_lcore_dma_param( - cbdma_list=self.cbdma_list, core_list=self.vhost_core_list[1:] + lcore_dma = ( + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s" + % ( + self.vhost_core_list[1], + self.cbdma_list[0], + self.vhost_core_list[1], + self.cbdma_list[1], + self.vhost_core_list[1], + self.cbdma_list[2], + self.vhost_core_list[1], + self.cbdma_list[3], + self.vhost_core_list[2], + self.cbdma_list[4], + self.vhost_core_list[2], + self.cbdma_list[5], + self.vhost_core_list[2], + self.cbdma_list[6], + self.vhost_core_list[2], + self.cbdma_list[7], + self.vhost_core_list[3], + self.cbdma_list[8], + self.vhost_core_list[3], + self.cbdma_list[9], + self.vhost_core_list[3], + self.cbdma_list[10], + self.vhost_core_list[3], + self.cbdma_list[11], + self.vhost_core_list[4], + self.cbdma_list[12], + self.vhost_core_list[4], + self.cbdma_list[13], + self.vhost_core_list[4], + self.cbdma_list[14], + self.vhost_core_list[4], + self.cbdma_list[15], + ) ) eal_param = ( - "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas={}'".format( - dmas - ) - + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas={}'".format( - dmas - ) + "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;rxq0;rxq1;rxq2;rxq3]'" + + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;rxq0;rxq1;rxq2;rxq3]'" ) param = ( - " --nb-cores=4 --txd=1024 --rxd=1024 --rxq=4 --txq=4" - + " --lcore-dma={}".format(lcore_dma) + "--nb-cores=4 --txd=1024 --rxd=1024 --rxq=4 --txq=4" + + " --lcore-dma=[%s]" % lcore_dma ) self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -292,54 +441,91 @@ class TestVM2VMVirtioPmdCbdma(TestCase): eal_param=eal_param, param=param, ) - self.start_vms(vm_queue=8, packed=False, server_mode=True) + self.start_vms(vm_queue=8, mergeable=False, packed=False, server_mode=True) self.vm0_pmd = PmdOutput(self.vm_dut[0]) self.vm1_pmd = PmdOutput(self.vm_dut[1]) - self.start_vm0_testpmd() - self.start_vm1_testpmd(resend=False) + self.start_vm_testpmd(vm_pmd=self.vm0_pmd, queues=8, mergeable=False) + self.vm0_pmd.execute_cmd("start") + self.start_vm_testpmd(vm_pmd=self.vm1_pmd, queues=8, mergeable=False) + self.send_small_imix_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) + self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=4) + self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=4) + + self.dynamic_change_queue_size(dut_pmd=self.vm0_pmd, queues=4) + self.dynamic_change_queue_size(dut_pmd=self.vm1_pmd, queues=4) + self.send_64b_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=4) self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=4) - for _ in range(10): - self.logger.info("Quit and relaunch vhost side testpmd with 8 queues") - self.vhost_user_pmd.execute_cmd("quit", "#") - dmas = self.generate_dms_param(8) - eal_param = "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas={}'".format( - dmas - ) + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas={}'".format( - dmas - ) - param = ( - " --nb-cores=4 --txd=1024 --rxd=1024 --rxq=8 --txq=8" - + " --lcore-dma={}".format(lcore_dma) - ) - self.start_vhost_testpmd( - cores=self.vhost_core_list, - ports=self.cbdma_list, - prefix="vhost", - eal_param=eal_param, - param=param, - ) - self.start_vm1_testpmd(resend=True) - self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=8) - self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=8) - def test_vm2vm_virtio_pmd_packed_ring_mergeable_path_8_queues_cbdma_enable_test( + def test_vm2vm_virtio_pmd_packed_ring_mergeable_path_dynamic_queue_size_with_cbdma_enable_and_server_mode( self, ): """ - Test Case 3: VM2VM virtio-pmd packed ring mergeable path 8 queues CBDMA enable test + Test Case 3: VM2VM virtio-pmd packed ring mergeable path dynamic queue size with cbdma enable and server mode """ + self.check_path = ["virtio_dev_rx_async"] self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, allow_diff_socket=True) - dmas = self.generate_dms_param(8) - lcore_dma = self.generate_lcore_dma_param( - cbdma_list=self.cbdma_list, core_list=self.vhost_core_list[1:] + lcore_dma = ( + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s" + % ( + self.vhost_core_list[1], + self.cbdma_list[0], + self.vhost_core_list[1], + self.cbdma_list[1], + self.vhost_core_list[1], + self.cbdma_list[2], + self.vhost_core_list[1], + self.cbdma_list[3], + self.vhost_core_list[2], + self.cbdma_list[4], + self.vhost_core_list[2], + self.cbdma_list[5], + self.vhost_core_list[2], + self.cbdma_list[6], + self.vhost_core_list[2], + self.cbdma_list[7], + self.vhost_core_list[3], + self.cbdma_list[8], + self.vhost_core_list[3], + self.cbdma_list[9], + self.vhost_core_list[3], + self.cbdma_list[10], + self.vhost_core_list[3], + self.cbdma_list[11], + self.vhost_core_list[4], + self.cbdma_list[12], + self.vhost_core_list[4], + self.cbdma_list[13], + self.vhost_core_list[4], + self.cbdma_list[14], + self.vhost_core_list[4], + self.cbdma_list[15], + ) + ) + eal_param = ( + "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;txq6;txq7]'" + + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;txq6;txq7]'" ) - eal_param = "--vdev 'net_vhost0,iface=vhost-net0,queues=8,dmas={}'".format( - dmas - ) + " --vdev 'net_vhost1,iface=vhost-net1,queues=8,dmas={}'".format(dmas) param = ( - " --nb-cores=4 --txd=1024 --rxd=1024 --rxq=8 --txq=8" - + " --lcore-dma={}".format(lcore_dma) + "--nb-cores=4 --txd=1024 --rxd=1024 --rxq=4 --txq=4" + + " --lcore-dma=[%s]" % lcore_dma ) self.start_vhost_testpmd( cores=self.vhost_core_list, @@ -348,22 +534,130 @@ class TestVM2VMVirtioPmdCbdma(TestCase): eal_param=eal_param, param=param, ) - self.start_vms(vm_queue=8, packed=True, server_mode=False) + self.start_vms(vm_queue=8, mergeable=True, packed=True, server_mode=True) self.vm0_pmd = PmdOutput(self.vm_dut[0]) self.vm1_pmd = PmdOutput(self.vm_dut[1]) - self.start_vm0_testpmd() - self.start_vm1_testpmd(resend=False) - self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=8) - self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=8) + self.start_vm_testpmd(vm_pmd=self.vm0_pmd, queues=8, mergeable=True) + self.vm0_pmd.execute_cmd("start") + self.start_vm_testpmd(vm_pmd=self.vm1_pmd, queues=8, mergeable=True) + self.send_big_imix_packets_from_vm1() + self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=4) + self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=4) + self.logger.info("Quit and relaunch VM2 with split ring") self.vm1_pmd.execute_cmd("quit", "#") self.vm[1].stop() self.vm_dut.remove(self.vm_dut[1]) self.vm.remove(self.vm[1]) - self.start_vms(vm_queue=8, packed=False, restart_vm1=True, server_mode=False) + self.start_vms( + vm_queue=8, mergeable=True, packed=False, restart_vm1=True, server_mode=True + ) + self.vm1_pmd = PmdOutput(self.vm_dut[1]) + self.vm0_pmd.execute_cmd("start") + self.start_vm_testpmd(vm_pmd=self.vm1_pmd, queues=8) + self.send_big_imix_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) + self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=4) + self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=4) + + self.dynamic_change_queue_size(dut_pmd=self.vhost_user_pmd, queues=8) + self.vm0_pmd.execute_cmd("start") + self.send_64b_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) + self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=8) + self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=8) + + def test_vm2vm_virtio_pmd_packed_ring_non_mergeable_path_dynamic_queue_size_with_cbdma_enable_and_server_mode( + self, + ): + """ + Test Case 4: VM2VM virtio-pmd packed ring non-mergeable path dynamic queue size with cbdma enable and server mode + """ + self.check_path = ["virtio_dev_rx_async"] + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, allow_diff_socket=True) + lcore_dma = ( + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s," + "lcore%s@%s" + % ( + self.vhost_core_list[1], + self.cbdma_list[0], + self.vhost_core_list[1], + self.cbdma_list[1], + self.vhost_core_list[1], + self.cbdma_list[2], + self.vhost_core_list[1], + self.cbdma_list[3], + self.vhost_core_list[2], + self.cbdma_list[4], + self.vhost_core_list[2], + self.cbdma_list[5], + self.vhost_core_list[2], + self.cbdma_list[6], + self.vhost_core_list[2], + self.cbdma_list[7], + self.vhost_core_list[3], + self.cbdma_list[8], + self.vhost_core_list[3], + self.cbdma_list[9], + self.vhost_core_list[3], + self.cbdma_list[10], + self.vhost_core_list[3], + self.cbdma_list[11], + self.vhost_core_list[4], + self.cbdma_list[12], + self.vhost_core_list[4], + self.cbdma_list[13], + self.vhost_core_list[4], + self.cbdma_list[14], + self.vhost_core_list[4], + self.cbdma_list[15], + ) + ) + eal_param = ( + "--vdev 'net_vhost0,iface=vhost-net0,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;txq5;txq6;txq7]'" + + " --vdev 'net_vhost1,iface=vhost-net1,client=1,queues=8,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;txq5;txq6;txq7]'" + ) + param = ( + "--nb-cores=4 --txd=1024 --rxd=1024 --rxq=8 --txq=8" + + " --lcore-dma=[%s]" % lcore_dma + ) + self.start_vhost_testpmd( + cores=self.vhost_core_list, + ports=self.cbdma_list, + prefix="vhost", + eal_param=eal_param, + param=param, + ) + self.start_vms(vm_queue=8, mergeable=False, packed=True, server_mode=True) + self.vm0_pmd = PmdOutput(self.vm_dut[0]) self.vm1_pmd = PmdOutput(self.vm_dut[1]) + self.start_vm_testpmd(vm_pmd=self.vm0_pmd, queues=4, mergeable=False) + self.vm0_pmd.execute_cmd("start") + self.start_vm_testpmd(vm_pmd=self.vm1_pmd, queues=4, mergeable=False) + self.send_small_imix_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) + self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=4) + self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=4) + + self.dynamic_change_queue_size(self.vm0_pmd, queues=8) + self.dynamic_change_queue_size(self.vm1_pmd, queues=8) self.vm0_pmd.execute_cmd("start") - self.start_vm1_testpmd(resend=False) + self.send_64b_packets_from_vm1() + self.get_and_verify_func_name_of_perf_top(self.check_path) self.check_packets_of_each_queue(vm_pmd=self.vm0_pmd, queues=8) self.check_packets_of_each_queue(vm_pmd=self.vm1_pmd, queues=8) -- 2.25.1