]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Restore MSIX after disabling SRIOV.
authorMichael Chan <michael.chan@broadcom.com>
Wed, 17 Jan 2018 08:21:05 +0000 (03:21 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Fri, 9 Mar 2018 05:04:38 +0000 (21:04 -0800)
Orabug: 2764835527648339

After SRIOV has been enabled and disabled, the MSIX vectors assigned to
the VFs have to be re-initialized.  Otherwise they cannot be re-used by
the PF.  For example, increasing the number of PF rings after disabling
SRIOV may fail if the PF uses MSIX vectors previously assigned to the VFs.

To fix this, we add logic in bnxt_restore_pf_fw_resources() to close the
NIC, clear and re-init MSIX, and re-open the NIC.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 80fcaf46c09262a71f32bb577c976814c922f864)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Conflicts:
drivers/net/ethernet/broadcom/bnxt/bnxt.h

drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index bcf581917a22b79d2ca45fa79f7390c1ba5124f2..d472151c3d3f737970afe874809fac361551ec71 100644 (file)
@@ -7886,11 +7886,23 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
        return rc;
 }
 
-void bnxt_restore_pf_fw_resources(struct bnxt *bp)
+int bnxt_restore_pf_fw_resources(struct bnxt *bp)
 {
+       int rc;
+
        ASSERT_RTNL();
+       if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP))
+               return 0;
+
        bnxt_hwrm_func_qcaps(bp);
-       bnxt_subtract_ulp_resources(bp, BNXT_ROCE_ULP);
+       __bnxt_close_nic(bp, true, false);
+       bnxt_clear_int_mode(bp);
+       rc = bnxt_init_int_mode(bp);
+       if (rc)
+               dev_close(bp->dev);
+       else
+               rc = bnxt_open_nic(bp, true, false);
+       return rc;
 }
 
 static int bnxt_init_mac_addr(struct bnxt *bp)
index e4877851f85095bf31a15f467a412a2e2828215d..96101470509149e3cca6864b4d62ec6537436b0f 100644 (file)
@@ -1302,5 +1302,5 @@ int bnxt_close_nic(struct bnxt *, bool, bool);
 int bnxt_check_rings(struct bnxt *bp, int tx, int rx, int tcs, int tx_xdp);
 int bnxt_setup_mq_tc(struct net_device *dev, u8 tc);
 int bnxt_get_max_rings(struct bnxt *, int *, int *, bool);
-void bnxt_restore_pf_fw_resources(struct bnxt *bp);
+int bnxt_restore_pf_fw_resources(struct bnxt *bp);
 #endif