net/bnxt: limit queue count for NS3/Stingray devices
authorSomnath Kotur <somnath.kotur@broadcom.com>
Wed, 13 Nov 2019 08:29:41 +0000 (13:59 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 20 Nov 2019 16:36:05 +0000 (17:36 +0100)
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 <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_rxq.c
drivers/net/bnxt/bnxt_txq.c

index 9901ba9..e259c82 100644 (file)
@@ -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;
index 94dbe2f..b009669 100644 (file)
@@ -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;
index e7c012f..fa11bec 100644 (file)
@@ -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);
index 6b866d4..2d7645e 100644 (file)
@@ -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);