Skip to content

Commit c16d4ee

Browse files
Michael Chankuba-moo
authored andcommitted
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: Michael Chan <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 14b41a2 commit c16d4ee

File tree

1 file changed

+12
-7
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+12
-7
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9241,6 +9241,17 @@ void bnxt_half_close_nic(struct bnxt *bp)
92419241
bnxt_free_mem(bp, false);
92429242
}
92439243

9244+
static void bnxt_reenable_sriov(struct bnxt *bp)
9245+
{
9246+
if (BNXT_PF(bp)) {
9247+
struct bnxt_pf_info *pf = &bp->pf;
9248+
int n = pf->active_vfs;
9249+
9250+
if (n)
9251+
bnxt_cfg_hw_sriov(bp, &n, true);
9252+
}
9253+
}
9254+
92449255
static int bnxt_open(struct net_device *dev)
92459256
{
92469257
struct bnxt *bp = netdev_priv(dev);
@@ -9259,13 +9270,7 @@ static int bnxt_open(struct net_device *dev)
92599270
bnxt_hwrm_if_change(bp, false);
92609271
} else {
92619272
if (test_and_clear_bit(BNXT_STATE_FW_RESET_DET, &bp->state)) {
9262-
if (BNXT_PF(bp)) {
9263-
struct bnxt_pf_info *pf = &bp->pf;
9264-
int n = pf->active_vfs;
9265-
9266-
if (n)
9267-
bnxt_cfg_hw_sriov(bp, &n, true);
9268-
}
9273+
bnxt_reenable_sriov(bp);
92699274
if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
92709275
bnxt_ulp_start(bp, 0);
92719276
}

0 commit comments

Comments
 (0)