[1/2] net/bnxt: fix rxq start

Message ID 20190720071956.68197-1-ajit.khaparde@broadcom.com
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • [1/2] net/bnxt: fix rxq start
Related show

Checks

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

Commit Message

Ajit Khaparde July 20, 2019, 7:19 a.m.
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

1. Added a missing return in bnxt_alloc_hwrm_rx_ring().
2. Added a missing return value check
3. Moved the log message to right place.

Fixes: 05b5e4821c1e ("net/bnxt: use dedicated CPR for async events")

Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c |  6 ++----
 drivers/net/bnxt/bnxt_rxq.c  | 17 +++++++++++++----
 2 files changed, 15 insertions(+), 8 deletions(-)

Comments

Ferruh Yigit July 22, 2019, 4:05 p.m. | #1
On 7/20/2019 8:19 AM, Ajit Khaparde wrote:
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> 
> 1. Added a missing return in bnxt_alloc_hwrm_rx_ring().
> 2. Added a missing return value check
> 3. Moved the log message to right place.
> 
> Fixes: 05b5e4821c1e ("net/bnxt: use dedicated CPR for async events")
> 
> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

For series,
Squashed into relevant commit in next-net, thanks.

Patch

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 05a9a200c..80da098ef 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -546,10 +546,8 @@  int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 		bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
 	}
 	rxq->index = queue_index;
-	PMD_DRV_LOG(INFO,
-		    "queue %d, rx_deferred_start %d, state %d!\n",
-		    queue_index, rxq->rx_deferred_start,
-		    bp->eth_dev->data->rx_queue_state[queue_index]);
+
+	return 0;
 
 err_out:
 	PMD_DRV_LOG(ERR,
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index e0eb890f8..4082c3aa9 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -411,10 +411,11 @@  int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 		return -EINVAL;
 	}
 
-	dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
-
 	bnxt_free_hwrm_rx_ring(bp, rx_queue_id);
-	bnxt_alloc_hwrm_rx_ring(bp, rx_queue_id);
+	rc = bnxt_alloc_hwrm_rx_ring(bp, rx_queue_id);
+	if (rc)
+		return rc;
+
 	PMD_DRV_LOG(INFO, "Rx queue started %d\n", rx_queue_id);
 
 	if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {
@@ -435,8 +436,16 @@  int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 		rc = bnxt_vnic_rss_configure(bp, vnic);
 	}
 
-	if (rc == 0)
+	if (rc == 0) {
+		dev->data->rx_queue_state[rx_queue_id] =
+				RTE_ETH_QUEUE_STATE_STARTED;
 		rxq->rx_deferred_start = false;
+	}
+
+	PMD_DRV_LOG(INFO,
+		    "queue %d, rx_deferred_start %d, state %d!\n",
+		    rx_queue_id, rxq->rx_deferred_start,
+		    bp->eth_dev->data->rx_queue_state[rx_queue_id]);
 
 	return rc;
 }