Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Showrya M N" <showrya@chelsio.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH v2] RDMA/cxgb4: program the upper 32 bits of the fast-reg MR length
Date: Thu, 03 Dec 2026 12:26:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-247721@kernel.org> (raw)
In-Reply-To: <20261203214018.40717-1-showrya@chelsio.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] RDMA/cxgb4: build_memreg() omits T5 8 GiB MR limit when
  setting len_hi
--

commit 601ccce55408925f0a6e4b1599dc46426fab8ed8
Author: Potnuri Bharat Teja <bharat@chelsio.com>

RDMA/cxgb4: program the upper 32 bits of the fast-reg MR length

This commit updates build_tpte_memreg() and build_memreg() to program both
the upper and lower 32 bits of mhp->ibmr.length into len_hi and len_lo
instead of hardcoding len_hi to 0.

> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index e295f79e0cd3e..cff7f4b4519e4 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c

[ ... ]

> @@ -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));

[Severity: Medium]
Should build_memreg() also enforce the T4/T5 < 8 GiB MR limit before
programming len_hi?

Commit 2550a88d956f ("RDMA/cxgb4: Limit MRs to < 8GB for T4/T5 devices")
added mr_exceeds_hw_limits() in mem.c because T4/T5 hardware cannot handle
MRs of 8 GiB or more, and c4iw_reg_user_mr() checks it before calling
write_tpt_entry().

On T5 with DSGL enabled, c4iw_query_device() advertises up to 128 fast-reg
pages and 128 MiB pages, allowing 8 GiB to 16 GiB fast-reg MRs.  Neither
c4iw_map_mr_sg() nor c4iw_post_send() checks mr_exceeds_hw_limits(), so
build_memreg() now programs >= 8 GiB MRs into T5 hardware.

Exposing mr_exceeds_hw_limits() and returning -EINVAL when it triggers in
build_memreg() (or c4iw_map_mr_sg()) would keep fast-reg MRs within the
hardware limit.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203214018.40717-1-showrya@chelsio.com?part=1

  reply	other threads:[~2026-12-03 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 18:56 [PATCH] RDMA/cxgb4: program the upper 32 bits of the fast-reg MR length Showrya M N
2026-12-03  9:46 ` sashiko-bot
2026-12-03 21:40 ` [PATCH v2] " Showrya M N
2026-12-03 12:26   ` sashiko-bot [this message]
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

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=sashiko-outbox-247721@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=showrya@chelsio.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