All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, Netdev <netdev@vger.kernel.org>,
	Sathya Perla <sathya.perla@broadcom.com>,
	Felix Manlunas <felix.manlunas@caviumnetworks.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Donald Dutile <ddutile@redhat.com>,
	oss-drivers@netronome.com
Subject: Re: [PATCH] PCI: allow drivers to limit the number of VFs to 0
Date: Mon, 2 Apr 2018 14:18:45 -0700	[thread overview]
Message-ID: <20180402141845.46e6c280@cakuba.netronome.com> (raw)
In-Reply-To: <CAKgT0UfihwxLWf7BqP=Z87S83DPoqaR4MDq8UT8R4D6Puspy6w@mail.gmail.com>

On Fri, 30 Mar 2018 09:54:37 -0700, Alexander Duyck wrote:
> On Fri, Mar 30, 2018 at 4:49 AM, Christoph Hellwig <hch@infradead.org> wrote:
> > On Thu, Mar 29, 2018 at 11:22:31AM -0700, Jakub Kicinski wrote:  
> >> Some user space depends on driver allowing sriov_totalvfs to be
> >> enabled.  
> >
> > I can't make sene of this sentence.  Can you explain what user space
> > code depends on what semantics?  The sriov_totalvfs file should show
> > up for any device supporting SR-IOV as far as I can tell.
> >  
> >>
> >> For devices which VF support depends on loaded FW we
> >> have the pci_sriov_{g,s}et_totalvfs() API.  However, this API
> >> uses 0 as a special "unset" value, meaning drivers can't limit
> >> sriov_totalvfs to 0.  Change the special value to be U16_MAX.
> >> Use simple min() to determine actual totalvfs.  
> >
> > Please use a PCI_MAX_VFS or similar define instead of plain U16_MAX or ~0.  
> 
> Actually is there any reason why driver_max_VFs couldn't just be
> initialized to the same value as total_VFs?
> 
> Also looking over the patch I don't see how writing ~0 would be
> accepted unless you also make changes to pci_sriov_set_totalvfs since
> it should fail the "numvfs > dev->sriov->total_VFs" check. You might
> just want to look at adding a new function that would reset the
> driver_max_VFs value instead of trying to write it to an arbitrary
> value from the driver.

Ack, the reset function plus using total_VFs as unset seems a lot
cleaner, thanks!

  reply	other threads:[~2018-04-02 21:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 18:22 [PATCH] PCI: allow drivers to limit the number of VFs to 0 Jakub Kicinski
2018-03-30 11:49 ` Christoph Hellwig
2018-03-30 16:54   ` Alexander Duyck
2018-04-02 21:18     ` Jakub Kicinski [this message]
2018-04-02 21:17   ` Jakub Kicinski
2018-04-02 22:46 Jakub Kicinski
2018-05-24 23:57 ` Bjorn Helgaas
2018-05-25  1:20   ` Jakub Kicinski
2018-05-25 14:02     ` Bjorn Helgaas
2018-05-25 17:01       ` Bjorn Helgaas
2018-05-25 17:46         ` Keller, Jacob E
2018-05-25 17:46           ` Keller, Jacob E
2018-05-25 19:27       ` Don Dutile
2018-05-25 20:46         ` Bjorn Helgaas
2018-05-29 14:29           ` Don Dutile
2018-05-25 21:05       ` Jakub Kicinski
2018-05-25 21:45         ` Bjorn Helgaas
2018-05-29 14:34         ` Don Dutile
2018-06-19 21:37       ` Bjorn Helgaas
2018-06-20  2:56         ` 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=20180402141845.46e6c280@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=alexander.duyck@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=ddutile@redhat.com \
    --cc=felix.manlunas@caviumnetworks.com \
    --cc=hch@infradead.org \
    --cc=jacob.e.keller@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=sathya.perla@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.