[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210108210913.GA1471923@bjorn-Precision-5520>
Date: Fri, 8 Jan 2021 15:09:13 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Don Dutile <ddutile@...hat.com>
Cc: Leon Romanovsky <leon@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Saeed Mahameed <saeedm@...dia.com>,
Leon Romanovsky <leonro@...dia.com>,
Jason Gunthorpe <jgg@...dia.com>,
Jakub Kicinski <kuba@...nel.org>, linux-pci@...r.kernel.org,
linux-rdma@...r.kernel.org, netdev@...r.kernel.org,
Alex Williamson <alex.williamson@...hat.com>
Subject: Re: [PATCH mlx5-next 1/4] PCI: Configure number of MSI-X vectors for
SR-IOV VFs
On Thu, Jan 07, 2021 at 10:54:38PM -0500, Don Dutile wrote:
> On 1/7/21 7:57 PM, Bjorn Helgaas wrote:
> > On Sun, Jan 03, 2021 at 10:24:37AM +0200, Leon Romanovsky wrote:
> > > + **/
> > > +int pci_set_msix_vec_count(struct pci_dev *dev, int numb)
> > > +{
> > > + struct pci_dev *pdev = pci_physfn(dev);
> > > +
> > > + if (!dev->msix_cap || !pdev->msix_cap)
> > > + return -EINVAL;
> > > +
> > > + if (dev->driver || !pdev->driver ||
> > > + !pdev->driver->sriov_set_msix_vec_count)
> > > + return -EOPNOTSUPP;
> > > +
> > > + if (numb < 0)
> > > + /*
> > > + * We don't support negative numbers for now,
> > > + * but maybe in the future it will make sense.
> > > + */
> > > + return -EINVAL;
> > > +
> > > + return pdev->driver->sriov_set_msix_vec_count(dev, numb);
> >
> > So we write to a VF sysfs file, get here and look up the PF, call a PF
> > driver callback with the VF as an argument, the callback (at least for
> > mlx5) looks up the PF from the VF, then does some mlx5-specific magic
> > to the PF that influences the VF somehow?
>
> There's no PF lookup above.... it's just checking if a pdev has a
> driver with the desired msix-cap setting(reduction) feature.
We started with the VF (the sysfs file is attached to the VF). "pdev"
is the corresponding PF; that's what I meant by "looking up the PF".
Then we call the PF driver sriov_set_msix_vec_count() method.
I asked because this raises questions of whether we need mutual
exclusion or some other coordination between setting this for multiple
VFs.
Obviously it's great to answer all these in email, but at the end of
the day, the rationale needs to be in the commit, either in code
comments or the commit log.
Powered by blists - more mailing lists