Skip to contentSkip to conversation

net/bnxt: fix rxq start

PATCH In review Ajit Khaparde 2 participants 3 messages Jul 20, 2019 – Jul 22, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net/bnxt: fix rxq start

From: Kalesh AP <[email protected]>

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")
---
 drivers/net/bnxt/bnxt_ring.c |  6 ++----
 drivers/net/bnxt/bnxt_rxq.c  | 17 +++++++++++++----
 2 files changed, 15 insertions(+), 8 deletions(-)
drivers/net/bnxt/bnxt_ring.c +2 -4
index 05a9a200c..80da098ef 100644
@@ -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,
drivers/net/bnxt/bnxt_rxq.c +13 -4
index e0eb890f8..4082c3aa9 100644
@@ -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;
 }
Signature · 1 line
2.20.1 (Apple Git-117)
#1 lore raw

PATCH 2/2 net/bnxt: fix an issue with rxq0 stop

From: Kalesh AP <[email protected]>

For the stingray platform and other platforms needing tighter control of resource utilization, we process async events on receive completion ring0.

For other chips there is a dedicated completion ring for asynchronous event handling instead of handling these events on a receive completion ring.

This patch fixes the check for rxq0 stop.

Fixes 05b5e4821c1e ("net/bnxt: use dedicated CPR for async events")
---
 drivers/net/bnxt/bnxt_rxq.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_rxq.c +5 -2
index 4082c3aa9..8c7608621 100644
@@ -458,8 +458,11 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	struct bnxt_rx_queue *rxq = NULL;
 	int rc = 0;
 
-	/* Rx CQ 0 also works as Default CQ for async notifications */
-	if (!rx_queue_id) {
+	/* For the stingray platform and other platforms needing tighter
+	 * control of resource utilization, Rx CQ 0 also works as
+	 * Default CQ for async notifications
+	 */
+	if (!BNXT_NUM_ASYNC_CPR && !rx_queue_id) {
 		PMD_DRV_LOG(ERR, "Cannot stop Rx queue id %d\n", rx_queue_id);
 		return -EINVAL;
 	}
Signature · 1 line
2.20.1 (Apple Git-117)
#2 lore raw
In reply to Ajit Khaparde
Quoted 11 lines · Ajit Khaparde

From: Kalesh AP <[email protected]>

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")

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