Skip to content

Commit b340dc6

Browse files
Vasundhara Volamkuba-moo
authored andcommitted
bnxt_en: Avoid sending firmware messages when AER error is detected.
When the driver goes through PCIe AER reset in error state, all firmware messages will timeout because the PCIe bus is no longer accessible. This can lead to AER reset taking many minutes to complete as each firmware command takes time to timeout. Define a new macro BNXT_NO_FW_ACCESS() to skip these firmware messages when either firmware is in fatal error state or when pci_channel_offline() is true. It now takes a more reasonable 20 to 30 seconds to complete AER recovery. Fixes: b4fff20 ("bnxt_en: Do not send firmware messages if firmware is in error state.") Signed-off-by: Vasundhara Volam <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4ddcaf1 commit b340dc6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4305,7 +4305,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
43054305
u32 bar_offset = BNXT_GRCPF_REG_CHIMP_COMM;
43064306
u16 dst = BNXT_HWRM_CHNL_CHIMP;
43074307

4308-
if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
4308+
if (BNXT_NO_FW_ACCESS(bp))
43094309
return -EBUSY;
43104310

43114311
if (msg_len > BNXT_HWRM_MAX_REQ_LEN) {
@@ -5723,7 +5723,7 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp,
57235723
struct hwrm_ring_free_output *resp = bp->hwrm_cmd_resp_addr;
57245724
u16 error_code;
57255725

5726-
if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
5726+
if (BNXT_NO_FW_ACCESS(bp))
57275727
return 0;
57285728

57295729
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_RING_FREE, cmpl_ring_id, -1);
@@ -7817,7 +7817,7 @@ static int bnxt_set_tpa(struct bnxt *bp, bool set_tpa)
78177817

78187818
if (set_tpa)
78197819
tpa_flags = bp->flags & BNXT_FLAG_TPA;
7820-
else if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
7820+
else if (BNXT_NO_FW_ACCESS(bp))
78217821
return 0;
78227822
for (i = 0; i < bp->nr_vnics; i++) {
78237823
rc = bnxt_hwrm_vnic_set_tpa(bp, i, tpa_flags);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,10 @@ struct bnxt {
17371737
#define BNXT_STATE_FW_FATAL_COND 6
17381738
#define BNXT_STATE_DRV_REGISTERED 7
17391739

1740+
#define BNXT_NO_FW_ACCESS(bp) \
1741+
(test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) || \
1742+
pci_channel_offline((bp)->pdev))
1743+
17401744
struct bnxt_irq *irq_tbl;
17411745
int total_irqs;
17421746
u8 mac_addr[ETH_ALEN];

0 commit comments

Comments
 (0)