Re: [PATCH 8/9] vfio/pci: export nvlink2 support into vendor vfio_pci drivers

Alexey Kardashevskiy
2021-03-11T07:55:18Z

On 11/03/2021 13:00, Jason Gunthorpe wrote:
> On Thu, Mar 11, 2021 at 12:42:56PM +1100, Alexey Kardashevskiy wrote:
>>>> btw can the id list have only vendor ids and not have device ids?
>>>
>>> The PCI matcher is quite flexable, see the other patch from Max for
>>> the igd
>>
>> ah cool, do this for NVIDIA GPUs then please, I just discovered another P9
>> system sold with NVIDIA T4s which is not in your list.
>
> I think it will make things easier down the road if you maintain an
> exact list <shrug>

Then why do not you do the exact list for Intel IGD? The commit log does
not explain this detail.

>>> But best practice is to be as narrow as possible as I hope this will
>>> eventually impact module autoloading and other details.
>>
>> The amount of device specific knowledge is too little to tie it up to device
>> ids, it is a generic PCI driver with quirks. We do not have a separate
>> drivers for the hardware which requires quirks.
>
> It provides its own capability structure exposed to userspace, that is
> absolutely not a "quirk"
>
>> And how do you hope this should impact autoloading?
>
> I would like to autoload the most specific vfio driver for the target
> hardware.

Is there an idea how it is going to work? For example, the Intel IGD
driver and vfio-pci-igd - how should the system pick one? If there is no
MODULE_DEVICE_TABLE in vfio-pci-xxx, is the user supposed to try binding
all vfio-pci-xxx drivers until some binds?

> If you someday need to support new GPU HW that needs a different VFIO
> driver then you are really stuck because things become indeterminate
> if there are two devices claiming the ID. We don't have the concept of
> "best match", driver core works on exact match.

--
Alexey