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 270D5A0C47; Mon, 26 Jul 2021 08:24:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1720F40F35; Mon, 26 Jul 2021 08:24:07 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 1E63B40DDA for ; Mon, 26 Jul 2021 08:24:04 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10056"; a="199409440" X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="199409440" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2021 23:24:03 -0700 X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="515971799" Received: from unknown (HELO localhost.localdomain) ([10.240.183.217]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2021 23:24:01 -0700 From: Xie Dechun To: dts@dpdk.org Cc: Xie Dechun Date: Mon, 26 Jul 2021 14:17:59 +0800 Message-Id: <20210726061759.79439-1-dechunx.xie@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V2] tests/vm2vm_virtio_pmd: add testcases sync with testplan 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 Sender: "dts" v1: Add testcases sync with testplan. v2: Remove dequeue parameter in case 9 and 10. Signed-off-by: Xie Dechun --- tests/TestSuite_vm2vm_virtio_pmd.py | 62 +++++++++++++++++------------ 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_pmd.py b/tests/TestSuite_vm2vm_virtio_pmd.py index 0cc992a0..44f17a36 100644 --- a/tests/TestSuite_vm2vm_virtio_pmd.py +++ b/tests/TestSuite_vm2vm_virtio_pmd.py @@ -48,6 +48,8 @@ from pmd_output import PmdOutput class TestVM2VMVirtioPMD(TestCase): def set_up_all(self): + self.dut_ports = self.dut.get_ports() + self.bind_nic_driver(self.dut_ports) self.memory_channel = self.dut.get_memory_channels() self.vm_num = 2 self.dump_pcap = "/root/pdump-rx.pcap" @@ -437,34 +439,35 @@ class TestVM2VMVirtioPMD(TestCase): def test_vhost_vm2vm_virtio_split_ring_with_mergeable_path_cbdma_enabled(self): """ - Test Case 9: VM2VM virtio-pmd split ring mergeable path 4 queues CBDMA enable with server mode stable test + Test Case 9: VM2VM virtio-pmd split ring mergeable path 8 queues CBDMA enable with server mode stable test """ self.nb_cores = 4 self.get_core_list(self.nb_cores + 1) - self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=4, allow_diff_socket=True) - self.logger.info("Launch vhost-testpmd with CBDMA and used 4 queue") - self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=4, nb_cores=4, - server_mode=True, opt_queue=4, combined=True, rxq_txq=4) + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True) + self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue") + self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, + server_mode=True, opt_queue=8, combined=True, rxq_txq=8) self.logger.info("Launch testpmd in VM1") - self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="4") + self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8") self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30) self.vm_dut[0].send_expect('start', 'testpmd> ', 30) self.logger.info("Launch testpmd in VM2, sent imix pkts from VM2") - self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="4") + self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8") + self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30) self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,2000,64,256,512,1024,2000', 'testpmd> ', 30) self.vm_dut[1].send_expect('start tx_first 1', 'testpmd> ', 30) self.logger.info("Check imix packets") - self.check_port_stats_result(self.vm_dut[0], queue_num=4) - self.check_port_stats_result(self.vm_dut[1], queue_num=4) + self.check_port_stats_result(self.vm_dut[0], queue_num=8) + self.check_port_stats_result(self.vm_dut[1], queue_num=8) self.logger.info("Relaunch vhost side testpmd and Check imix packets 10 times") for _ in range(10): self.pmd_vhost.execute_cmd('quit', '#') - self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=4, nb_cores=4, - rxq_txq=4) + self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, + rxq_txq=8) self.vm_dut[1].send_expect('stop', 'testpmd> ', 30) self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30) - self.check_port_stats_result(self.vm_dut[0], queue_num=4) - self.check_port_stats_result(self.vm_dut[1], queue_num=4) + self.check_port_stats_result(self.vm_dut[0], queue_num=8) + self.check_port_stats_result(self.vm_dut[1], queue_num=8) def test_vhost_vm2vm_split_ring_with_mergeable_path_and_server_mode_cbdma_enabled(self): """ @@ -472,30 +475,30 @@ class TestVM2VMVirtioPMD(TestCase): """ self.nb_cores = 4 self.get_core_list(self.nb_cores + 1) - self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=4, allow_diff_socket=True) - self.logger.info("Launch vhost-testpmd with CBDMA and used 4 queue") - self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=4, nb_cores=4, - server_mode=True, opt_queue=4, combined=True, rxq_txq=4) + self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True) + self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue") + self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, + server_mode=True, opt_queue=8, combined=True, rxq_txq=8) self.logger.info("Launch testpmd in VM1") - self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="4") + self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8") self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30) self.vm_dut[0].send_expect('start', 'testpmd> ', 30) self.logger.info("Launch testpmd in VM2 and send imix pkts") - self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="4") + self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8") self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30) self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,2000,64,256,512,1024,2000', 'testpmd> ', 30) self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30) self.logger.info("Check imix packets") - self.check_port_stats_result(self.vm_dut[0], queue_num=4) - self.check_port_stats_result(self.vm_dut[1], queue_num=4) + self.check_port_stats_result(self.vm_dut[0], queue_num=8) + self.check_port_stats_result(self.vm_dut[1], queue_num=8) self.logger.info("Relaunch vhost side testpmd and Check imix packets 10 times") self.pmd_vhost.execute_cmd('quit', '#') - self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=4, nb_cores=4, - rxq_txq=4) + self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, + rxq_txq=8) self.vm_dut[1].send_expect('stop', 'testpmd> ', 30) self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30) - self.check_port_stats_result(self.vm_dut[0], queue_num=4) - self.check_port_stats_result(self.vm_dut[1], queue_num=4) + self.check_port_stats_result(self.vm_dut[0], queue_num=8) + self.check_port_stats_result(self.vm_dut[1], queue_num=8) def test_vhost_vm2vm_packed_ring_with_mergeable_path_and_8queues_cbdma_enabled(self): """ @@ -723,6 +726,15 @@ class TestVM2VMVirtioPMD(TestCase): self.dut.send_expect('./usertools/dpdk-devbind.py -u %s' % self.device_str, '# ', 30) self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=ioatdma %s' % self.device_str, '# ', 60) + def bind_nic_driver(self, ports, driver=""): + for port in ports: + netdev = self.dut.ports_info[port]['port'] + driver_now = netdev.get_nic_driver() + if driver == "": + driver = netdev.default_driver + if driver != driver_now: + netdev.bind_driver(driver=driver) + def tear_down(self): # # Run after each test case. -- 2.17.1