From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BB379A0096 for ; Fri, 15 Mar 2019 08:11:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 839CF2C17; Fri, 15 Mar 2019 08:11:09 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 8ECCA2BD3 for ; Fri, 15 Mar 2019 08:11:07 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2019 00:11:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,481,1544515200"; d="scan'208";a="122886747" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga007.jf.intel.com with ESMTP; 15 Mar 2019 00:11:06 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 15 Mar 2019 00:11:06 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 15 Mar 2019 00:11:05 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.158]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.134]) with mapi id 14.03.0415.000; Fri, 15 Mar 2019 15:10:47 +0800 From: "Tu, Lijuan" To: "Luo, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by the config Thread-Index: AQHU17ul7GOWASzVXUubxgSxGVV+D6YMTOzQ Date: Fri, 15 Mar 2019 07:10:47 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA433A3@SHSMSX101.ccr.corp.intel.com> References: <1552275193-45361-1-git-send-email-michael.luo@intel.com> In-Reply-To: <1552275193-45361-1-git-send-email-michael.luo@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.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTJjNzc5YmMtOTZkYi00ZjA5LTgyZTgtYjAxY2ZmMmE3Mjc5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUzhHQmVpVnhkXC9cLzg3aGV2UjVST25QWFFKVENGazNCazUyeVJFQ3kzMXVxcnVqU1pseGtrSmlpbVdpcW1NRkhPIn0= 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] 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of michael.luo@intel.co= m > Sent: Monday, March 11, 2019 11:33 AM > To: dts@dpdk.org > Subject: [dts] [PATCH] tests/ddp_gtp: choose the VF passthrough method by= the > config >=20 > From: Luo Gaoliang >=20 > Choosing the VF passthrough method to create VMs by the config instead of > hardcoding it as pci-assign. >=20 > Signed-off-by: Luo Gaoliang > --- > tests/TestSuite_ddp_gtp.py | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) >=20 > diff --git a/tests/TestSuite_ddp_gtp.py b/tests/TestSuite_ddp_gtp.py inde= x > 68de1a7..0e86c8d 100644 > --- a/tests/TestSuite_ddp_gtp.py > +++ b/tests/TestSuite_ddp_gtp.py > @@ -15,6 +15,8 @@ VM_CORES_MASK =3D 'all' >=20 > class TestDdpGtp(TestCase): >=20 > + supported_vf_driver =3D ['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 =3D self.search_queue_number(self.PF_Q_strip) > self.VF_QUEUE =3D self.search_queue_number(self.VF_Q_strip) >=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', '#') > + > def set_up(self): > self.setup_vm_env() > self.load_profile() > @@ -88,14 +100,14 @@ class TestDdpGtp(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) > self.dut_testpmd =3D PmdOutput(self.dut) > time.sleep(1) > vf0_prop =3D {'opt_host': self.sriov_vfs_port[0].pci} > # set up VM0 ENV > self.vm0 =3D QEMUKvm(self.dut, 'vm0', 'ddp_gtp') > - 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: > -- > 2.7.4