|
@@ -2018,6 +2018,8 @@ failed:
|
|
|
|
|
|
void bnx2x_iov_remove_one(struct bnx2x *bp)
|
|
|
{
|
|
|
+ int vf_idx;
|
|
|
+
|
|
|
/* if SRIOV is not enabled there's nothing to do */
|
|
|
if (!IS_SRIOV(bp))
|
|
|
return;
|
|
@@ -2026,6 +2028,18 @@ void bnx2x_iov_remove_one(struct bnx2x *bp)
|
|
|
pci_disable_sriov(bp->pdev);
|
|
|
DP(BNX2X_MSG_IOV, "sriov disabled\n");
|
|
|
|
|
|
+ /* disable access to all VFs */
|
|
|
+ for (vf_idx = 0; vf_idx < bp->vfdb->sriov.total; vf_idx++) {
|
|
|
+ bnx2x_pretend_func(bp,
|
|
|
+ HW_VF_HANDLE(bp,
|
|
|
+ bp->vfdb->sriov.first_vf_in_pf +
|
|
|
+ vf_idx));
|
|
|
+ DP(BNX2X_MSG_IOV, "disabling internal access for vf %d\n",
|
|
|
+ bp->vfdb->sriov.first_vf_in_pf + vf_idx);
|
|
|
+ bnx2x_vf_enable_internal(bp, 0);
|
|
|
+ bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
|
|
|
+ }
|
|
|
+
|
|
|
/* free vf database */
|
|
|
__bnx2x_iov_free_vfdb(bp);
|
|
|
}
|
|
@@ -3197,7 +3211,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp)
|
|
|
* the "acquire" messages to appear on the VF PF channel.
|
|
|
*/
|
|
|
DP(BNX2X_MSG_IOV, "about to call enable sriov\n");
|
|
|
- pci_disable_sriov(bp->pdev);
|
|
|
+ bnx2x_disable_sriov(bp);
|
|
|
rc = pci_enable_sriov(bp->pdev, req_vfs);
|
|
|
if (rc) {
|
|
|
BNX2X_ERR("pci_enable_sriov failed with %d\n", rc);
|