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 18760A0096 for ; Wed, 10 Apr 2019 07:58:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E28FA5B3C; Wed, 10 Apr 2019 07:58:11 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B5E035B2C for ; Wed, 10 Apr 2019 07:58:10 +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 orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2019 22:58:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="222121979" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 09 Apr 2019 22:58:09 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 9 Apr 2019 22:58:09 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 9 Apr 2019 22:58:08 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.153]) with mapi id 14.03.0415.000; Wed, 10 Apr 2019 13:52:35 +0800 From: "Zhu, ShuaiX" To: "Mei, JianweiX" , "dts@dpdk.org" CC: "Mei, JianweiX" , "Zhu, ShuaiX" Thread-Topic: [dts] [PATCH V3] tests/etag: add vf driver vfio-pci Thread-Index: AQHU71anxMB6NERZH0SLPbF/RZVh7qY05GnA Date: Wed, 10 Apr 2019 05:52:34 +0000 Message-ID: <4DC48DF9BDA3E54A836D2D3C057DEC6F0B167BA6@SHSMSX101.ccr.corp.intel.com> References: <1554871095-16884-1-git-send-email-jianweix.mei@intel.com> In-Reply-To: <1554871095-16884-1-git-send-email-jianweix.mei@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 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 V3] tests/etag: add vf driver vfio-pci 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: Zhu, ShuaiX > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jianwei Mei > Sent: Wednesday, April 10, 2019 12:38 PM > To: dts@dpdk.org > Cc: Mei, JianweiX > Subject: [dts] [PATCH V3] tests/etag: add vf driver vfio-pci >=20 > add vf driver vfio-pci >=20 >=20 > Signed-off-by: Jianwei Mei > --- > tests/TestSuite_etag.py | 43 +++++++++++++++++++++++++++++++---------- > 1 file changed, 33 insertions(+), 10 deletions(-) >=20 > diff --git a/tests/TestSuite_etag.py b/tests/TestSuite_etag.py index > 7cf93eb..d3d7836 100644 > --- a/tests/TestSuite_etag.py > +++ b/tests/TestSuite_etag.py > @@ -51,9 +51,10 @@ from packet import Packet VM_CORES_MASK =3D 'all' >=20 > class TestEtag(TestCase): > + supported_vf_driver =3D ['pci-stub', 'vfio-pci'] > def set_up_all(self): > self.dut_ports =3D self.dut.get_ports(self.nic) > - self.verify(self.nic in ['sagepond'], '802.1BR only support by > sagepond') > + self.verify(self.nic in ['sagepond','sageville'], '802.1BR only > + support by sagepond and sageville') > self.verify(len(self.dut_ports) >=3D 1, 'Insufficient ports') > self.src_intf =3D > self.tester.get_interface(self.tester.get_local_port(0)) > self.src_mac =3D self.tester.get_mac(self.tester.get_local_port= (0)) > @@ -71,6 +72,7 @@ class TestEtag(TestCase): > ''' > setup qemu virtual environment > ''' > + > if self.setup_vm_env_flag =3D=3D 1: > return >=20 > @@ -78,25 +80,46 @@ class TestEtag(TestCase): > self.dut.generate_sriov_vfs_by_port(self.used_dut_port_0, 2, > driver=3Ddriver) > self.sriov_vfs_port_0 =3D > self.dut.ports_info[self.used_dut_port_0]['vfs_port'] >=20 > + # set vf assign method and vf driver > + 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', '#') > + > + > try: > for port in self.sriov_vfs_port_0: > - port.bind_driver('pci-stub') > + port.bind_driver(self.vf_driver) >=20 > time.sleep(1) > vf0_prop =3D {'opt_host': self.sriov_vfs_port_0[0].pci} > vf1_prop =3D {'opt_host': self.sriov_vfs_port_0[1].pci} >=20 > - # start testpmd without the two VFs on the host > - self.host_testpmd =3D PmdOutput(self.dut) > - eal_param =3D '-b %(vf0)s -b %(vf1)s' % {'vf0': > self.sriov_vfs_port_0[0].pci, > + if driver =3D=3D 'igb_uio': > + # start testpmd without the two VFs on the host > + self.host_testpmd =3D PmdOutput(self.dut) > + eal_param =3D '-b %(vf0)s -b %(vf1)s' % {'vf0': > self.sriov_vfs_port_0[0].pci, > + 'vf1': > self.sriov_vfs_port_0[1].pci} > + if (self.nic in ["niantic", "sageville", "sagepond"]): > + self.host_testpmd.start_testpmd("1S/2C/2T", > "--txq=3D4 --rxq=3D4 ", eal_param=3Deal_param) > + else: > + self.host_testpmd.start_testpmd("1S/2C/2T", "", > eal_param=3Deal_param) > + else: > + # start testpmd without the two VFs on the host > + self.host_testpmd =3D PmdOutput(self.dut) > + eal_param =3D '-b %(vf0)s -b %(vf1)s' % {'vf0': > + self.sriov_vfs_port_0[0].pci, > 'vf1': > self.sriov_vfs_port_0[1].pci} > - > - self.preset_host_testpmd('1S/2C/2T', eal_param) > + self.preset_host_testpmd('1S/2C/2T', eal_param) >=20 > # set up VM0 ENV > self.vm0 =3D QEMUKvm(self.dut, 'vm0', 'vf_etag') > - self.vm0.set_vm_device(driver=3D'pci-assign', **vf0_prop) > - self.vm0.set_vm_device(driver=3D'pci-assign', **vf1_prop) > + self.vm0.set_vm_device(driver=3Dself.vf_assign_method, > **vf0_prop) > + self.vm0.set_vm_device(driver=3Dself.vf_assign_method, > + **vf1_prop) > self.vm_dut_0 =3D self.vm0.start() > if self.vm_dut_0 is None: > raise Exception('Set up VM0 ENV failed!') @@ -290,7 > +313,7 @@ class TestEtag(TestCase): > else: > # Same E-tag forwarding to VF0, Send 802.1BR packet > with broadcast mac and > # check packet only received on VF0 or VF1 > - host_cmds =3D [['E-tag set filter add e-tag-id 1000 > dst-pool %d port 0'%test_type[-1:]], > + host_cmds =3D [['E-tag set filter add e-tag-id 1000 > + dst-pool %d port 0'% int(test_type[-1:])], > ['set fwd rxonly'], > ['set verbose 1'], > ['start']] > -- > 2.17.2