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 B555FA00E6 for ; Mon, 18 Mar 2019 06:26:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 73C542BAF; Mon, 18 Mar 2019 06:26:53 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 9724D1DBD for ; Mon, 18 Mar 2019 06:26:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Mar 2019 22:26:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,492,1544515200"; d="scan'208";a="215070284" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 17 Mar 2019 22:26:49 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 17 Mar 2019 22:26:49 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 17 Mar 2019 22:26:48 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.163]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.26]) with mapi id 14.03.0415.000; Mon, 18 Mar 2019 13:26:46 +0800 From: "Xu, Qian Q" To: "Luo, Michael" , "dts@dpdk.org" CC: "Zhu, Luna" , "Wang, Alex" Thread-Topic: [dts] [PATCH] tests/vf_kernel: choose the VF passthrough method by the config Thread-Index: AQHU3SjyfhRCD1MgEUexqVyWMSc8taYQ29jA Date: Mon, 18 Mar 2019 05:26:46 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E403C0A82@shsmsx102.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: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWEyNTJjZjctNWMwZC00YjFhLWI0YjUtYzNhNDMyNzkwYjllIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiN29rYUthQnc3YnBrbElqMmdqU0N5WEd3cUxtNmFqV3VBeHN1MEE1OVwvZEVmSkdpOXJyTURpXC9xWExqXC85QXBCMyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action 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" Thanks Mike for your 2nd patches, great job! > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of michael.luo@intel.co= m > Sent: Monday, March 18, 2019 9:18 AM > 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