Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Selvin Xavier <selvin.xavier@broadcom.com>
To: leon@kernel.org, jgg@ziepe.ca
Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com,
	kalesh-anakkur.purayil@broadcom.com,
	Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>,
	Selvin Xavier <selvin.xavier@broadcom.com>
Subject: [PATCH for-next 1/4] RDMA/bnxt_re: Disable CQ overflow detection on P7 adapters based on FW support
Date: Sun, 29 Nov 2026 15:21:02 -0800	[thread overview]
Message-ID: <20261129232105.358484-2-selvin.xavier@broadcom.com> (raw)
In-Reply-To: <20261129232105.358484-1-selvin.xavier@broadcom.com>

From: Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>

Firmware reports that CQ overflow detection is enabled through a new
capability bit in QUERY_FUNC's second extended capability word
(CREQ_QUERY_FUNC_RESP_SB_CQ_OVERFLOW_DETECTION_ENABLED).

Older firmware does not set this bit and has CQ overflow detection
disabled by default, so requesting DISABLE_CQ_OVERFLOW_DETECTION in
CREATE_CQ does not change its behavior. When the bit is set, the driver
does not request the disable.

Add the bit and a _is_cq_overflow_detection_enabled() helper, and have
CREATE_CQ set the DISABLE_CQ_OVERFLOW_DETECTION flag on P7 chips only
when the bit is clear.

Signed-off-by: Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c  | 4 ++++
 drivers/infiniband/hw/bnxt_re/qplib_res.h | 5 +++++
 drivers/infiniband/hw/bnxt_re/roce_hsi.h  | 1 +
 3 files changed, 10 insertions(+)

diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index 5301e4f21ade..57c773521feb 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -2122,6 +2122,10 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
 	req.cq_handle = cpu_to_le64(cq->cq_handle);
 	req.cq_size = cpu_to_le32(cq->max_wqe);
 
+	if (bnxt_qplib_is_chip_gen_p7(res->cctx) &&
+	    !_is_cq_overflow_detection_enabled(res->dattr->dev_cap_flags2))
+		req.flags |= cpu_to_le16(CMDQ_CREATE_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION);
+
 	if (_is_cq_coalescing_supported(res->dattr->dev_cap_flags2) &&
 	    cq->coalescing->enable) {
 		req.flags |= cpu_to_le16(CMDQ_CREATE_CQ_FLAGS_COALESCING_VALID);
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.h b/drivers/infiniband/hw/bnxt_re/qplib_res.h
index b925db796729..9b9c870dd341 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_res.h
+++ b/drivers/infiniband/hw/bnxt_re/qplib_res.h
@@ -628,6 +628,11 @@ static inline bool _is_cq_coalescing_supported(u16 dev_cap_ext_flags2)
 	return dev_cap_ext_flags2 & CREQ_QUERY_FUNC_RESP_SB_CQ_COALESCING_SUPPORTED;
 }
 
+static inline bool _is_cq_overflow_detection_enabled(u16 dev_cap_ext_flags2)
+{
+	return !!(dev_cap_ext_flags2 & CREQ_QUERY_FUNC_RESP_SB_CQ_OVERFLOW_DETECTION_ENABLED);
+}
+
 static inline bool _is_max_srq_ext_supported(u16 dev_cap_ext_flags_2)
 {
 	return !!(dev_cap_ext_flags_2 & CREQ_QUERY_FUNC_RESP_SB_MAX_SRQ_EXTENDED);
diff --git a/drivers/infiniband/hw/bnxt_re/roce_hsi.h b/drivers/infiniband/hw/bnxt_re/roce_hsi.h
index aac338f2afd8..3185e1028385 100644
--- a/drivers/infiniband/hw/bnxt_re/roce_hsi.h
+++ b/drivers/infiniband/hw/bnxt_re/roce_hsi.h
@@ -2260,6 +2260,7 @@ struct creq_query_func_resp_sb {
 	#define CREQ_QUERY_FUNC_RESP_SB_MAX_SRQ_EXTENDED                         0x40UL
 	#define CREQ_QUERY_FUNC_RESP_SB_MODIFY_QP_RATE_LIMIT_SUPPORTED           0x400UL
 	#define CREQ_QUERY_FUNC_RESP_SB_MIN_RNR_RTR_RTS_OPT_SUPPORTED            0x1000UL
+	#define CREQ_QUERY_FUNC_RESP_SB_CQ_OVERFLOW_DETECTION_ENABLED            0x2000UL
 	__le16	max_xp_qp_size;
 	__le16	create_qp_batch_size;
 	__le16	destroy_qp_batch_size;
-- 
2.39.3


  reply	other threads:[~2026-11-29 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 23:21 [PATCH for-next 0/4] RDMA/bnxt_re: CQ and QP updates for app allocated queues Selvin Xavier
2026-11-29 23:21 ` Selvin Xavier [this message]
2026-11-29 23:21 ` [PATCH for-next 2/4] RDMA/bnxt_re: Set CQ coalescing max buffers to 1 for CQs with depth 1 Selvin Xavier
2026-11-29 23:21 ` [PATCH for-next 3/4] RDMA/bnxt_re: Simplify PSN size and QP HWQ setup paths Selvin Xavier
2026-11-29 23:21 ` [PATCH for-next 4/4] RDMA/bnxt_re: Allow user library to request STATIC WQE mode per-QP Selvin Xavier

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=20261129232105.358484-2-selvin.xavier@broadcom.com \
    --to=selvin.xavier@broadcom.com \
    --cc=abhishek.mohapatra@broadcom.com \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=jgg@ziepe.ca \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /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