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 EBC46A05D3 for ; Sun, 24 Mar 2019 19:34:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C99CE2956; Sun, 24 Mar 2019 19:34:51 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3C4D11DBD for ; Sun, 24 Mar 2019 19:34:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Mar 2019 11:34:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="154749042" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 24 Mar 2019 11:34:49 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 24 Mar 2019 11:34:48 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 24 Mar 2019 11:34:48 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.158]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.223]) with mapi id 14.03.0415.000; Mon, 25 Mar 2019 02:34:43 +0800 From: "Tu, Lijuan" To: "Luo, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] tests/vf_kernel: choose the VF passthrough method by the config Thread-Index: AQHU3SjyqDhhnfTMgU+XlvSqiTYlP6YbJiIQ Date: Sun, 24 Mar 2019 18:34:42 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA45BFD@SHSMSX101.ccr.corp.intel.com> References: <1552871881-49534-1-git-send-email-michael.luo@intel.com> In-Reply-To: <1552871881-49534-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2YyM2NlZDAtYjkzYy00MzA5LTg0ZjYtMTgzNDNkMDU1Njc4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS1RGRHhSbGhsK2F2OG5wVUpoZ1hjYk1VTTl1REpnY2I2bUJKaW5sS2J1NWQ5QnNFWlA5SnBOa1ZadTl5MjJNYSJ9 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/vf_kernel: 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: Sunday, March 17, 2019 6:18 PM > To: dts@dpdk.org > Subject: [dts] [PATCH] tests/vf_kernel: 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_vf_kernel.py | 36 ++++++++++++++++++++++++++---------- > 1 file changed, 26 insertions(+), 10 deletions(-) >=20 > diff --git a/tests/TestSuite_vf_kernel.py b/tests/TestSuite_vf_kernel.py = index > cb3dd51..f80c9e9 100644 > --- a/tests/TestSuite_vf_kernel.py > +++ b/tests/TestSuite_vf_kernel.py > @@ -51,6 +51,8 @@ from utils import GREEN, RED >=20 > class TestVfKernel(TestCase): >=20 > + supported_vf_driver =3D ['pci-stub', 'vfio-pci'] > + > def set_up_all(self): > """ > Run at the start of each test suite. > @@ -69,6 +71,16 @@ class TestVfKernel(TestCase): > self.intf =3D self.dut.ports_info[self.dut_ports[0]]['intf'] > self.pci =3D self.dut.ports_info[self.dut_ports[0]]['pci'].split= (':') >=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', '#') > + > self.src_logo =3D '12:34:56:78:90:10' > self.setup_vm_env() >=20 > @@ -103,12 +115,16 @@ class TestVfKernel(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) >=20 > self.dut_testpmd =3D PmdOutput(self.dut) > + eal_param =3D '' > + for sriov_vf in self.sriov_vfs_port: > + eal_param +=3D " -b %s" % sriov_vf.pci > 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) > # dpdk-2208 > # since there is no forward engine on DPDK PF to forward or drop= packet in > packet pool, > # so finally the pool will be full, then no more packet will be = @@ -122,10 > +138,10 @@ class TestVfKernel(TestCase): > vf0_prop_4 =3D {'opt_host': self.sriov_vfs_port[3].pci} >=20 > self.vm0 =3D QEMUKvm(self.dut, 'vm0', 'vf_kernel') > - self.vm0.set_vm_device(driver=3D'pci-assign', **vf0_prop_1) > - self.vm0.set_vm_device(driver=3D'pci-assign', **vf0_prop_2) > - self.vm0.set_vm_device(driver=3D'pci-assign', **vf0_prop_3) > - self.vm0.set_vm_device(driver=3D'pci-assign', **vf0_prop_4) > + self.vm0.set_vm_device(driver=3Dself.vf_assign_method, **vf0_pro= p_1) > + self.vm0.set_vm_device(driver=3Dself.vf_assign_method, **vf0_pro= p_2) > + self.vm0.set_vm_device(driver=3Dself.vf_assign_method, **vf0_pro= p_3) > + self.vm0.set_vm_device(driver=3Dself.vf_assign_method, > + **vf0_prop_4) > try: > self.vm0_dut =3D self.vm0.start() > if self.vm0_dut is None: > @@ -140,8 +156,8 @@ class TestVfKernel(TestCase): > vf1_prop_5 =3D {'opt_host': self.sriov_vfs_port[4].pci} > vf1_prop_6 =3D {'opt_host': self.sriov_vfs_port[5].pci} > self.vm1 =3D QEMUKvm(self.dut, 'vm1', 'vf_kernel') > - self.vm1.set_vm_device(driver=3D'pci-assign', **vf1_prop_5) > - self.vm1.set_vm_device(driver=3D'pci-assign', **vf1_prop_6) > + self.vm1.set_vm_device(driver=3Dself.vf_assign_method, **vf1_pro= p_5) > + self.vm1.set_vm_device(driver=3Dself.vf_assign_method, > + **vf1_prop_6) >=20 > try: > self.vm1_dut =3D self.vm1.start() @@ -740,8 +756,8 @@ class > TestVfKernel(TestCase): > vf1_prop_5 =3D {'opt_host': self.sriov_vfs_port[4].pci} > vf1_prop_6 =3D {'opt_host': self.sriov_vfs_port[5].pci} > self.vm1 =3D QEMUKvm(self.dut, 'vm1', 'vf_kernel') > - self.vm1.set_vm_device(driver=3D'pci-assign', **vf1_prop_5) > - self.vm1.set_vm_device(driver=3D'pci-assign', **vf1_prop_6) > + self.vm1.set_vm_device(driver=3Dself.vf_assign_method, **vf1_pro= p_5) > + self.vm1.set_vm_device(driver=3Dself.vf_assign_method, > + **vf1_prop_6) >=20 > try: > self.vm1_dut =3D self.vm1.start() > -- > 2.7.4