From: "Qiu, Michael" <michael.qiu@intel.com>
To: David Marchand <david.marchand@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] eal_pci: Fix max_vfs missing for none igb_uio driver
Date: Fri, 13 Feb 2015 03:01:12 +0000 [thread overview]
Message-ID: <533710CFB86FA344BFBF2D6802E60286CE8F42@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <CALwxeUsGP-GOi7buBhaj3B4c67=w413=LqPTJ7G1VVGbdQf4-g@mail.gmail.com>
On 2/12/2015 1:50 PM, David Marchand wrote:
> On Wed, Feb 11, 2015 at 2:25 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>>
> ---
> 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.
Yes, your solution is much more better, but little complex. My solution
can be a quick fix.
> 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@6wind.com
> <mailto:david.marchand@6wind.com>>
>
Thanks David for reviewing this patch and your good comments
Thanks,
Michale
> --
> David Marchand
next prev parent reply other threads:[~2015-02-13 3:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 11:10 [dpdk-dev] [PATCH] " Michael Qiu
2015-02-11 12:32 ` David Marchand
2015-02-11 12:41 ` Qiu, Michael
2015-02-11 13:25 ` [dpdk-dev] [PATCH v2] " Michael Qiu
2015-02-11 13:27 ` Qiu, Michael
2015-02-12 5:50 ` David Marchand
2015-02-13 3:01 ` Qiu, Michael [this message]
2015-02-13 13:49 ` Thomas Monjalon
2015-02-12 16:25 ` Thomas Monjalon
2015-02-13 2:56 ` Qiu, Michael
2015-02-13 9:20 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=533710CFB86FA344BFBF2D6802E60286CE8F42@SHSMSX101.ccr.corp.intel.com \
--to=michael.qiu@intel.com \
--cc=david.marchand@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).