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 19207A0032; Wed, 17 Aug 2022 10:30:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13BCF40DDC; Wed, 17 Aug 2022 10:30:07 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 7DB704068E for ; Wed, 17 Aug 2022 10:30:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660725005; x=1692261005; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Vr7yzXHt3apulkMZIdaagWcyiR3ydjtk5R1a5pULGwk=; b=mxbMJmcEG/oQyEJ4KtK3TOOzQv/JFhph9d9qPa/3ElaWhzJWl3e8FdL7 vpCSMq5fcMm6Z5NuvV/zg4VfPy57tjfthTqzaUnDhkObdLdhcbA0mNV7W Fz3c8bz0OLBEWXubFtnV2HinanFi/2TvIpV8YFbBbo/0hJPJ/v40U2RNN lbmOVgAgk1AGyc5ADZREh2DeaycfahSA0HEzoJBdVnGI6r8j0MfOvewlT XDx8B3jKdGt6ZqJKDunbykKzMh0ix0THZKXIrSpC2YsCyZLJlpE72OZmH 9iTS2YFfRBMatscz1cedqCKzaWUUYiWskGt9EsG12Xs/9NGjhbRvJ0qD3 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10441"; a="292434835" X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208,223";a="292434835" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 01:30:04 -0700 X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208,223";a="603816238" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 01:30:02 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V5 2/2] tests/vm2vm_virtio_pmd_cbdma: modify testsuite to test virito dequeue Date: Wed, 17 Aug 2022 04:25:46 -0400 Message-Id: <20220817082546.4018827-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 | 516 ++++++++++++++++------ 1 file changed, 390 insertions(+), 126 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py b/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py index b926534e..b00d7b04 100644 --- a/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py +++ b/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py @@ -20,7 +20,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 +48,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 +92,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 +104,7 @@ class TestVM2VMVirtioPmdCbdma(TestCase): def start_vms( self, vm_queue, + mergeable=True, packed=False, server_mode=True, restart_vm1=False, @@ -152,14 +127,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 +155,37 @@ 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_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 +199,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 +295,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 +331,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 +411,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", "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=[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]'" ) - 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 +504,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_vm1_testpmd(resend=False) + 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", "virtio_dev_tx_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;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, + 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.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