DPDK patches and discussions
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH 2/6] net/bnxt: fix to cap queue count for NS3/Stingray devices
Date: Wed, 13 Nov 2019 13:59:41 +0530	[thread overview]
Message-ID: <20191113082945.21277-3-somnath.kotur@broadcom.com> (raw)
In-Reply-To: <20191113082945.21277-1-somnath.kotur@broadcom.com>

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        | 7 +++++++
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 drivers/net/bnxt/bnxt_rxq.c    | 2 +-
 drivers/net/bnxt/bnxt_txq.c    | 2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 9901ba902..e259c8239 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 9aff38298..3a45fb6c7 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -504,7 +504,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 e7c012f68..fa11bec4e 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 6b866d445..2d7645eeb 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);
-- 
2.23.0.rc1


  parent reply	other threads:[~2019-11-13  8:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13  8:29 [dpdk-dev] [PATCH 0/6] bnxt patchset with bug fixes Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 1/6] net/bnxt: add missing checks for fw reset Somnath Kotur
2019-11-13  8:29 ` Somnath Kotur [this message]
2019-11-13  8:29 ` [dpdk-dev] [PATCH 3/6] net/bnxt: fix flow creation with non-consecutive group ids Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 4/6] net/bnxt: fix a potential segfault in xstats get Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 5/6] net/bnxt: change print message type from ERR to DEBUG Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 6/6] net/bnxt: fix potential NULL pointer dereference Somnath Kotur
2019-11-13 15:06 ` [dpdk-dev] [PATCH v2 0/6] bnxt patchset with bug fixes Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 1/6] net/bnxt: add missing checks for firmware reset Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 2/6] net/bnxt: cap queue count for NS3/Stingray devices Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 3/6] net/bnxt: fix flow creation with non-consecutive group ids Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 4/6] net/bnxt: fix a potential segfault in xstats get Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 5/6] net/bnxt: change print message type from ERR to DEBUG Ajit Khaparde
2019-11-13 15:07   ` [dpdk-dev] [PATCH v2 6/6] net/bnxt: fix potential NULL pointer dereference Ajit Khaparde
2019-11-13 15:14   ` [dpdk-dev] [PATCH v2 0/6] bnxt patchset with bug fixes Ajit Khaparde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191113082945.21277-3-somnath.kotur@broadcom.com \
    --to=somnath.kotur@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).