net/bnxt: fix rxq start
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.
--- 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
@@ -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
@@ -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 Ð_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)
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.
--- drivers/net/bnxt/bnxt_rxq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_rxq.c +5 -2
@@ -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)
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")Reviewed-by Lance Richardson <[email protected]>Signed-off-by Kalesh AP <[email protected]>Signed-off-by Ajit Khaparde <[email protected]>
For series,
Squashed into relevant commit in next-net, thanks.