Message ID | 1423653001-11660-1-git-send-email-michael.qiu@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 391085A9A; Wed, 11 Feb 2015 12:10:13 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 235D85A98 for <dev@dpdk.org>; Wed, 11 Feb 2015 12:10:11 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 11 Feb 2015 03:10:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,558,1418112000"; d="scan'208";a="676277778" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 11 Feb 2015 03:10:09 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t1BBA7wB006303; Wed, 11 Feb 2015 19:10:07 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t1BBA3bN011696; Wed, 11 Feb 2015 19:10:05 +0800 Received: (from dayuqiu@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t1BBA3ec011692; Wed, 11 Feb 2015 19:10:03 +0800 From: Michael Qiu <michael.qiu@intel.com> To: dev@dpdk.org Date: Wed, 11 Feb 2015 19:10:01 +0800 Message-Id: <1423653001-11660-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] 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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Michael Qiu
Feb. 11, 2015, 11:10 a.m. UTC
max_vfs will only be created by igb_uio driver, for other
drivers like vfio or pci_uio_generic, max_vfs will miss.
But sriov_numvfs is not driver related, just get the vf numbers
from that field.
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
lib/librte_eal/linuxapp/eal/eal_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hello Michael, On Wed, Feb 11, 2015 at 12:10 PM, Michael Qiu <michael.qiu@intel.com> wrote: > max_vfs will only be created by igb_uio driver, for other > drivers like vfio or pci_uio_generic, max_vfs will miss. > > But sriov_numvfs is not driver related, just get the vf numbers > from that field. > > Signed-off-by: Michael Qiu <michael.qiu@intel.com> > --- > lib/librte_eal/linuxapp/eal/eal_pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c > b/lib/librte_eal/linuxapp/eal/eal_pci.c > index 1f43688..3da4b69 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -305,7 +305,7 @@ pci_scan_one(const char *dirname, uint16_t domain, > uint8_t bus, > > /* get max_vfs */ > dev->max_vfs = 0; > - snprintf(filename, sizeof(filename), "%s/max_vfs", dirname); > + snprintf(filename, sizeof(filename), "%s/sriov_numvfs", dirname); > if (!access(filename, F_OK) && > eal_parse_sysfs_value(filename, &tmp) == 0) { > dev->max_vfs = (uint16_t)tmp; > > Not too sure about this change. Quickly looked, and as far as I can see, sriov_numvfs has been introduced by 1789382a ("PCI: SRIOV control and status via sysfs"). Won't your change break anything that uses a kernel < 3.8 (not backported) ?
On 2/11/2015 8:32 PM, David Marchand wrote: > Hello Michael, > > On Wed, Feb 11, 2015 at 12:10 PM, Michael Qiu <michael.qiu@intel.com > <mailto:michael.qiu@intel.com>> wrote: > > max_vfs will only be created by igb_uio driver, for other > drivers like vfio or pci_uio_generic, max_vfs will miss. > > But sriov_numvfs is not driver related, just get the vf numbers > from that field. > > Signed-off-by: Michael Qiu <michael.qiu@intel.com > <mailto:michael.qiu@intel.com>> > --- > lib/librte_eal/linuxapp/eal/eal_pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c > b/lib/librte_eal/linuxapp/eal/eal_pci.c > index 1f43688..3da4b69 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -305,7 +305,7 @@ pci_scan_one(const char *dirname, uint16_t > domain, uint8_t bus, > > /* get max_vfs */ > dev->max_vfs = 0; > - snprintf(filename, sizeof(filename), "%s/max_vfs", dirname); > + snprintf(filename, sizeof(filename), "%s/sriov_numvfs", > dirname); > if (!access(filename, F_OK) && > eal_parse_sysfs_value(filename, &tmp) == 0) { > dev->max_vfs = (uint16_t)tmp; > > > Not too sure about this change. > Quickly looked, and as far as I can see, sriov_numvfs has been > introduced by 1789382a ("PCI: SRIOV control and status via sysfs"). > > Won't your change break anything that uses a kernel < 3.8 (not > backported) ? OK, you are right, I will fix this in v2, actually it will break nothing as the code already done accessing check. But not enough, for kernel version less than 3.8 and driver is igb_uio, it is indeed not suitable for leaving max_vfs zero. BTW, for kernel version less than 3.8 and driver is vfio or pci_uio_generic, how could we fill this field? Thanks, Michael > > > -- > David Marchand
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 1f43688..3da4b69 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -305,7 +305,7 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, /* get max_vfs */ dev->max_vfs = 0; - snprintf(filename, sizeof(filename), "%s/max_vfs", dirname); + snprintf(filename, sizeof(filename), "%s/sriov_numvfs", dirname); if (!access(filename, F_OK) && eal_parse_sysfs_value(filename, &tmp) == 0) { dev->max_vfs = (uint16_t)tmp;