From patchwork Tue Jan 19 16:23:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 86878 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 B7CB7A0A03; Tue, 19 Jan 2021 09:29:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 971D0140D38; Tue, 19 Jan 2021 09:29:26 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id F286C140D28 for ; Tue, 19 Jan 2021 09:29:24 +0100 (CET) IronPort-SDR: 8yXgsA8KGBC4K/5fwHNz44CwP0vwsO065ofpvIwVcKnZs6O2o/OhZ18RQ65J0CoUWGpte9+uO8 KvPDy9x/HgtQ== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="176323544" X-IronPort-AV: E=Sophos;i="5.79,358,1602572400"; d="scan'208";a="176323544" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 00:29:18 -0800 IronPort-SDR: Rjcyk8VsGt1XHeojqwqeWxLeDjUAt3f6OdUsaw9u32iOzleVGPw7Zri1YZTjWsmlxdMUrvXiSV GRIoYVLBYprQ== X-IronPort-AV: E=Sophos;i="5.79,358,1602572400"; d="scan'208";a="383846080" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 00:29:16 -0800 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Tue, 19 Jan 2021 16:23:43 +0000 Message-Id: <20210119162343.1262746-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1] tests/vhost_cbdma:Add allow pci option when start testpmd 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" 1.add allow pci option when start testpmd. 2.insmod igb_uio before bind cbdma device to igb_uio. Signed-off-by: Ling Wei Tested-by: Wei Ling --- tests/TestSuite_vhost_cbdma.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py index 977f2905..78d5523b 100644 --- a/tests/TestSuite_vhost_cbdma.py +++ b/tests/TestSuite_vhost_cbdma.py @@ -159,6 +159,7 @@ class TestVirTioVhostCbdma(TestCase): self.used_cbdma = self.cbdma_dev_infos[0:cbdma_num] self.device_str = ' '.join(self.used_cbdma) + self.dut.setup_modules(self.target, "igb_uio", "None") self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s %s' % ("igb_uio", self.device_str, self.pci_info), '# ', 60) @@ -202,7 +203,7 @@ class TestVirTioVhostCbdma(TestCase): 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], + self.pmdout_vhost_user.start_testpmd(cores=cores, param=command, vdevs=[dev], ports=ports, prefix="vhost", fixed_prefix=True) self.vhost_user.send_expect('set fwd mac', 'testpmd> ', 120) @@ -263,8 +264,11 @@ class TestVirTioVhostCbdma(TestCase): 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): + 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, dmathr), ports=self.dut_ports[0]) + dev=vhost_vdevs % (queue, dmathr), ports=allow_pci) for key, path_mode in dev_path_mode_mapper.items(): if key == "vector_rx_path": @@ -317,8 +321,12 @@ class TestVirTioVhostCbdma(TestCase): vhost_dev = f"'net_vhost0,iface={virtio_path},queues={queue},client=1,%s'" # launch vhost testpmd + allow_pci = [self.dut.ports_info[0]['pci']] + for index in range(used_cbdma_num): + if index < used_cbdma_num / 2: + allow_pci.append(self.cbdma_dev_infos[index]) self.launch_testpmd_as_vhost_user(eal_params, self.cores[0:2], - dev=vhost_dev % vhost_dmas, ports=self.dut_ports[0]) + dev=vhost_dev % vhost_dmas, ports=allow_pci) # # queue 2 start virtio testpmd, check perforamnce and RX/TX mode = "dynamic_queue2" @@ -358,8 +366,12 @@ class TestVirTioVhostCbdma(TestCase): self.mode_list.append(mode) dmathr = 512 vhost_dmas = f"dmas=[txq0@{self.used_cbdma[2]};txq1@{self.used_cbdma[3]}],dmathr={dmathr}" + allow_pci = [self.dut.ports_info[0]['pci']] + for index in range(used_cbdma_num): + if index >= used_cbdma_num / 2: + allow_pci.append(self.cbdma_dev_infos[index]) self.launch_testpmd_as_vhost_user(eal_params, self.cores[0:2], - dev=vhost_dev % vhost_dmas, ports=self.dut_ports[0]) + dev=vhost_dev % vhost_dmas, ports=allow_pci) self.virtio_user.send_expect("clear port stats all", "testpmd> ", 30) self.send_and_verify(mode, queue_list=range(queue)) self.check_port_stats_result(self.virtio_user) @@ -388,7 +400,10 @@ class TestVirTioVhostCbdma(TestCase): virtio_dev0 = f"net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net0,queues=2,server=1,packed_vq=0,mrg_rxbuf=1,in_order=0,queue_size=4096" virtio_dev1 = f"net_virtio_user1,mac=00:01:02:03:04:05,path=./vhost-net1,queues=2,server=1,packed_vq=0,mrg_rxbuf=1,in_order=0,queue_size=4096" vdev_params = '{} --vdev {}'.format(vhost_vdev[0], vhost_vdev[1]) - self.pmdout_vhost_user.start_testpmd(cores=self.cores[0:2], param=params, vdevs=[vdev_params], ports=[], prefix="vhost", fixed_prefix=True) + allow_pci = [] + for index in range(used_cbdma_num): + allow_pci.append(self.cbdma_dev_infos[index]) + self.pmdout_vhost_user.start_testpmd(cores=self.cores[0:2], param=params, vdevs=[vdev_params], ports=allow_pci, prefix="vhost", fixed_prefix=True) self.vhost_user.send_expect('start', 'testpmd> ', 120) # vid0,qid0,dma2,threshold:4096 self.launch_testpmd_as_virtio_user1(params, self.cores[2:4], dev=virtio_dev1)