[v3,11/14] net/bnxt: modify sending new HWRM commands to firmware
Checks
Commit Message
If the firmware fails to respond a HWRM command in a certain time,
it may be because the firmware is in a bad state.
Do not send any new HWRM commands in such a scenario.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 1 +
drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
2 files changed, 6 insertions(+)
@@ -745,6 +745,7 @@ struct bnxt {
#define BNXT_FLAG_DFLT_MAC_SET BIT(26)
#define BNXT_FLAG_GFID_ENABLE BIT(27)
#define BNXT_FLAG_CHIP_P7 BIT(30)
+#define BNXT_FLAG_FW_TIMEDOUT BIT(31)
#define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF))
#define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF)
#define BNXT_NPAR(bp) ((bp)->flags & BNXT_FLAG_NPAR_PF)
@@ -215,6 +215,10 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
if (bp->flags & BNXT_FLAG_FATAL_ERROR)
return 0;
+ /* If previous HWRM command timed out, donot send new HWRM command */
+ if (bp->flags & BNXT_FLAG_FW_TIMEDOUT)
+ return 0;
+
timeout = bp->hwrm_cmd_timeout;
/* Update the message length for backing store config for new FW. */
@@ -315,6 +319,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
PMD_DRV_LOG(ERR,
"Error(timeout) sending msg 0x%04x, seq_id %d\n",
req->req_type, req->seq_id);
+ bp->flags |= BNXT_FLAG_FW_TIMEDOUT;
return -ETIMEDOUT;
}
return 0;