From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB56EA046B for ; Thu, 27 Jun 2019 10:06:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4013378E; Thu, 27 Jun 2019 10:06:17 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0205E2BF2 for ; Thu, 27 Jun 2019 10:06:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2019 01:06:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,423,1557212400"; d="scan'208";a="245733939" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 27 Jun 2019 01:06:14 -0700 From: "zhang,yan" To: dts@dpdk.org Cc: "zhang,yan" Date: Thu, 27 Jun 2019 16:10:57 +0800 Message-Id: <1561623057-83510-1-git-send-email-yanx.a.zhang@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] tests/TestSuite_ddp_mpls:Improve the way drivers bind 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Instead of the original single binding driver, Signed-off-by: zhang,yan --- tests/TestSuite_ddp_mpls.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_ddp_mpls.py b/tests/TestSuite_ddp_mpls.py index b002788..599e5cd 100644 --- a/tests/TestSuite_ddp_mpls.py +++ b/tests/TestSuite_ddp_mpls.py @@ -16,6 +16,7 @@ PF_MAX_QUEUE = 64 VF_MAX_QUEUE = 4 class Testddp_mpls(TestCase): + supported_vf_driver = ['pci-stub', 'vfio-pci'] def set_up_all(self): self.verify('fortville' in self.nic, @@ -28,6 +29,15 @@ class Testddp_mpls(TestCase): profile_dst = "/tmp/" self.dut.session.copy_file_to(profile_file, profile_dst) + 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() @@ -50,7 +60,7 @@ class Testddp_mpls(TestCase): netdev.bind_driver(driver=driver) - def setup_vm_env(self, driver='igb_uio'): + def setup_vm_env(self, driver='default'): """ Create testing environment with VF generated from 1PF """ @@ -65,7 +75,7 @@ class Testddp_mpls(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) @@ -73,7 +83,7 @@ class Testddp_mpls(TestCase): # set up VM0 ENV self.vm0 = QEMUKvm(self.dut, 'vm0', 'ddp_mpls') - 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.17.2