]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring/zcrx: use dma_len for chunk size calculation
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 31 Mar 2026 21:07:42 +0000 (22:07 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 2 Apr 2026 12:55:47 +0000 (06:55 -0600)
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: 8c0cab0b7bf7 ("io_uring/zcrx: always dma map in advance")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/03b219af3f6cfdd1cf64679b8bab7461e47cc123.1774780198.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c

index d84ad40eae498afb0017f24e68a4eb58e2e201a2..3bf800426fd20be204e004af6b313f1f099c1993 100644 (file)
@@ -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;
 }