summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/sitecustomize.py
diff options
context:
space:
mode:
authorFoster Nong <foster.nong@intel.com>2022-10-12 10:36:56 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-10-14 07:07:01 +0000
commit8fc06b6e19e3df93cc989b4f85877d8a7783e5bf (patch)
tree24e2a2792a8091ab736069979b79ce1ee920e8f3 /BaseTools/Source/Python/sitecustomize.py
parent4aa7e66c06f8b837845aff2afd7c1c0b35d9afba (diff)
downloadedk2-8fc06b6e19e3df93cc989b4f85877d8a7783e5bf.tar.gz
edk2-8fc06b6e19e3df93cc989b4f85877d8a7783e5bf.tar.bz2
edk2-8fc06b6e19e3df93cc989b4f85877d8a7783e5bf.zip
Fix bug on SRIOV ReservedBusNum when ARI enable.
If a device which support both features SR-IOV/ARI has multi functions, which maybe support 8-255. After enable ARI forwarding in the root port and ARI Capable Hierarchy in the SR-IOV PF0. The device will support and expose multi functions(0-255) with ARI ID routing. In next device loop in below for() code, actually it still be in the same SR-IOV device, and just some PF which is over 8 or higher one(n*8), PciAllocateBusNumber() will allocate bus number(ReservedBusNum - TempReservedBusNum)) for this PF. if reset TempReservedBusNum as 0 in this case,it will allocate wrong bus number for this PF because TempReservedBusNum should be total previous PF's reserved bus numbers. code: for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) { TempReservedBusNum = 0; for (Func = 0; Func <= PCI_MAX_FUNC; Func++) { // // Check to see whether a pci device is present // Status = PciDevicePresent ( PciRootBridgeIo, &Pci, StartBusNumber, Device, Func ); ... Status = PciAllocateBusNumber (PciDevice, *SubBusNumber, (UINT8)(PciDevice->ReservedBusNum - TempReservedBusNum), SubBusNumber); The solution is add a new flag IsAriEnabled to help handle this case. if ARI is enabled, then TempReservedBusNum will not be reset again during all functions(1-255) scan with checking flag IsAriEnabled. Signed-off-by: Foster Nong <foster.nong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/sitecustomize.py')
0 files changed, 0 insertions, 0 deletions