All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: asml.silence@gmail.com, axboe@kernel.dk, netdev@vger.kernel.org
Subject: [PATCH io_uring-7.1 3/4] io_uring/zcrx: use dma_len for chunk size calculation
Date: Wed, 25 Mar 2026 12:08:20 +0000	[thread overview]
Message-ID: <554b00a178c93ad65861a58a656ebbbf04b13a8c.1774439286.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1774439286.git.asml.silence@gmail.com>

Buffers are now dma-mapped earlier and we can sg_dma_len(), otherwise,
since it's walking with for_each_sgtable_dma_sg(), it might wrongfully
reject some configurations. As a bonus, it'd now be able to use larger
chunks if dma addresses are coalesced e.g by iommu.

Fixes: 8c0cab0b7bf76 ("always dma map in advance")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 io_uring/zcrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index fc6199edad34..0f98a3c74e2a 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -63,7 +63,7 @@ static int io_area_max_shift(struct io_zcrx_mem *mem)
 	unsigned i;
 
 	for_each_sgtable_dma_sg(sgt, sg, i)
-		shift = min(shift, __ffs(sg->length));
+		shift = min(shift, __ffs(sg_dma_len(sg)));
 	return shift;
 }
 
-- 
2.53.0


  parent reply	other threads:[~2026-03-25 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 12:08 [PATCH io_uring-7.1 0/4] follow up zcrx fixes Pavel Begunkov
2026-03-25 12:08 ` [PATCH io_uring-7.1 1/4] io_uring/zcrx: don't use mark0 for allocating xarray Pavel Begunkov
2026-03-25 12:08 ` [PATCH io_uring-7.1 2/4] io_uring/zcrx: don't clear not allocated niovs Pavel Begunkov
2026-03-25 12:08 ` Pavel Begunkov [this message]
2026-03-25 12:08 ` [PATCH io_uring-7.1 4/4] io_uring/zcrx: use correct mmap off constants Pavel Begunkov
2026-03-25 12:14 ` [PATCH io_uring-7.1 0/4] follow up zcrx fixes Pavel Begunkov

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=554b00a178c93ad65861a58a656ebbbf04b13a8c.1774439286.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=netdev@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.