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 85779A00E6 for ; Wed, 7 Aug 2019 04:58:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36CC84CAF; Wed, 7 Aug 2019 04:58:11 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 06C254CA9 for ; Wed, 7 Aug 2019 04:58:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 19:58:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="373622602" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 06 Aug 2019 19:58:05 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 19:58:07 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 19:58:07 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.163]) with mapi id 14.03.0439.000; Wed, 7 Aug 2019 10:58:05 +0800 From: "Tu, Lijuan" 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: AQHVN7J5ExI6RfLvt066fqB8TP8aZqbvKG6A Date: Wed, 7 Aug 2019 02:58:04 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAFEB1E@SHSMSX101.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: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTQ0YzU5MTYtMWQzOS00NDg3LTk5ZGItZDQyYzM5NWFiOTUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibzNuV2IzcTdBU1JuZUZNZDR3UFNHcGxrYVh5eGhlTkVyN1wvQU5rUWxVQjdENm1WOEhPd3FyN3FzN1dLRnNOQkQifQ== 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" Applied, thanks > -----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 >=20 > Improved the original single binding driver. >=20 > Signed-off-by: zhang,yan > --- > tests/TestSuite_vf_daemon.py | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) >=20 > diff --git a/tests/TestSuite_vf_daemon.py b/tests/TestSuite_vf_daemon.py > index 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, "Unsppor= ted 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_p= ort[0].pci, > + 'vf1': > + 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", > + 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, > + **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, > + **vf1_prop) > try: > self.vm1_dut =3D self.vm1.start() > if self.vm1_dut is None: > -- > 2.17.2