From: Ajit Khaparde Date: Wed, 14 Apr 2021 23:44:49 +0000 (-0700) Subject: net/bnxt: cap max Rx rings for Thor X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fe8dd26f86c7;p=dpdk.git net/bnxt: cap max Rx rings for Thor For Thor devices, RSS table can only accommodate 512 Rx queues. When RSS is enabled, Cap the max Rx rings to 512. For non-RSS case, the number will be limited by number of VNICs. Signed-off-by: Ajit Khaparde Reviewed-by: Lance Richardson --- diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 05f8804274..dfdfa9f7a0 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -844,6 +844,7 @@ 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; @@ -861,6 +862,18 @@ 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); + } + max_tx_rings = RTE_MIN(max_tx_rings, max_rx_rings); if (max_cp_rings > BNXT_NUM_ASYNC_CPR(bp)) max_cp_rings -= BNXT_NUM_ASYNC_CPR(bp); diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index dc3b04110f..9da817f487 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -422,12 +422,13 @@ static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id) if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS) { int j, nr_ctxs = bnxt_rss_ctxts(bp); + /* RSS table size in Thor is 512. + * Cap max Rx rings to same value + */ if (bp->rx_nr_rings > BNXT_RSS_TBL_SIZE_P5) { PMD_DRV_LOG(ERR, "RxQ cnt %d > reta_size %d\n", bp->rx_nr_rings, BNXT_RSS_TBL_SIZE_P5); - PMD_DRV_LOG(ERR, - "Only queues 0-%d will be in RSS table\n", - BNXT_RSS_TBL_SIZE_P5 - 1); + goto err_out; } rc = 0;