[09/10] net/bnxt: fix to handle if change status in port start only
diff mbox series

Message ID 20191004050246.90165-10-ajit.khaparde@broadcom.com
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • bnxt patchset with bug fixes
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ajit Khaparde Oct. 4, 2019, 5:02 a.m. UTC
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Driver should handle if change status during port start only.
Also fixed to enable interrupts after issuing hwrm_if_change.

Fixes: 92d6617b6e33 ("net/bnxt: inform firmware about IF state changes")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
 drivers/net/bnxt/bnxt_hwrm.c   | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index fb4deef821..81d58a60c5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -867,7 +867,6 @@  static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 			bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
 	}
 
-	bnxt_enable_int(bp);
 	rc = bnxt_hwrm_if_change(bp, 1);
 	if (!rc) {
 		if (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) {
@@ -877,6 +876,8 @@  static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 		}
 	}
 
+	bnxt_enable_int(bp);
+
 	rc = bnxt_init_chip(bp);
 	if (rc)
 		goto error;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 5e3117fee9..f94fdde2b1 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4858,6 +4858,9 @@  int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
 	flags = rte_le_to_cpu_32(resp->flags);
 	HWRM_UNLOCK();
 
+	if (!up)
+		return 0;
+
 	if (flags & HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE) {
 		PMD_DRV_LOG(INFO, "FW reset happened while port was down\n");
 		bp->flags |= BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE;