[dpdk-stable] patch 'net/bnxt: fix HWRM command during FW reset' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:04:07 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

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/21/20. 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.

Thanks.

Luca Boccassi

---
>From 886085974e84c040e84058d508b739875090321b Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Tue, 21 Apr 2020 14:33:46 -0700
Subject: [PATCH] net/bnxt: fix HWRM command during FW reset

[ upstream commit ac2df046a0cabd68e520fafbeaccd35e3e1b86ef ]

FW returns HWRM_ERR_CODE_HOT_RESET_PROGRESS(0xa) when it is
unable to process a specific cmd while hot reset is in progress.
Host driver is expected to keep retrying the cmd for 2s with
a gap of 50ms between each retrial.

Also, fixed to fail port start if the HWRM_FUNC_DRV_IF_CHANGE
still returns error after 2 seconds.

Fixes: 0b533591238f ("net/bnxt: inform firmware about IF state changes")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  5 +++++
 drivers/net/bnxt/bnxt_ethdev.c | 25 +++++++++++++++++--------
 drivers/net/bnxt/bnxt_hwrm.c   |  4 ++++
 3 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 93735a2a46..cfd6f197da 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -470,6 +470,11 @@ struct bnxt_error_recovery_info {
 	uint32_t        last_reset_counter;
 };
 
+/* Frequency for the FUNC_DRV_IF_CHANGE retry in milliseconds */
+#define BNXT_IF_CHANGE_RETRY_INTERVAL	50
+/* Maximum retry count for FUNC_DRV_IF_CHANGE */
+#define BNXT_IF_CHANGE_RETRY_COUNT	40
+
 /* address space location of register */
 #define BNXT_FW_STATUS_REG_TYPE_MASK	3
 /* register is located in PCIe config space */
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index dedb012382..b85ec14005 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -833,7 +833,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	struct bnxt *bp = eth_dev->data->dev_private;
 	uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
 	int vlan_mask = 0;
-	int rc;
+	int rc, retry_cnt = BNXT_IF_CHANGE_RETRY_COUNT;
 
 	if (!eth_dev->data->nb_tx_queues || !eth_dev->data->nb_rx_queues) {
 		PMD_DRV_LOG(ERR, "Queues are not configured yet!\n");
@@ -846,14 +846,23 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 			bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
 	}
 
-	rc = bnxt_hwrm_if_change(bp, 1);
-	if (!rc) {
-		if (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) {
-			rc = bnxt_handle_if_change_status(bp);
-			if (rc)
-				return rc;
-		}
+	do {
+		rc = bnxt_hwrm_if_change(bp, 1);
+		if (rc == 0 || rc != -EAGAIN)
+			break;
+
+		rte_delay_ms(BNXT_IF_CHANGE_RETRY_INTERVAL);
+	} while (retry_cnt--);
+
+	if (rc)
+		return rc;
+
+	if (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) {
+		rc = bnxt_handle_if_change_status(bp);
+		if (rc)
+			return rc;
 	}
+
 	bnxt_enable_int(bp);
 
 	rc = bnxt_init_chip(bp);
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 7408412c9b..b8d1d6322e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -221,6 +221,8 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
 			rc = -EINVAL; \
 		else if (rc == HWRM_ERR_CODE_CMD_NOT_SUPPORTED) \
 			rc = -ENOTSUP; \
+		else if (rc == HWRM_ERR_CODE_HOT_RESET_PROGRESS) \
+			rc = -EAGAIN; \
 		else if (rc > 0) \
 			rc = -EIO; \
 		return rc; \
@@ -249,6 +251,8 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
 			rc = -EINVAL; \
 		else if (rc == HWRM_ERR_CODE_CMD_NOT_SUPPORTED) \
 			rc = -ENOTSUP; \
+		else if (rc == HWRM_ERR_CODE_HOT_RESET_PROGRESS) \
+			rc = -EAGAIN; \
 		else if (rc > 0) \
 			rc = -EIO; \
 		return rc; \
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:49.045497222 +0100
+++ 0112-net-bnxt-fix-HWRM-command-during-FW-reset.patch	2020-05-19 14:04:44.376651273 +0100
@@ -1,8 +1,10 @@
-From ac2df046a0cabd68e520fafbeaccd35e3e1b86ef Mon Sep 17 00:00:00 2001
+From 886085974e84c040e84058d508b739875090321b Mon Sep 17 00:00:00 2001
 From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Date: Tue, 21 Apr 2020 14:33:46 -0700
 Subject: [PATCH] net/bnxt: fix HWRM command during FW reset
 
+[ upstream commit ac2df046a0cabd68e520fafbeaccd35e3e1b86ef ]
+
 FW returns HWRM_ERR_CODE_HOT_RESET_PROGRESS(0xa) when it is
 unable to process a specific cmd while hot reset is in progress.
 Host driver is expected to keep retrying the cmd for 2s with
@@ -12,7 +14,6 @@
 still returns error after 2 seconds.
 
 Fixes: 0b533591238f ("net/bnxt: inform firmware about IF state changes")
-Cc: stable at dpdk.org
 
 Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Reviewed-by: Lance Richardson <lance.richardson at broadcom.com>
@@ -25,10 +26,10 @@
  3 files changed, 26 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
-index a7a9e4113a..d55a570396 100644
+index 93735a2a46..cfd6f197da 100644
 --- a/drivers/net/bnxt/bnxt.h
 +++ b/drivers/net/bnxt/bnxt.h
-@@ -480,6 +480,11 @@ struct bnxt_error_recovery_info {
+@@ -470,6 +470,11 @@ struct bnxt_error_recovery_info {
  	uint32_t        last_reset_counter;
  };
  
@@ -37,14 +38,14 @@
 +/* Maximum retry count for FUNC_DRV_IF_CHANGE */
 +#define BNXT_IF_CHANGE_RETRY_COUNT	40
 +
- struct bnxt_mark_info {
- 	uint32_t	mark_id;
- 	bool		valid;
+ /* address space location of register */
+ #define BNXT_FW_STATUS_REG_TYPE_MASK	3
+ /* register is located in PCIe config space */
 diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
-index 3397c05353..b6c7132564 100644
+index dedb012382..b85ec14005 100644
 --- a/drivers/net/bnxt/bnxt_ethdev.c
 +++ b/drivers/net/bnxt/bnxt_ethdev.c
-@@ -1051,7 +1051,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+@@ -833,7 +833,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
  	struct bnxt *bp = eth_dev->data->dev_private;
  	uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
  	int vlan_mask = 0;
@@ -53,7 +54,7 @@
  
  	if (!eth_dev->data->nb_tx_queues || !eth_dev->data->nb_rx_queues) {
  		PMD_DRV_LOG(ERR, "Queues are not configured yet!\n");
-@@ -1064,14 +1064,23 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+@@ -846,14 +846,23 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
  			bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
  	}
  
@@ -85,7 +86,7 @@
  
  	rc = bnxt_init_chip(bp);
 diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
-index 4c0fac6be1..dc0b405606 100644
+index 7408412c9b..b8d1d6322e 100644
 --- a/drivers/net/bnxt/bnxt_hwrm.c
 +++ b/drivers/net/bnxt/bnxt_hwrm.c
 @@ -221,6 +221,8 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,


More information about the stable mailing list