• Wei Yang's avatar
    PCI: Calculate maximum number of buses required for VFs · 4449f079
    Wei Yang authored
    An SR-IOV device can change its First VF Offset and VF Stride based on the
    values of ARI Capable Hierarchy and NumVFs.  The number of buses required
    for all VFs is determined by NumVFs, First VF Offset, and VF Stride (see
    SR-IOV spec r1.1, sec 2.1.2).
    
    Previously pci_iov_bus_range() computed how many buses would be required by
    TotalVFs, but this was based on a single NumVFs value and may not have been
    the maximum for all NumVFs configurations.
    
    Iterate over all valid NumVFs and calculate the maximum number of bus
    numbers that could ever be required for VFs of this device.
    
    [bhelgaas: changelog, compute busnr of NumVFs, not TotalVFs, remove
    kerenl-doc comment marker]
    Signed-off-by: default avatarWei Yang <weiyang@linux.vnet.ibm.com>
    Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    4449f079
pci.h 10.3 KB