[edk2-devel] SR-IOV setup in edk2

Laszlo Ersek lersek at redhat.com
Mon Mar 22 19:04:05 UTC 2021


On 03/21/21 13:46, Jon Nettleton wrote:
> I am looking for some example code, or direction in how SR-IOV
> functions are expected to be picked up by the platform pcie host
> library so it can setup required bits like LUTs.  Currently the
> HostLib is getting the gEfiPciIoProtocolGuid event and then setting
> the controller up based on the BDF.  I see that PciScanBus is
> detecting the VF's and calling PciAllocateBusNumber().
> 
> PCI-IOV ScanBus - SubBusNumber - 0x2
> PciBus: Discovered PPB @ [00|00|00]
> 
> However my setup function is only ever triggered with the real device
> BDF's...

What do you mean by "setup function"?

If you have a UEFI driver that follows the UEFI driver model, i.e. it
installs at least one instance of the Driver Binding protocol, then it's
up to platform BDS to call ConnectController() on those devices that
should be connected per platform policy.

> Is it up to me to check for the VFs if SR-IOV is enabled and
> set them up manually?  Is there another event I should be listening to
> that will be triggered for VF's vs PF's?

My guess is that platform BDS does not try to connect the PciIo
instances that stand for VFs to any drivers.

In the UEFI shell, try running

  dh -d -v -p PciIo

Pick a handle ID that appears to stand for a VF, then run

  connect <that handle>

Thanks
Laszlo

> 
> Any pointers would be very helpful.
> 
> -Jon
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73149): https://edk2.groups.io/g/devel/message/73149
Mute This Topic: https://groups.io/mt/81498733/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list