linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Casey Leedom <leedom@chelsio.com>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	"Komali Katari" <komali@chelsio.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: 4.14.0-rc3 is auto-reloading PCIe SR-IOV Virtual Function device drivers when VFs are attached to VMs ...
Date: Tue, 17 Oct 2017 13:37:02 -0600	[thread overview]
Message-ID: <20171017133702.1b0e35bc@t450s.home> (raw)
In-Reply-To: <MWHPR12MB1600C4F1693E88236CA8F78EC84C0@MWHPR12MB1600.namprd12.prod.outlook.com>

On Tue, 17 Oct 2017 18:36:21 +0000
Casey Leedom <leedom@chelsio.com> wrote:

> Hi there,
> 
>   I hope this is the right Linux list for this issue.  One of our QA staff
> has noticed a new behavior starting about 4.14.0-rc3.  We instantiate PCIe
> SR-IOV Virtual Functions and the corresponding driver (cxgb4vf in this case)
> is automatically loaded.  That's fine and has been the case for some time.
> But, we remove the driver module (rmmod cxgb4vf) and then attach one of the
> VFs to a KVM Virtual Machine and the cxgb4vf driver module gets reloaded in
> the KVM Hypervisor.  This is new behavior.  I see that there was a pretty
> big change done by Luis R. Rodriguez in kernel.org commit revision 2355869
> but we haven't yet isolated the new behavior to that commit.  That'll be our
> next test but I wanted to get this out there for comment.

I'm not sure I understand the problem, generally when doing device
assignment you're using vfio-pci, which I'll assume is the case since
we're talking about an upstream kernel and Legacy KVM device assignment
no longer exists upstream.  That means the VF being assigned needs to
be bound to the vfio-pci driver, which libvirt might do for you if the
hostdev XML is specified with managed='yes'.  At what point is cxgb4vf
being re-loaded?  Is it correlated with the VM starting or VF being
hot-added to a VM or the reverse, VM shutdown or VF removed?  Is the
cxgb4vf driver replacing vfio-pci for the device being assigned?
libvirt might do a drivers_probe on remove, but that behavior shouldn't
have changed.  Being a VF, it needs to support FLR, so that would be
the means vfio would use to reset the device.  I wouldn't expect an FLR
to trigger any sort of device remove/re-add that might cause udev to
reload the driver.  Presumably adding a modprobe.d blacklist entry for
cxgb4vf would resolve it, if so, maybe look at udev events.  If there
are multiple PFs in the host, any creation of new VFs matching the
cxgb4vf driver could trigger udev to re-load the driver.  Thanks,

Alex

  parent reply	other threads:[~2017-10-17 19:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 18:36 4.14.0-rc3 is auto-reloading PCIe SR-IOV Virtual Function device drivers when VFs are attached to VMs Casey Leedom
2017-10-17 19:12 ` Bjorn Helgaas
2017-10-17 19:37 ` Alex Williamson [this message]
2017-10-17 20:54   ` Casey Leedom
     [not found]     ` <CAB=NE6U-1ytEbL9A2FeVjcOfN3VSNAJUa9JbsQH9UfjRfANKxw@mail.gmail.com>
2017-10-18 17:09       ` Casey Leedom
2017-10-18 17:18         ` Luis R. Rodriguez
2017-10-18 17:23           ` Casey Leedom
2017-12-13 21:33             ` Casey Leedom
2017-12-13 21:47               ` Dmitry Torokhov
2017-12-13 21:54                 ` Eric Dumazet
2017-12-13 22:04                   ` Dmitry Torokhov
2017-12-13 22:06                     ` Eric Dumazet
2017-12-13 22:12                       ` Eric Dumazet
2017-12-13 22:18                 ` Casey Leedom
2017-10-18 18:02         ` Bjorn Helgaas
2017-10-18 18:26           ` Casey Leedom

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=20171017133702.1b0e35bc@t450s.home \
    --to=alex.williamson@redhat.com \
    --cc=komali@chelsio.com \
    --cc=leedom@chelsio.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mcgrof@kernel.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).