From: Somnath Kotur Date: Wed, 13 Nov 2019 08:29:41 +0000 (+0530) Subject: net/bnxt: limit queue count for NS3/Stingray devices X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f03e66cb64ce;p=dpdk.git net/bnxt: limit queue count for NS3/Stingray devices Cap max queue count to 128 for NS3 devices and ensure that same count is reported as part of dev_info_get_op as well Signed-off-by: Somnath Kotur Reviewed-by: Rahul Gupta --- diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 9901ba9029..e259c8239d 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -608,6 +608,13 @@ struct bnxt { uint16_t max_cp_rings; uint16_t max_tx_rings; uint16_t max_rx_rings; +#define MAX_STINGRAY_RINGS 128U +#define BNXT_MAX_RINGS(bp) \ + (BNXT_STINGRAY(bp) ? RTE_MIN(RTE_MIN(bp->max_rx_rings, \ + MAX_STINGRAY_RINGS), \ + bp->max_stat_ctx) : \ + RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx)) + uint16_t max_nq_rings; uint16_t max_l2_ctx; uint16_t max_rx_em_flows; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 94dbe2f1dc..b00966942b 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -505,7 +505,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, if (BNXT_PF(bp)) dev_info->max_vfs = pdev->max_vfs; - max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx); + max_rx_rings = BNXT_MAX_RINGS(bp); /* For the sake of symmetry, max_rx_queues = max_tx_queues */ dev_info->max_rx_queues = max_rx_rings; dev_info->max_tx_queues = max_rx_rings; diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index e7c012f68e..fa11bec4ed 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -296,7 +296,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, if (rc) return rc; - if (queue_idx >= bp->max_rx_rings) { + if (queue_idx >= BNXT_MAX_RINGS(bp)) { PMD_DRV_LOG(ERR, "Cannot create Rx ring %d. Only %d rings available\n", queue_idx, bp->max_rx_rings); diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c index 6b866d4454..2d7645eeb0 100644 --- a/drivers/net/bnxt/bnxt_txq.c +++ b/drivers/net/bnxt/bnxt_txq.c @@ -90,7 +90,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev, if (rc) return rc; - if (queue_idx >= bp->max_tx_rings) { + if (queue_idx >= BNXT_MAX_RINGS(bp)) { PMD_DRV_LOG(ERR, "Cannot create Tx ring %d. Only %d rings available\n", queue_idx, bp->max_tx_rings);