Commit c16d4ee0 authored by Michael Chan's avatar Michael Chan Committed by Jakub Kicinski

bnxt_en: Refactor logic to re-enable SRIOV after firmware reset detected.

Put the current logic in bnxt_open() to re-enable SRIOV after detecting
firmware reset into a new function bnxt_reenable_sriov().  This call
needs to be invoked in the firmware reset path also in the next patch.
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 14b41a29
...@@ -9241,6 +9241,17 @@ void bnxt_half_close_nic(struct bnxt *bp) ...@@ -9241,6 +9241,17 @@ void bnxt_half_close_nic(struct bnxt *bp)
bnxt_free_mem(bp, false); bnxt_free_mem(bp, false);
} }
static void bnxt_reenable_sriov(struct bnxt *bp)
{
if (BNXT_PF(bp)) {
struct bnxt_pf_info *pf = &bp->pf;
int n = pf->active_vfs;
if (n)
bnxt_cfg_hw_sriov(bp, &n, true);
}
}
static int bnxt_open(struct net_device *dev) static int bnxt_open(struct net_device *dev)
{ {
struct bnxt *bp = netdev_priv(dev); struct bnxt *bp = netdev_priv(dev);
...@@ -9259,13 +9270,7 @@ static int bnxt_open(struct net_device *dev) ...@@ -9259,13 +9270,7 @@ static int bnxt_open(struct net_device *dev)
bnxt_hwrm_if_change(bp, false); bnxt_hwrm_if_change(bp, false);
} else { } else {
if (test_and_clear_bit(BNXT_STATE_FW_RESET_DET, &bp->state)) { if (test_and_clear_bit(BNXT_STATE_FW_RESET_DET, &bp->state)) {
if (BNXT_PF(bp)) { bnxt_reenable_sriov(bp);
struct bnxt_pf_info *pf = &bp->pf;
int n = pf->active_vfs;
if (n)
bnxt_cfg_hw_sriov(bp, &n, true);
}
if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
bnxt_ulp_start(bp, 0); bnxt_ulp_start(bp, 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment