]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2x: Disable VF access on PF removal
authorAriel Elior <ariele@broadcom.com>
Sun, 27 Oct 2013 11:07:01 +0000 (13:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Oct 2013 04:12:45 +0000 (00:12 -0400)
commit0337361be464610c798d396d9d6dc5cb712f9aef
tree39f11053fc44b539abf02322df57c44ccd2871db
parent65555566953ad966b630289100dea8d1f8e51e39
bnx2x: Disable VF access on PF removal

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: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c