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 44D08A00E6 for ; Mon, 15 Apr 2019 03:47:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 087325B3A; Mon, 15 Apr 2019 03:47:06 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D7B705B38 for ; Mon, 15 Apr 2019 03:47:04 +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 orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Apr 2019 18:47:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,351,1549958400"; d="scan'208";a="223527274" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 14 Apr 2019 18:47:03 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 14 Apr 2019 18:47:03 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 14 Apr 2019 18:47:03 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.93]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.42]) with mapi id 14.03.0415.000; Mon, 15 Apr 2019 09:47:01 +0800 From: "Mei, JianweiX" To: "Tu, Lijuan" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V4] tests/etag: add vf driver vfio-pci Thread-Index: AQHU8U76AL6cdXgyz0S2trOJmu8L2qY8dSKA Date: Mon, 15 Apr 2019 01:47:01 +0000 Message-ID: <8492B1A1F60DBB41A65FD160BBB3DA8BF859DF@SHSMSX103.ccr.corp.intel.com> References: <1555035536-20289-1-git-send-email-jianweix.mei@intel.com> <8CE3E05A3F976642AAB0F4675D0AD20E0BA60C51@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <8CE3E05A3F976642AAB0F4675D0AD20E0BA60C51@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 V4] 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" Hi, Lijuan Could you list all questions at once? I suggest there should provide a stan= dard for a modifying patch or a new patch. Thanks for your patience.=20 -----Original Message----- From: Tu, Lijuan=20 Sent: Saturday, April 13, 2019 12:44 AM To: Mei, JianweiX ; dts@dpdk.org Cc: Mei, JianweiX Subject: RE: [dts] [PATCH V4] tests/etag: add vf driver vfio-pci > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jianwei Mei > Sent: Thursday, April 11, 2019 7:19 PM > To: dts@dpdk.org > Cc: Mei, JianweiX > Subject: [dts] [PATCH V4] tests/etag: add vf driver vfio-pci >=20 > add vf driver vfio-pci >=20 > Signed-off-by: Jianwei Mei > --- > tests/TestSuite_etag.py | 45=20 > ++++++++++++++++++++++++++++------------- > 1 file changed, 31 insertions(+), 14 deletions(-) >=20 > diff --git a/tests/TestSuite_etag.py b/tests/TestSuite_etag.py index=20 > 7cf93eb..fd855de 100644 > --- a/tests/TestSuite_etag.py > +++ b/tests/TestSuite_etag.py > @@ -33,27 +33,24 @@ > DPDK Test suite. >=20 > ''' > - > import re > import time > import sys > - > import utils > from qemu_kvm import QEMUKvm > from test_case import TestCase > from pmd_output import PmdOutput > from exception import VerifyFailure > - > from scapy.utils import rdpcap > - > from packet import Packet >=20 > 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 s= agepond') > + self.verify(self.nic in ['sagepond','sageville'], '802.1BR=20 > + 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_loca= l_port(0)) > self.src_mac =3D =20 > self.tester.get_mac(self.tester.get_local_port(0)) > @@ -78,25 +75,45 @@ 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,=20 > + "Unspported 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 [Lijuan] this interpretation should be kept here. > - self.host_testpmd =3D PmdOutput(self.dut) > - eal_param =3D '-b %(vf0)s -b %(vf1)s' % {'vf0': > self.sriov_vfs_port_0[0].pci, [Lijuan] Same code in if and else, should be put out of conditions > + 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",=20 > + "--txq=3D4 --rxq=3D4 ", > eal_param=3Deal_param) [Lijuan] Not all platform has 2 thread, so please examine it could get enou= gh cores and could meet your requirement. > + 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':=20 > 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=20 > +307,7 @@ class TestEtag(TestCase): > else: > # Same E-tag forwarding to VF0, Send 802.1BR packet=20 > 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=20 > + dst-pool %d port 0'% int(test_type[-1:])], > ['set fwd rxonly'], > ['set verbose 1'], > ['start']] > -- > 2.17.2