Netdev List
 help / color / mirror / Atom feed
From: Siva Reddy Kallam <siva.kallam@broadcom.com>
To: leonro@nvidia.com, jgg@nvidia.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rdma@vger.kernel.org, vikas.gupta@broadcom.com,
	ajit.khaparde@broadcom.com, dharmender.garg@broadcom.com,
	sachin.holla@broadcom.com,
	Siva Reddy Kallam <siva.kallam@broadcom.com>
Subject: [RDMA v2 01/13] bnge: Keep the RoCE MSI-X minimum for the MPC vector
Date: Fri,  4 Dec 2026 07:47:53 -0800	[thread overview]
Message-ID: <20261204155249.1002019-2-siva.kallam@broadcom.com> (raw)
In-Reply-To: <20261204155249.1002019-1-siva.kallam@broadcom.com>

The RoCE driver needs three MSI-X vectors at minimum: one for the AEQ
(CREQ), one for the MPC channel and at least one completion vector.
BNGE_MIN_ROCE_CP_RINGS still assumes two, and the default RoCE MSI-X
count is num_online_cpus() + 1 with no lower bound. A 1-CPU function
therefore gets two vectors and bng_re fails to probe.

Raise BNGE_MIN_ROCE_CP_RINGS to 3, and use it as the lower bound of
the default RoCE MSI-X count.

Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
Reviewed-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Dharmender Garg <dharmender.garg@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnge/bnge_auxr.h |  2 +-
 drivers/net/ethernet/broadcom/bnge/bnge_resc.c | 11 ++++++++++-
 drivers/net/ethernet/broadcom/bnge/bnge_resc.h |  2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_auxr.h b/drivers/net/ethernet/broadcom/bnge/bnge_auxr.h
index 13cb9289f5b8..c05782c2c79a 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_auxr.h
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_auxr.h
@@ -6,7 +6,7 @@
 
 #include <linux/auxiliary_bus.h>
 
-#define BNGE_MIN_ROCE_CP_RINGS	2
+#define BNGE_MIN_ROCE_CP_RINGS	3
 #define BNGE_MIN_ROCE_STAT_CTXS	1
 
 #define BNGE_MAX_ROCE_MSIX	64
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
index 82895c236ff6..7efff2740012 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
@@ -54,8 +54,17 @@ static unsigned int bnge_get_max_func_cp_rings(struct bnge_dev *bd)
 static int bnge_aux_get_dflt_msix(struct bnge_dev *bd)
 {
 	int roce_msix = BNGE_MAX_ROCE_MSIX;
+	int roce_msix_min;
 
-	return min_t(int, roce_msix, num_online_cpus() + 1);
+	/*
+	 * One vector per CPU plus one for the CREQ, but never fewer than
+	 * the RoCE minimum, which also covers the MPC vector and one
+	 * completion vector.
+	 */
+	roce_msix_min = max_t(int, BNGE_MIN_ROCE_CP_RINGS,
+			      num_online_cpus() + 1);
+
+	return min_t(int, roce_msix, roce_msix_min);
 }
 
 u16 bnge_aux_get_msix(struct bnge_dev *bd)
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.h b/drivers/net/ethernet/broadcom/bnge/bnge_resc.h
index c0b6992d7f82..03caff0a8bc7 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.h
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.h
@@ -88,7 +88,7 @@ bnge_adjust_pow_two(u32 total_ent, u16 ent_per_blk)
 }
 
 #define BNGE_MAX_ROCE_MSIX		64
-#define BNGE_MIN_ROCE_CP_RINGS		2
+#define BNGE_MIN_ROCE_CP_RINGS		3
 #define BNGE_MIN_ROCE_STAT_CTXS		1
 
 #endif /* _BNGE_RESC_H_ */
-- 
2.43.5


  reply	other threads:[~2026-12-04 16:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 15:47 [RDMA v2 00/13] Add BNG_RE control path verbs Siva Reddy Kallam
2026-12-04 15:47 ` Siva Reddy Kallam [this message]
2026-12-04 15:47 ` [RDMA v2 02/13] RDMA/bng_re: Add MPC, XID management, doorbell infrastructure Siva Reddy Kallam
2026-12-04 15:47 ` [RDMA v2 03/13] RDMA/bng_re: Add support verbs Siva Reddy Kallam
2026-12-04 15:47 ` [RDMA v2 04/13] RDMA/bng_re: Add ucontext/mmap verbs Siva Reddy Kallam
2026-12-04 15:47 ` [RDMA v2 05/13] RDMA/bng_re: Add GID verbs Siva Reddy Kallam
2026-12-04 15:47 ` [RDMA v2 06/13] RDMA/bng_re: Add PD verbs Siva Reddy Kallam
2026-12-04 15:47 ` [RDMA v2 07/13] RDMA/bng_re: Add MR verbs Siva Reddy Kallam
2026-12-04 15:48 ` [RDMA v2 08/13] RDMA/bng_re: Add CQ verbs Siva Reddy Kallam
2026-12-04 15:48 ` [RDMA v2 09/13] RDMA/bng_re: Add SRQ verbs Siva Reddy Kallam
2026-12-04 15:48 ` [RDMA v2 10/13] RDMA/bng_re: Add Stats verbs Siva Reddy Kallam
2026-12-04 15:48 ` [RDMA v2 11/13] RDMA/bng_re: Add AH verbs Siva Reddy Kallam
2026-12-04 15:48 ` [RDMA v2 12/13] RDMA/bng_re: Add QP verbs Siva Reddy Kallam
2026-12-04 15:48 ` [RDMA v2 13/13] RDMA/bng_re: Register with ib-core Siva Reddy Kallam

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=20261204155249.1002019-2-siva.kallam@broadcom.com \
    --to=siva.kallam@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dharmender.garg@broadcom.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sachin.holla@broadcom.com \
    --cc=vikas.gupta@broadcom.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