From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Subject: [PATCH 11/14] net/bnxt: modify sending new HWRM commands to firmware
Date: Mon, 4 Dec 2023 10:37:07 -0800 [thread overview]
Message-ID: <20231204183710.86921-12-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20231204183710.86921-1-ajit.khaparde@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 1787 bytes --]
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(+)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 68c4778dc3..f7a60eb9a1 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -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)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 67f8020e3c..ccc5417af1 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -200,6 +200,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. */
@@ -300,6 +304,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;
--
2.39.2 (Apple Git-143)
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]
next prev parent reply other threads:[~2023-12-04 18:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 18:36 [PATCH 00/14] support new 5760X P7 devices Ajit Khaparde
2023-12-04 18:36 ` [PATCH 01/14] net/bnxt: refactor epoch setting Ajit Khaparde
2023-12-04 18:36 ` [PATCH 02/14] net/bnxt: update HWRM API Ajit Khaparde
2023-12-04 18:36 ` [PATCH 03/14] net/bnxt: log a message when multicast promisc mode changes Ajit Khaparde
2023-12-04 18:37 ` [PATCH 04/14] net/bnxt: use the correct COS queue for Tx Ajit Khaparde
2023-12-04 18:37 ` [PATCH 05/14] net/bnxt: refactor mem zone allocation Ajit Khaparde
2023-12-04 18:37 ` [PATCH 06/14] net/bnxt: add support for p7 device family Ajit Khaparde
2023-12-04 18:37 ` [PATCH 07/14] net/bnxt: refactor code to support P7 devices Ajit Khaparde
2023-12-04 18:37 ` [PATCH 08/14] net/bnxt: fix array overflow Ajit Khaparde
2023-12-04 18:37 ` [PATCH 09/14] net/bnxt: add support for backing store v2 Ajit Khaparde
2023-12-04 18:37 ` [PATCH 10/14] net/bnxt: refactor the ulp initialization Ajit Khaparde
2023-12-04 18:37 ` Ajit Khaparde [this message]
2023-12-04 18:37 ` [PATCH 12/14] net/bnxt: retry HWRM ver get if the command fails Ajit Khaparde
2023-12-04 18:37 ` [PATCH 13/14] net/bnxt: cap ring resources for P7 devices Ajit Khaparde
2023-12-04 18:37 ` [PATCH 14/14] net/bnxt: add support for v3 Rx completion Ajit Khaparde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231204183710.86921-12-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--cc=damodharam.ammepalli@broadcom.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).