From: Showrya M N <showrya@chelsio.com>
To: jgg@ziepe.ca, leon@kernel.org
Cc: bharat@chelsio.com, linux-rdma@vger.kernel.org,
Showrya M N <showrya@chelsio.com>
Subject: [PATCH] RDMA/cxgb4: program the upper 32 bits of the fast-reg MR length
Date: Thu, 3 Dec 2026 13:56:37 -0500 [thread overview]
Message-ID: <20261203185637.27223-1-showrya@chelsio.com> (raw)
From: Potnuri Bharat Teja <bharat@chelsio.com>
ib_mr.length is a u64 and cxgb4 advertises max_mr_size as ~0ULL, but
build_memreg() and build_tpte_memreg() always program len_hi as 0 and
truncate the length into len_lo. A kernel fast-reg MR of 4GB or more,
e.g. one mapped with a large page size, is therefore registered in HW
with a truncated length.
Program len_hi/len_lo from the upper and lower 32 bits of the MR length,
as write_tpt_entry() already does for regular MRs.
Fixes: 8376b86de7d3 ("iw_cxgb4: Support the new memory registration API")
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Showrya M N <showrya@chelsio.com>
---
drivers/infiniband/hw/cxgb4/qp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index e295f79e0cd3..cff7f4b4519e 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -803,8 +803,8 @@ static void build_tpte_memreg(struct fw_ri_fr_nsmr_tpte_wr *fr,
fr->tpte.nosnoop_pbladdr = cpu_to_be32(FW_RI_TPTE_PBLADDR_V(
PBL_OFF(&mhp->rhp->rdev, mhp->attr.pbl_addr)>>3));
fr->tpte.dca_mwbcnt_pstag = cpu_to_be32(0);
- fr->tpte.len_hi = cpu_to_be32(0);
- fr->tpte.len_lo = cpu_to_be32(mhp->ibmr.length);
+ fr->tpte.len_hi = cpu_to_be32(upper_32_bits(mhp->ibmr.length));
+ fr->tpte.len_lo = cpu_to_be32(lower_32_bits(mhp->ibmr.length));
fr->tpte.va_hi = cpu_to_be32(mhp->ibmr.iova >> 32);
fr->tpte.va_lo_fbo = cpu_to_be32(mhp->ibmr.iova & 0xffffffff);
@@ -831,8 +831,8 @@ static int build_memreg(struct t4_sq *sq, union t4_wr *wqe,
wqe->fr.pgsz_shift = ilog2(wr->mr->page_size) - 12;
wqe->fr.addr_type = FW_RI_VA_BASED_TO;
wqe->fr.mem_perms = c4iw_ib_to_tpt_access(wr->access);
- wqe->fr.len_hi = 0;
- wqe->fr.len_lo = cpu_to_be32(mhp->ibmr.length);
+ wqe->fr.len_hi = cpu_to_be32(upper_32_bits(mhp->ibmr.length));
+ wqe->fr.len_lo = cpu_to_be32(lower_32_bits(mhp->ibmr.length));
wqe->fr.stag = cpu_to_be32(wr->key);
wqe->fr.va_hi = cpu_to_be32(mhp->ibmr.iova >> 32);
wqe->fr.va_lo_fbo = cpu_to_be32(mhp->ibmr.iova &
--
2.52.0
next reply other threads:[~2026-12-03 9:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 18:56 Showrya M N [this message]
2026-12-03 9:46 ` [PATCH] RDMA/cxgb4: program the upper 32 bits of the fast-reg MR length sashiko-bot
2026-12-03 21:40 ` [PATCH v2] " Showrya M N
2026-12-03 12:26 ` sashiko-bot
2026-12-03 22:26 ` [PATCH v3] RDMA/cxgb4: fix the length of large fast-reg MRs Showrya M N
2026-12-03 13:14 ` sashiko-bot
2026-12-03 22:50 ` [PATCH v4] " Showrya M N
2026-12-03 13:33 ` sashiko-bot
2026-12-03 19:57 ` Leon Romanovsky
2026-12-03 19:57 ` 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=20261203185637.27223-1-showrya@chelsio.com \
--to=showrya@chelsio.com \
--cc=bharat@chelsio.com \
--cc=jgg@ziepe.ca \
--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.