From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2D6ECADA1 for ; Fri, 13 Feb 2015 04:02:43 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 12 Feb 2015 18:57:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,568,1418112000"; d="scan'208";a="454008943" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by FMSMGA003.fm.intel.com with ESMTP; 12 Feb 2015 18:47:56 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 13 Feb 2015 11:01:21 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.209]) with mapi id 14.03.0195.001; Fri, 13 Feb 2015 11:01:11 +0800 From: "Qiu, Michael" To: David Marchand Thread-Topic: [dpdk-dev] [PATCH v2] eal_pci: Fix max_vfs missing for none igb_uio driver Thread-Index: AQHQRf5OXAG7d59Q8EabITlO4bpGVA== Date: Fri, 13 Feb 2015 03:01:12 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CE8F42@SHSMSX101.ccr.corp.intel.com> References: <1423653001-11660-1-git-send-email-michael.qiu@intel.com> <1423661155-16645-1-git-send-email-michael.qiu@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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2] eal_pci: Fix max_vfs missing for none igb_uio driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 03:02:43 -0000 On 2/12/2015 1:50 PM, David Marchand wrote:=0A= > On Wed, Feb 11, 2015 at 2:25 PM, Michael Qiu > wrote:=0A= >=0A= > max_vfs will only be created by igb_uio driver, for other=0A= > drivers like vfio or pci_uio_generic, max_vfs will miss.=0A= >=0A= > But sriov_numvfs is not driver related, just get the vf numbers=0A= > from that field.=0A= >=0A= > Signed-off-by: Michael Qiu >=0A= > ---=0A= > v2 --> v1:=0A= > backport for kernel version less than 3.8=0A= >=0A= > lib/librte_eal/linuxapp/eal/eal_pci.c | 10 +++++++++-=0A= > 1 file changed, 9 insertions(+), 1 deletion(-)=0A= >=0A= > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c=0A= > b/lib/librte_eal/linuxapp/eal/eal_pci.c=0A= > index b5f5410..fcf5511 100644=0A= > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c=0A= > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c=0A= > @@ -272,8 +272,16 @@ pci_scan_one(const char *dirname, uint16_t=0A= > domain, uint8_t bus,=0A= > dev->max_vfs =3D 0;=0A= > snprintf(filename, sizeof(filename), "%s/max_vfs", dirname);= =0A= > if (!access(filename, F_OK) &&=0A= > - eal_parse_sysfs_value(filename, &tmp) =3D=3D 0) {=0A= > + eal_parse_sysfs_value(filename, &tmp) =3D=3D 0)=0A= > dev->max_vfs =3D (uint16_t)tmp;=0A= > + else {=0A= > + /* for none igb_uio driver, need kernel=0A= > + * version greater than 3.8 */=0A= > + snprintf(filename, sizeof(filename),=0A= > + "%s/sriov_numvfs", dirname);=0A= > + if (!access(filename, F_OK) &&=0A= > + eal_parse_sysfs_value(filename, &tmp) =3D=3D 0)= =0A= > + dev->max_vfs =3D (uint16_t)tmp;=0A= > }=0A= >=0A= > /* get numa node */=0A= >=0A= >=0A= > I can see a different solution : maybe faking a sriov_numvfs parameter=0A= > from igb_uio for kernels that don't have it and doing nothing for=0A= > kernels that already provide sriov_numvfs.=0A= =0A= Yes, your solution is much more better, but little complex. My solution=0A= can be a quick fix.=0A= =0A= > But your solution is more straightforward (and we don't need to update=0A= > documentation and/or existing scripts afaik).=0A= >=0A= > Acked-by: David Marchand >=0A= >=0A= =0A= Thanks David for reviewing this patch and your good comments=0A= =0A= Thanks,=0A= Michale=0A= > -- =0A= > David Marchand=0A= =0A=