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 CE03AA00E6 for ; Thu, 11 Jul 2019 08:56:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C747322C; Thu, 11 Jul 2019 08:56:46 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 157302F42 for ; Thu, 11 Jul 2019 08:56:43 +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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 23:56:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,476,1557212400"; d="scan'208";a="249694569" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 10 Jul 2019 23:56:42 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 23:56:41 -0700 Received: from shsmsx106.ccr.corp.intel.com ([169.254.10.240]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.109]) with mapi id 14.03.0439.000; Thu, 11 Jul 2019 14:40:37 +0800 From: "Yao, BingX Y" To: "Zhang, YanX A" , "dts@dpdk.org" CC: "Zhang, YanX A" Thread-Topic: [dts] [PATCH V1] tests/TestSuite_vf_daemon:Improve the way drivers bind Thread-Index: AQHVN7J5tLaW6pTqVkemrSDVKXh/r6bE95ug Date: Thu, 11 Jul 2019 06:40:37 +0000 Message-ID: <95BCD24840F32441BEA74E0F8A31839E058F49D8@SHSMSX106.ccr.corp.intel.com> References: <1562827038-50166-1-git-send-email-yanx.a.zhang@intel.com> In-Reply-To: <1562827038-50166-1-git-send-email-yanx.a.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests/TestSuite_vf_daemon: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" Tested-by: Yao, BingX Y -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhang,yan Sent: Thursday, July 11, 2019 2:37 PM To: dts@dpdk.org Cc: Zhang, YanX A Subject: [dts] [PATCH V1] tests/TestSuite_vf_daemon:Improve the way drivers= bind Improved the original single binding driver. Signed-off-by: zhang,yan --- tests/TestSuite_vf_daemon.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_vf_daemon.py b/tests/TestSuite_vf_daemon.py in= dex cc55f65..fcbf5b8 100644 --- a/tests/TestSuite_vf_daemon.py +++ b/tests/TestSuite_vf_daemon.py @@ -17,6 +17,7 @@ MAX_VLAN =3D 4095 =20 =20 class TestVfDaemon(TestCase): + supported_vf_driver =3D ['pci-stub', 'vfio-pci'] =20 def set_up_all(self): =20 @@ -26,6 +27,15 @@ class TestVfDaemon(TestCase): self.vm1 =3D None self.env_done =3D False =20 + self.vf_driver =3D self.get_suite_cfg()['vf_driver'] + if self.vf_driver is None: + self.vf_driver =3D 'pci-stub' + self.verify(self.vf_driver in self.supported_vf_driver, "Unspporte= d vf driver") + if self.vf_driver =3D=3D 'pci-stub': + self.vf_assign_method =3D 'pci-assign' + else: + self.vf_assign_method =3D 'vfio-pci' + self.dut.send_expect('modprobe vfio-pci', '#') =20 def set_up(self): self.setup_vm_env() @@ -61,7 +71,7 @@ class TestVfDaemon(TestCase): netdev.bind_driver(driver=3Ddriver) =20 =20 - def setup_vm_env(self, driver=3D'igb_uio'): + def setup_vm_env(self, driver=3D'default'): """ Create testing environment with 2VFs generated from 1PF """ @@ -78,12 +88,14 @@ class TestVfDaemon(TestCase): self.sriov_vfs_port =3D 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) + eal_param =3D '-b %(vf0)s -b %(vf1)s' % {'vf0': self.sriov_vfs_por= t[0].pci, + 'vf1':=20 + self.sriov_vfs_port[1].pci} =20 self.dut_testpmd =3D PmdOutput(self.dut) self.dut_testpmd.start_testpmd( - "Default", "--rxq=3D4 --txq=3D4 --port-topology=3Dchained") + "Default", "--rxq=3D4 --txq=3D4 --port-topology=3Dchained",=20 + eal_param=3Deal_param) self.dut_testpmd.execute_cmd("start") time.sleep(5) =20 @@ -91,7 +103,7 @@ class TestVfDaemon(TestCase): =20 # set up VM0 ENV self.vm0 =3D QEMUKvm(self.dut, 'vm0', 'vf_daemon') - self.vm0.set_vm_device(driver=3D'pci-assign', **vf0_prop) + self.vm0.set_vm_device(driver=3Dself.vf_assign_method,=20 + **vf0_prop) try: self.vm0_dut =3D self.vm0.start() if self.vm0_dut is None: @@ -105,7 +117,7 @@ class TestVfDaemon(TestCase): =20 vf1_prop =3D {'opt_host': self.sriov_vfs_port[1].pci} self.vm1 =3D QEMUKvm(self.dut, 'vm1', 'vf_daemon') - self.vm1.set_vm_device(driver=3D'pci-assign', **vf1_prop) + self.vm1.set_vm_device(driver=3Dself.vf_assign_method,=20 + **vf1_prop) try: self.vm1_dut =3D self.vm1.start() if self.vm1_dut is None: -- 2.17.2