From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EB9D32C24 for ; Mon, 11 Mar 2019 04:36:28 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2019 20:36:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,466,1544515200"; d="scan'208";a="197992264" Received: from nfvihost.sh.intel.com ([10.239.183.73]) by orsmga001.jf.intel.com with ESMTP; 10 Mar 2019 20:36:27 -0700 From: michael.luo@intel.com To: dts@dpdk.org Date: Mon, 11 Mar 2019 11:33:13 +0800 Message-Id: <1552275193-45361-1-git-send-email-michael.luo@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by the config X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Mar 2019 03:36:29 -0000 From: Luo Gaoliang Choosing the VF passthrough method to create VMs by the config instead of hardcoding it as pci-assign. Signed-off-by: Luo Gaoliang --- tests/TestSuite_ddp_gtp.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_ddp_gtp.py b/tests/TestSuite_ddp_gtp.py index 68de1a7..0e86c8d 100644 --- a/tests/TestSuite_ddp_gtp.py +++ b/tests/TestSuite_ddp_gtp.py @@ -15,6 +15,8 @@ VM_CORES_MASK = 'all' class TestDdpGtp(TestCase): + supported_vf_driver = ['pci-stub', 'vfio-pci'] + def set_up_all(self): self.verify('fortville' in self.nic, 'ddp gtp can not support %s nic' % self.nic) @@ -32,6 +34,16 @@ class TestDdpGtp(TestCase): self.PF_QUEUE = self.search_queue_number(self.PF_Q_strip) self.VF_QUEUE = self.search_queue_number(self.VF_Q_strip) + self.vf_driver = self.get_suite_cfg()['vf_driver'] + if self.vf_driver is None: + self.vf_driver = 'pci-stub' + self.verify(self.vf_driver in self.supported_vf_driver, "Unspported vf driver") + if self.vf_driver == 'pci-stub': + self.vf_assign_method = 'pci-assign' + else: + self.vf_assign_method = 'vfio-pci' + self.dut.send_expect('modprobe vfio-pci', '#') + def set_up(self): self.setup_vm_env() self.load_profile() @@ -88,14 +100,14 @@ class TestDdpGtp(TestCase): self.sriov_vfs_port = self.dut.ports_info[ self.used_dut_port]['vfs_port'] for port in self.sriov_vfs_port: - port.bind_driver('pci-stub') + port.bind_driver(self.vf_driver) time.sleep(1) self.dut_testpmd = PmdOutput(self.dut) time.sleep(1) vf0_prop = {'opt_host': self.sriov_vfs_port[0].pci} # set up VM0 ENV self.vm0 = QEMUKvm(self.dut, 'vm0', 'ddp_gtp') - self.vm0.set_vm_device(driver='pci-assign', **vf0_prop) + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop) try: self.vm0_dut = self.vm0.start() if self.vm0_dut is None: -- 2.7.4