lkml.org 
[lkml]   [2017]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v2] PCI: Add an option to control probing of VFs before enabling SR-IOV
On Tue, 11 Apr 2017 16:12:11 -0500
Bjorn Helgaas <helgaas@kernel.org> wrote:

> Hi Bodong,
>
> On Wed, Mar 22, 2017 at 05:53:58PM +0200, bodong@mellanox.com wrote:
> > From: Bodong Wang <bodong@mellanox.com>
> >
> > Sometimes it is not desirable to probe the virtual functions after
> > SRIOV is enabled. This can save host side resource usage by VF
> > instances which would be eventually probed to VMs.
> >
> > Add a new PCI sysfs interface "sriov_probe_vfs" to control that
> > from the PF, all current callers still retain the same functionality.
> > To modify it, echo 0/n/N (disable probe) or 1/y/Y (enable probe) to
> >
> > /sys/bus/pci/devices/<DOMAIN:BUS:DEVICE.FUNCTION>/sriov_probe_vfs
>
> Is this basically the same functionality as /sys/bus/pci/drivers_autoprobe,
> but limited to a specific PF? I.e., could we accomplish the same thing
> with the following?
>
> # echo 0 > /sys/bus/pci/devices/DDDD:BB:dd.f/sriov_numvfs
> # echo 0 > /sys/bus/pci/drivers_autoprobe
> # echo 2 > /sys/bus/pci/devices/DDDD:BB:dd.f/sriov_numvfs
> # echo 1 > /sys/bus/pci/drivers_autoprobe
>
> If not, can you contrast the above with drivers_autoprobe? If we need
> both, should they be named more similarly?

Logically it's similar, but the above is racy, not only would userspace
need to serialize such operations but a device hot added during that
blackout period wouldn't be probed. So this is like a per PF
drivers_autoprobe for the VFs hosted by that device. Thanks,

Alex

> > Note that, the choice must be made before enabling VFs. The change
> > will not take effect if VFs are already enabled. Simply, one can set
> > sriov_numvfs to 0, choose whether to probe or not, and then resume
> > sriov_numvfs.
> >
> > Signed-off-by: Bodong Wang <bodong@mellanox.com>
> > Signed-off-by: Eli Cohen <eli@mellanox.com>
> > Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

\
 
 \ /
  Last update: 2017-04-11 23:52    [W:0.065 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site