[v2,2/4] net/bnxt: keep consistent rxq start/stop state
diff mbox series

Message ID 20191104230225.98450-3-ajit.khaparde@broadcom.com
State Accepted, archived
Delegated to: Ajit Khaparde
Headers show
Series
  • net/bnxt: rxq stop/start fixes
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Nov. 4, 2019, 11:02 p.m. UTC
From: Lance Richardson <lance.richardson@broadcom.com>

Receive queue state needs to reflect "started" state when rebuilding
the RSS table for Thor-based NICs. Move state update so that receive
queues being started are included in the RSS table.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxq.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index ab889c10e..e82eda9d7 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -444,6 +444,8 @@  int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	 * If queue is it started, we do not post buffers for Rx.
 	 */
 	rxq->rx_started = true;
+	dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
+
 	bnxt_free_hwrm_rx_ring(bp, rx_queue_id);
 	rc = bnxt_alloc_hwrm_rx_ring(bp, rx_queue_id);
 	if (rc)
@@ -469,11 +471,11 @@  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;
-	else
+				RTE_ETH_QUEUE_STATE_STOPPED;
 		rxq->rx_started = false;
+	}
 
 	PMD_DRV_LOG(INFO,
 		    "queue %d, rx_deferred_start %d, state %d!\n",