From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 772A09AAA for ; Wed, 11 Feb 2015 14:27:55 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 11 Feb 2015 05:20:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,558,1418112000"; d="scan'208";a="453115701" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by FMSMGA003.fm.intel.com with ESMTP; 11 Feb 2015 05:13:15 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 11 Feb 2015 21:27:51 +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; Wed, 11 Feb 2015 21:27:50 +0800 From: "Qiu, Michael" To: "dev@dpdk.org" Thread-Topic: [PATCH v2] eal_pci: Fix max_vfs missing for none igb_uio driver Thread-Index: AQHQRf5OXAG7d59Q8EabITlO4bpGVA== Date: Wed, 11 Feb 2015 13:27:50 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CE82CA@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 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: Wed, 11 Feb 2015 13:27:56 -0000 [+cc] David=0A= =0A= On 2/11/2015 9:26 PM, Qiu, Michael wrote:=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 b/lib/librte_eal/linux= app/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 domain, u= int8_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=