[dpdk-stable] patch 'net/bnxt: fix FW readiness check during recovery' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:00:03 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/2d5c16160536ea53e820a758a71b6e3150d97f45

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 2d5c16160536ea53e820a758a71b6e3150d97f45 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Wed, 24 Feb 2021 21:25:52 +0530
Subject: [PATCH] net/bnxt: fix FW readiness check during recovery
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 6a4f7139cbce7345e45d9e75d4e28ad1b1218486 ]

Moved fw readiness check to a new routine bnxt_check_fw_ready().

During error recovery, driver needs to wait for fw readiness.
For that, it uses bnxt_hwrm_ver_get() function now and that
function does parsing of the VER_GET response as well.

Added a new lightweight function bnxt_hwrm_poll_ver_get() for polling
the firmware readiness which issues VER_GET and checks for success
without processing the command response.

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 33 +++++++++++++++++++++------------
 drivers/net/bnxt/bnxt_hwrm.c   | 23 +++++++++++++++++++++++
 drivers/net/bnxt/bnxt_hwrm.h   |  1 +
 3 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index f0de861798..f247603edb 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3798,10 +3798,28 @@ static int bnxt_restore_filters(struct bnxt *bp)
 	return ret;
 }
 
+static int bnxt_check_fw_ready(struct bnxt *bp)
+{
+	int timeout = bp->fw_reset_max_msecs;
+	int rc = 0;
+
+	do {
+		rc = bnxt_hwrm_poll_ver_get(bp);
+		if (rc == 0)
+			break;
+		rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);
+		timeout -= BNXT_FW_READY_WAIT_INTERVAL;
+	} while (rc && timeout > 0);
+
+	if (rc)
+		PMD_DRV_LOG(ERR, "FW is not Ready after reset\n");
+
+	return rc;
+}
+
 static void bnxt_dev_recover(void *arg)
 {
 	struct bnxt *bp = arg;
-	int timeout = bp->fw_reset_max_msecs;
 	int rc = 0;
 
 
@@ -3814,18 +3832,9 @@ static void bnxt_dev_recover(void *arg)
 	/* Clear Error flag so that device re-init should happen */
 	bp->flags &= ~BNXT_FLAG_FATAL_ERROR;
 
-	do {
-		rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT);
-		if (rc == 0)
-			break;
-		rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);
-		timeout -= BNXT_FW_READY_WAIT_INTERVAL;
-	} while (rc && timeout);
-
-	if (rc) {
-		PMD_DRV_LOG(ERR, "FW is not Ready after reset\n");
+	rc = bnxt_check_fw_ready(bp);
+	if (rc)
 		goto err;
-	}
 
 	rc = bnxt_init_resources(bp, true);
 	if (rc) {
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 3dce024744..2477237b39 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -5811,3 +5811,26 @@ int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep_bp)
 		    rep_bp->vf_id);
 	return rc;
 }
+
+
+int bnxt_hwrm_poll_ver_get(struct bnxt *bp)
+{
+	struct hwrm_ver_get_input req = {.req_type = 0 };
+	struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr;
+	int rc = 0;
+
+	bp->max_req_len = HWRM_MAX_REQ_LEN;
+	bp->hwrm_cmd_timeout = SHORT_HWRM_CMD_TIMEOUT;
+
+	HWRM_PREP(&req, HWRM_VER_GET, BNXT_USE_CHIMP_MB);
+	req.hwrm_intf_maj = HWRM_VERSION_MAJOR;
+	req.hwrm_intf_min = HWRM_VERSION_MINOR;
+	req.hwrm_intf_upd = HWRM_VERSION_UPDATE;
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+
+	HWRM_CHECK_RESULT_SILENT();
+	HWRM_UNLOCK();
+
+	return rc;
+}
\ No newline at end of file
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index c2bcb7dd63..11b3b1cea1 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -301,4 +301,5 @@ int bnxt_hwrm_first_vf_id_query(struct bnxt *bp, uint16_t fid,
 				uint16_t *first_vf_id);
 int bnxt_hwrm_cfa_pair_alloc(struct bnxt *bp, struct bnxt_representor *rep);
 int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep);
+int bnxt_hwrm_poll_ver_get(struct bnxt *bp);
 #endif
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:28.060118000 +0800
+++ 0055-net-bnxt-fix-FW-readiness-check-during-recovery.patch	2021-05-10 23:59:26.400000000 +0800
@@ -1 +1 @@
-From 6a4f7139cbce7345e45d9e75d4e28ad1b1218486 Mon Sep 17 00:00:00 2001
+From 2d5c16160536ea53e820a758a71b6e3150d97f45 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 6a4f7139cbce7345e45d9e75d4e28ad1b1218486 ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
- drivers/net/bnxt/bnxt_hwrm.c   | 22 ++++++++++++++++++++++
+ drivers/net/bnxt/bnxt_hwrm.c   | 23 +++++++++++++++++++++++
@@ -26 +28 @@
- 3 files changed, 44 insertions(+), 12 deletions(-)
+ 3 files changed, 45 insertions(+), 12 deletions(-)
@@ -29 +31 @@
-index 67ff800da5..af146451a5 100644
+index f0de861798..f247603edb 100644
@@ -32 +34 @@
-@@ -3859,10 +3859,28 @@ static int bnxt_restore_filters(struct bnxt *bp)
+@@ -3798,10 +3798,28 @@ static int bnxt_restore_filters(struct bnxt *bp)
@@ -61,2 +63,2 @@
- 	pthread_mutex_lock(&bp->err_recovery_lock);
-@@ -3876,18 +3894,9 @@ static void bnxt_dev_recover(void *arg)
+ 
+@@ -3814,18 +3832,9 @@ static void bnxt_dev_recover(void *arg)
@@ -84 +86 @@
-index 9142119954..0b5318e238 100644
+index 3dce024744..2477237b39 100644
@@ -87,2 +89,2 @@
-@@ -5913,3 +5913,25 @@ int bnxt_hwrm_fw_echo_reply(struct bnxt *bp, uint32_t echo_req_data1,
- 
+@@ -5811,3 +5811,26 @@ int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep_bp)
+ 		    rep_bp->vf_id);
@@ -91,0 +94 @@
++
@@ -112,0 +116 @@
+\ No newline at end of file
@@ -114 +118 @@
-index c47c2498e9..785e321bfd 100644
+index c2bcb7dd63..11b3b1cea1 100644
@@ -117,4 +121,4 @@
-@@ -304,4 +304,5 @@ int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep);
- int bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(struct bnxt *bp);
- int bnxt_hwrm_fw_echo_reply(struct bnxt *bp, uint32_t echo_req_data1,
- 			    uint32_t echo_req_data2);
+@@ -301,4 +301,5 @@ int bnxt_hwrm_first_vf_id_query(struct bnxt *bp, uint16_t fid,
+ 				uint16_t *first_vf_id);
+ int bnxt_hwrm_cfa_pair_alloc(struct bnxt *bp, struct bnxt_representor *rep);
+ int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep);


More information about the stable mailing list