[4/4] net/bnxt: fix ring count calculation

Message ID 1619813653-5161-5-git-send-email-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt PMD fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/github-robot success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Ajit Khaparde April 30, 2021, 8:14 p.m. UTC
  Fix ring count calculation for Thor. VNIC count does not have a
direct bearing on the number of rings that can be used.

Fixes: fe8dd26f86c78 ("net/bnxt: cap max Rx rings for Thor")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index bd2dec4..013e291 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -836,7 +836,6 @@  struct bnxt {
 static
 inline uint16_t bnxt_max_rings(struct bnxt *bp)
 {
-	struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
 	uint16_t max_tx_rings = bp->max_tx_rings;
 	uint16_t max_rx_rings = bp->max_rx_rings;
 	uint16_t max_cp_rings = bp->max_cp_rings;
@@ -854,17 +853,12 @@  inline uint16_t bnxt_max_rings(struct bnxt *bp)
 				       bp->max_stat_ctx / 2U);
 	}
 
-	if (BNXT_CHIP_P5(bp)) {
-		/* RSS table size in Thor is 512.
-		 * Cap max Rx rings to the same value for RSS.
-		 * For non-RSS case cap it to the max VNIC count.
-		 */
-		if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
-			max_rx_rings = RTE_MIN(max_rx_rings,
-					       BNXT_RSS_TBL_SIZE_P5);
-		else
-			max_rx_rings = RTE_MIN(max_rx_rings, bp->max_vnics);
-	}
+	/*
+	 * RSS table size in Thor is 512.
+	 * Cap max Rx rings to the same value for RSS.
+	 */
+	if (BNXT_CHIP_P5(bp))
+		max_rx_rings = RTE_MIN(max_rx_rings, BNXT_RSS_TBL_SIZE_P5);
 
 	max_tx_rings = RTE_MIN(max_tx_rings, max_rx_rings);
 	if (max_cp_rings > BNXT_NUM_ASYNC_CPR(bp))