Re: [RFC PATCH] pci: add hook for architectures to disble SR-IOV at runtime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 07, 2011 at 09:21:38AM -0600, Bjorn Helgaas wrote:
> On Fri, Oct 7, 2011 at 12:48 AM, Benjamin Herrenschmidt
> <benh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> >> Are you saying that Power is intrinsically unable to support SR-IOV?
> >
> > The 'pseries' platform on power is, at least with the current
> > hypervisor, as the HV doesn't allocate resources for the IOV BAR and the
> > kernel is not allowed to mess around with PCI resources allocation.
> >
> > In the long run, they -may- fix that, but currently, those machines must
> > not enable SR-IOV or bad things happen (sriov_init enables VFs which
> > causes the PF driver to fail as well).
> >
> >> Or is it merely that we can't use SR-IOV on this particular
> >> machine/configuration because the BAR assignments are fixed and there
> >> isn't enough space for the VF BARs?
> >>
> >> I would expect the latter, and therefore it seems wrong to disable it
> >> across the board.  Perhaps on another machine with different PCI
> >> resource assignments, there *would* be space for the VF BARs and
> >> SR-IOV could be used.
> >
> > No. We can never modify the resource allocation and we know that on all
> > current pseries platforms, the HV will not allocate the VF BAR.
> >
> > The patch is not ideal though. Ideally, what you'd need to do is:
> >
> >  - Detect that the VF BAR hasn't been assigned
> >
> >  - Combine that with the knowledge that you cannot re-assign resources
> >   on the platform (this is a flag in asm-generic/pci-flags.h but that's
> >   not available on all archs unfortunately).
> >
> > And based on that, don't try to mess around with VFs etc... in
> > sriov_init().
> 
> Every architecture has to deal with the case that an SR-IOV adapter
> appears, but we can't allocate space for the VF BARs.  It might be
> because of pseries limitations, or it might simply be that there's no
> more space available.  So I'd rather have a generic solution (don't
> enable VFs if we can't allocate resources for them) than an
> arch-specific one (don't enable VFs on pseries).

On x86,  the code anyway works the way you mention. It allocates space
to the VF BARs, only if available and is non-conflicting. If it is
unable to do so, sriov_init() and its friends don't do much.

Should'nt the code in power architecture do the same? i.e disable
the SRIOV resources if the one allocated are conflicting. After that
the rest of the code should take care of itself?

RP

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux