aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index bf08ad68b405..5e07efb6ec13 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2018,6 +2018,8 @@ failed:
2018 2018
2019void bnx2x_iov_remove_one(struct bnx2x *bp) 2019void bnx2x_iov_remove_one(struct bnx2x *bp)
2020{ 2020{
2021 int vf_idx;
2022
2021 /* if SRIOV is not enabled there's nothing to do */ 2023 /* if SRIOV is not enabled there's nothing to do */
2022 if (!IS_SRIOV(bp)) 2024 if (!IS_SRIOV(bp))
2023 return; 2025 return;
@@ -2026,6 +2028,18 @@ void bnx2x_iov_remove_one(struct bnx2x *bp)
2026 pci_disable_sriov(bp->pdev); 2028 pci_disable_sriov(bp->pdev);
2027 DP(BNX2X_MSG_IOV, "sriov disabled\n"); 2029 DP(BNX2X_MSG_IOV, "sriov disabled\n");
2028 2030
2031 /* disable access to all VFs */
2032 for (vf_idx = 0; vf_idx < bp->vfdb->sriov.total; vf_idx++) {
2033 bnx2x_pretend_func(bp,
2034 HW_VF_HANDLE(bp,
2035 bp->vfdb->sriov.first_vf_in_pf +
2036 vf_idx));
2037 DP(BNX2X_MSG_IOV, "disabling internal access for vf %d\n",
2038 bp->vfdb->sriov.first_vf_in_pf + vf_idx);
2039 bnx2x_vf_enable_internal(bp, 0);
2040 bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
2041 }
2042
2029 /* free vf database */ 2043 /* free vf database */
2030 __bnx2x_iov_free_vfdb(bp); 2044 __bnx2x_iov_free_vfdb(bp);
2031} 2045}
@@ -3197,7 +3211,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp)
3197 * the "acquire" messages to appear on the VF PF channel. 3211 * the "acquire" messages to appear on the VF PF channel.
3198 */ 3212 */
3199 DP(BNX2X_MSG_IOV, "about to call enable sriov\n"); 3213 DP(BNX2X_MSG_IOV, "about to call enable sriov\n");
3200 pci_disable_sriov(bp->pdev); 3214 bnx2x_disable_sriov(bp);
3201 rc = pci_enable_sriov(bp->pdev, req_vfs); 3215 rc = pci_enable_sriov(bp->pdev, req_vfs);
3202 if (rc) { 3216 if (rc) {
3203 BNX2X_ERR("pci_enable_sriov failed with %d\n", rc); 3217 BNX2X_ERR("pci_enable_sriov failed with %d\n", rc);