lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210110082512.GE31158@unreal>
Date:   Sun, 10 Jan 2021 10:25:12 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Bjorn Helgaas <helgaas@...nel.org>
Cc:     Don Dutile <ddutile@...hat.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Saeed Mahameed <saeedm@...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 Fri, Jan 08, 2021 at 03:09:13PM -0600, Bjorn Helgaas wrote:
> 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.

MSI-X are managed by HW and they are separated between VFs.
IMHO, it will be better if SW won't do too much coordination.

Thanks

>
> 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ