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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96209762-64a8-c710-1b1e-c0cc5207df03@redhat.com>
Date:   Fri, 8 Jan 2021 21:54:47 -0500
From:   Don Dutile <ddutile@...hat.com>
To:     Bjorn Helgaas <helgaas@...nel.org>
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 1/8/21 4:09 PM, 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.
ah, got how your statement relates to the files &/or pdev.

> 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.
>
I'm still not getting why this is not per-(vf)pdev -- just b/c a device has N-number of MSIX capability doesn't mean it has to all be used/configured,
Setting max-MSIX for VFs in the PF's pdev means it is the same number for all VFs ... and I'm not sure that's the right solution either.
It should still be (v)pdev-based, IMO.
--dd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ