From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, alexander.duyck@gmail.com,
oss-drivers@netronome.com, Christoph Hellwig <hch@infradead.org>,
Don Dutile <ddutile@redhat.com>
Subject: Re: [PATCH] PCI: reset driver SR-IOV state after remove
Date: Fri, 29 Jun 2018 13:20:04 -0700 [thread overview]
Message-ID: <20180629132004.5cd6eef0@cakuba.netronome.com> (raw)
In-Reply-To: <20180629200934.GB40928@bhelgaas-glaptop.roam.corp.google.com>
On Fri, 29 Jun 2018 15:09:34 -0500, Bjorn Helgaas wrote:
> On Mon, Jun 18, 2018 at 03:01:42PM -0700, Jakub Kicinski wrote:
> > Bjorn points out that currently core and most of the drivers don't
> > clean up dev->sriov->driver_max_VFs settings on .remove(). This
> > means that if a different driver is bound afterwards it will
> > inherit the old setting:
> >
> > - load PF driver 1
> > - driver 1 calls pci_sriov_set_totalvfs() to reduce driver_max_VFs
> > - unload PF driver 1
> > - load PF driver 2
> > # driver 2 does not know to call pci_sriov_set_totalvfs()
> >
> > Some drivers (e.g. nfp) used to do the clean up by calling
> > pci_sriov_set_totalvfs(dev, 0), since 0 was equivalent to no driver
> > limit set. After commit 8d85a7a4f2c9 ("PCI/IOV: Allow PF drivers
> > to limit total_VFs to 0") 0 no longer has this special meaning.
> >
> > The need to reset driver_max_VFs comes from the fact that old FW
> > builds may not expose its VF limits to the drivers, and depend on
> > the ability to reject the configuration change when driver notifies
> > the FW as part of struct pci_driver->sriov_configure() callback.
> > Therefore if there is no information on VF count limits we should
> > use the PCI capability max, and not the last value set by
> > pci_sriov_set_totalvfs().
> >
> > Reset driver_max_VFs back to total_VFs after device remove. If
> > drivers want to reload FW/reconfigure the device while driver is
> > bound we may add an explicit pci_sriov_reset_totalvfs(), but for
> > now no driver is doing that.
> >
> > Fixes: 8d85a7a4f2c9 ("PCI/IOV: Allow PF drivers to limit total_VFs to 0")
> > Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>
> Applied to for-linus for v4.18, thanks!
Awesome, thanks a lot!
next prev parent reply other threads:[~2018-06-29 20:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-18 22:01 [PATCH] PCI: reset driver SR-IOV state after remove Jakub Kicinski
2018-06-26 16:40 ` Jakub Kicinski
2018-06-28 13:56 ` Bjorn Helgaas
2018-06-28 16:17 ` Jakub Kicinski
2018-06-28 18:07 ` Bjorn Helgaas
2018-06-28 18:14 ` Jakub Kicinski
2018-06-28 22:10 ` Bjorn Helgaas
2018-06-28 22:26 ` Jakub Kicinski
2018-06-28 18:30 ` [PATCH] nfp: align setting totalvfs to changes in PCI core Jakub Kicinski
2018-06-29 20:09 ` Bjorn Helgaas
2018-06-29 20:09 ` [PATCH] PCI: reset driver SR-IOV state after remove Bjorn Helgaas
2018-06-29 20:20 ` Jakub Kicinski [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-05-25 21:45 [PATCH] PCI: allow drivers to limit the number of VFs to 0 Bjorn Helgaas
2018-05-26 3:00 ` [PATCH] PCI: reset driver SR-IOV state after remove Jakub Kicinski
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=20180629132004.5cd6eef0@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=alexander.duyck@gmail.com \
--cc=bhelgaas@google.com \
--cc=ddutile@redhat.com \
--cc=hch@infradead.org \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/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).