From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by dpdk.org (Postfix) with ESMTP id 19BA55A98 for ; Thu, 12 Feb 2015 06:50:25 +0100 (CET) Received: by mail-ob0-f181.google.com with SMTP id vb8so7956263obc.12 for ; Wed, 11 Feb 2015 21:50:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9eaUZgm1R8ms49NSqfYLvF1/Brk7pAlAxR6Haz3Tep4=; b=b3xBHONlz1eMPzWIimNtq+cVg4O56YpEy6x9x0u5cay18Kw+ICEG2u8vjLJoY+ik6k Jfyyg73YxJN582beXNkXo0V6DUE353kzxq6I6LQ+10RZlc5Y+3i2RHRLP3sPfKogVB/g 5Il8bajXdNVywfNZa7i2zcu0UgArcVi3lnF7vm6jSzGUpVMY/lDPeACfwx5RdiI75+w2 BgnX1lSDzdjWbXzB6yJfCD1h0L45u246LvFbx92eM+Ydk1+c21WxnnuEoCqVA8irUmZt 0re82cwB2ydBblZfDe/7We6rtHN+l/HfHTm3KuCnOQGppHY659HR5YCka717gtEAWyFt lmSQ== X-Gm-Message-State: ALoCoQm3mcDS7zjnLhlyEfbrwULXj1p5OvvH8C7x6j9unpmAiSLdyuDwaCNcq3E1Y7K2A8uuAQ8j MIME-Version: 1.0 X-Received: by 10.202.180.87 with SMTP id d84mr1540472oif.0.1423720224392; Wed, 11 Feb 2015 21:50:24 -0800 (PST) Received: by 10.76.95.198 with HTTP; Wed, 11 Feb 2015 21:50:24 -0800 (PST) In-Reply-To: <1423661155-16645-1-git-send-email-michael.qiu@intel.com> References: <1423653001-11660-1-git-send-email-michael.qiu@intel.com> <1423661155-16645-1-git-send-email-michael.qiu@intel.com> Date: Thu, 12 Feb 2015 06:50:24 +0100 Message-ID: From: David Marchand To: Michael Qiu Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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: Thu, 12 Feb 2015 05:50:25 -0000 On Wed, Feb 11, 2015 at 2:25 PM, Michael Qiu 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 > --- > v2 --> v1: > backport for kernel version less than 3.8 > > lib/librte_eal/linuxapp/eal/eal_pci.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c > b/lib/librte_eal/linuxapp/eal/eal_pci.c > index b5f5410..fcf5511 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -272,8 +272,16 @@ pci_scan_one(const char *dirname, uint16_t domain, > uint8_t bus, > dev->max_vfs = 0; > snprintf(filename, sizeof(filename), "%s/max_vfs", dirname); > if (!access(filename, F_OK) && > - eal_parse_sysfs_value(filename, &tmp) == 0) { > + eal_parse_sysfs_value(filename, &tmp) == 0) > dev->max_vfs = (uint16_t)tmp; > + else { > + /* for none igb_uio driver, need kernel > + * version greater than 3.8 */ > + 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; > } > > /* get numa node */ > I can see a different solution : maybe faking a sriov_numvfs parameter from igb_uio for kernels that don't have it and doing nothing for kernels that already provide sriov_numvfs. But your solution is more straightforward (and we don't need to update documentation and/or existing scripts afaik). Acked-by: David Marchand -- David Marchand