• Ariel Elior's avatar
    bnx2x: Disable VF access on PF removal · 826cb7b4
    Ariel Elior authored
    When the bnx2x driver is rmmoded, if VFs of a given PF will be assigned
    to a VM then that PF will be unable to call `pci_disable_sriov()'.
    
    If for that same PF there would also exist unassigned VFs in the hypervisor,
    the result will be that after the removal there will still be virtual PCI
    functions on the hypervisor.
    If the bnx2x module were to be re-inserted, the result will be that the VFs
    on the hypervisor will be re-probed directly following the PF's probe, even
    though that in regular loading flow sriov is only enabled once PF is loaded.
    The probed VF will then try to access its bar, causing a PCI error as the HW
    is not in a state enabling such a request.
    
    This patch adds a missing disablement procedure to the PF's removal, one that
    sets registers viewable to the VF to indicate that the VFs have no permission
    to access the bar, thus resulting in probe errors instead of PCI errors.
    Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
    Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    826cb7b4
bnx2x_sriov.c 99.8 KB