Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Jared Holzman <jholzman@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] rxe: Fix dma.length computation in wr_set_sge_list
Date: Wed, 3 Jun 2026 15:11:04 -0300	[thread overview]
Message-ID: <20260603181104.GA1565410@nvidia.com> (raw)
In-Reply-To: <20260531120721.1347977-1-jholzman@nvidia.com>

On Sun, May 31, 2026 at 03:07:21PM +0300, Jared Holzman wrote:
> wr_set_sge_list() summed the SGE lengths with a loop that never
> advanced sg_list:
> 
> 	while (num_sge--)
> 		tot_length += sg_list->length;
> 
> so tot_length ended up as num_sge * sg_list[0].length instead of the
> true sum, and wqe->dma.length / wqe->dma.resid were written with that
> wrong value. The per-SGE entries themselves were unaffected because
> they are populated by the preceding memcpy().
> 
> The kernel rxe driver requires dma.length == sum(sge[i].length) and
> enforces it in rxe_mr.c:copy_data(), so a multi-SGE WR posted through
> the ibv_qp_ex builder API (ibv_wr_set_sge_list) on rxe completes with
> IB_WC_LOC_PROT_ERR once finish_packet()/copy_data() runs off the end
> of the SGE list.
> 
> The legacy ibv_post_send path (init_send_wqe) is unaffected; it sums
> the lengths with an indexed for loop.
> 
> Fix by computing the total with an indexed loop, matching the style
> already used in rxe_post_one_recv() and init_send_wqe() in this file.
> 
> Fixes: 1a894ca10105 ("Providers/rxe: Implement ibv_create_qp_ex verb")
> Signed-off-by: Jared Holzman <jholzman@nvidia.com>
> PR: https://github.com/linux-rdma/rdma-core/pull/1744

I don't know what this is, upstream doesn't have this code qp_ex
support or 1a894ca10105

The rdma-core thing looks OK though.

Jason

      parent reply	other threads:[~2026-06-03 18:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31 12:07 [PATCH] rxe: Fix dma.length computation in wr_set_sge_list Jared Holzman
2026-05-31 18:11 ` Zhu Yanjun
2026-06-03 18:11 ` Jason Gunthorpe [this message]

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=20260603181104.GA1565410@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=jholzman@nvidia.com \
    --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