All of lore.kernel.org
 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 v2 2/4] RDMA/bnxt_re: Set CQ coalescing max buffers to 1 for CQs with depth 1
Date: Mon, 30 Nov 2026 06:53:42 -0800	[thread overview]
Message-ID: <20261130145344.322857-3-selvin.xavier@broadcom.com> (raw)
In-Reply-To: <20261130145344.322857-1-selvin.xavier@broadcom.com>

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

When the CQ depth is 1, program NORMAL_MAXBUF and DURING_MAXBUF to 1
in bnxt_qplib_create_cq(). A single-entry CQ has at most one
outstanding completion, so firmware flushes it as soon as it is
buffered instead of waiting for more.

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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index 41bde91432cb..0ab3fedd03f0 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -2077,6 +2077,8 @@ int bnxt_qplib_post_recv(struct bnxt_qplib_qp *qp,
 /* CQ */
 int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
 {
+	u8 normal_maxbuf = cq->coalescing->normal_maxbuf;
+	u8 during_maxbuf = cq->coalescing->during_maxbuf;
 	struct bnxt_qplib_rcfw *rcfw = res->rcfw;
 	struct bnxt_qplib_hwq_attr hwq_attr = {};
 	struct creq_create_cq_resp resp = {};
@@ -2118,13 +2120,17 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
 	if (_is_cq_coalescing_supported(res->dattr->dev_cap_flags2) &&
 	    cq->coalescing->enable) {
 		req.flags |= cpu_to_le16(CMDQ_CREATE_CQ_FLAGS_COALESCING_VALID);
+		if (cq->max_wqe == 1) {
+			normal_maxbuf = 0x1;
+			during_maxbuf = 0x1;
+		}
 		coalescing |= ((cq->coalescing->buf_maxtime <<
 				CMDQ_CREATE_CQ_BUF_MAXTIME_SFT) &
 			       CMDQ_CREATE_CQ_BUF_MAXTIME_MASK);
-		coalescing |= ((cq->coalescing->normal_maxbuf <<
+		coalescing |= ((normal_maxbuf <<
 				CMDQ_CREATE_CQ_NORMAL_MAXBUF_SFT) &
 			       CMDQ_CREATE_CQ_NORMAL_MAXBUF_MASK);
-		coalescing |= ((cq->coalescing->during_maxbuf <<
+		coalescing |= ((during_maxbuf <<
 				CMDQ_CREATE_CQ_DURING_MAXBUF_SFT) &
 			       CMDQ_CREATE_CQ_DURING_MAXBUF_MASK);
 		if (cq->coalescing->en_ring_idle_mode)
-- 
2.39.3


  parent reply	other threads:[~2026-11-30  9:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 14:53 [PATCH for-next v2 0/4] RDMA/bnxt_re: CQ and QP updates for app allocated queues Selvin Xavier
2026-11-30  9:51 ` sashiko-bot
2026-11-30 14:53 ` [PATCH for-next v2 1/4] RDMA/bnxt_re: Disable CQ overflow detection on P7 adapters based on FW support Selvin Xavier
2026-11-30 14:53 ` Selvin Xavier [this message]
2026-11-30 14:53 ` [PATCH for-next v2 3/4] RDMA/bnxt_re: Simplify PSN size and QP HWQ setup paths Selvin Xavier
2026-11-30 14:53 ` [PATCH for-next v2 4/4] RDMA/bnxt_re: Allow user library to request STATIC WQE mode per-QP Selvin Xavier
2026-11-30  9:51   ` sashiko-bot
2026-12-02  8:31 ` [PATCH for-next v2 0/4] RDMA/bnxt_re: CQ and QP updates for app allocated queues Leon Romanovsky

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=20261130145344.322857-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.