From: Jason Gunthorpe <jgg@nvidia.com>
To: Yonatan Nachum <ynachum@amazon.com>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org, mrgolin@amazon.com
Subject: Re: [PATCH for-rc] RDMA: Fix ib block iterator counter overflow
Date: Tue, 3 Jan 2023 09:29:07 -0400 [thread overview]
Message-ID: <Y7Qto2TWsSQyB51x@nvidia.com> (raw)
In-Reply-To: <20230102160317.89851-1-ynachum@amazon.com>
On Mon, Jan 02, 2023 at 06:03:17PM +0200, Yonatan Nachum wrote:
> When registering a new DMA MR after selecting the best aligned page size
> for it, we iterate over the given sglist to split each entry to smaller,
> aligned to the selected page size, DMA blocks.
>
> In given circumstances where the sg entry and page size fit certain sizes
> and the sg entry is not aligned to the selected page size, the total size
> of the aligned pages we need to cover the sg entry is >= 4GB.
Huh? The max length of a scatterlist element is unsigned int:
struct scatterlist {
unsigned long page_link;
unsigned int offset;
unsigned int length;
The problem is the construction of the end of iteration test:
block_offset = biter->__dma_addr & (BIT_ULL(biter->__pg_bit) - 1);
biter->__sg_advance += BIT_ULL(biter->__pg_bit) - block_offset;
if (biter->__sg_advance >= sg_dma_len(biter->__sg)) {
This should be reworked so it doesn't increment until it knows it is
OK and leave the types alone.
Jason
prev parent reply other threads:[~2023-01-03 13:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-02 16:03 [PATCH for-rc] RDMA: Fix ib block iterator counter overflow Yonatan Nachum
2023-01-03 9:43 ` Gal Pressman
2023-01-03 9:46 ` Leon Romanovsky
2023-01-03 13:29 ` 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=Y7Qto2TWsSQyB51x@nvidia.com \
--to=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mrgolin@amazon.com \
--cc=ynachum@amazon.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 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.