From: Alejandro Lucero <alejandro.lucero@netronome.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: Andrew Rybchenko <arybchenko@solarflare.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] vfio: failed to select IOMMU type
Date: Wed, 5 Apr 2017 08:12:33 +0100 [thread overview]
Message-ID: <CAD+H992OGKwB=h_qFoheeDdRKqfTUWyD7HqLKWwsKu0oV7-vsA@mail.gmail.com> (raw)
In-Reply-To: <C6ECDF3AB251BE4894318F4E451236978220D7FC@IRSMSX109.ger.corp.intel.com>
Hi Andrew, Anatoly,
On Tue, Apr 4, 2017 at 4:52 PM, Burakov, Anatoly <anatoly.burakov@intel.com>
wrote:
> Hi Andrew,
>
> > I think a key to the main problem is the same IOMMU group used for both
> PCI functions.
> > It tries to set IOMMU type using the same file descriptor twice. The
> second set is dummy, since the same value is set, but still fails, I guess,
> because it is already in use.
> > See logs with debug enabled and few extra logs below:
>
> Yes you're right. Specifically, eal_vfio.c:vfio_setup_device() at line
> 311 (where we check for number of groups) - the code always assumes that one
> active group means we've just initialized a new group, which may not
> necessarily be the case if there's more than one device per group.
>
>
Yes, the code was not aware of that possibility. Being honest, I knew about
that, but not in my mind when implementing the code. I have just cards
where each PF even VF have their own VFIO group. This could be a problem
for testing. Anatoly, do you have a system with that peculiarity?
> Alejandro, please correct me if I'm wrong, but I think this raises another
> issue: vfio_release_device() seems to attempt to close group fd
> unconditionally,
> which is probably a bad idea if there are more than one device per group.
>
>
Yes, I think so, but not completely sure. Doing a quick look at kernel VFIO
code, that seems a problem, but need more time for studying the code again.
Again, not having hardware with this peculiarity will make the process
harder.
> Would you be so kind to come up with a patch to fix this oversight, or
> should I do it? :)
>
>
Yes, I will work on this as a priority and send a patch asap. Andrew, could
you test this hotplug option in some way with your systems?
Thanks
> Thanks,
> Anatoly
>
next prev parent reply other threads:[~2017-04-05 7:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 10:46 Andrew Rybchenko
2017-04-03 16:11 ` Burakov, Anatoly
2017-04-04 15:29 ` Andrew Rybchenko
2017-04-04 15:52 ` Burakov, Anatoly
2017-04-04 16:10 ` Andrew Rybchenko
2017-04-04 16:20 ` Burakov, Anatoly
2017-04-05 7:15 ` Alejandro Lucero
2017-04-05 7:12 ` Alejandro Lucero [this message]
2017-04-06 9:10 ` Burakov, Anatoly
2017-04-18 11:22 ` Alejandro Lucero
2017-04-24 9:09 ` Burakov, Anatoly
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='CAD+H992OGKwB=h_qFoheeDdRKqfTUWyD7HqLKWwsKu0oV7-vsA@mail.gmail.com' \
--to=alejandro.lucero@netronome.com \
--cc=anatoly.burakov@intel.com \
--cc=arybchenko@solarflare.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).