[PATCH io_uring for-6.18 10/20] io_uring/zcrx: remove dmabuf_offset
From: Pavel Begunkov <asml.silence@gmail.com>
Date: 2025-09-16 14:27:01
Also in:
io-uring
Subsystem:
io_uring, io_uring zcrx, the rest · Maintainers:
Jens Axboe, Pavel Begunkov, Linus Torvalds
It was removed from uapi, so now it's always 0 and can be removed together with offset handling in io_populate_area_dma(). Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> --- io_uring/zcrx.c | 13 ++----------- io_uring/zcrx.h | 1 - 2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index bba92774c801..bcefb302aadf 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c@@ -53,7 +53,7 @@ static inline struct page *io_zcrx_iov_page(const struct net_iov *niov) static int io_populate_area_dma(struct io_zcrx_ifq *ifq, struct io_zcrx_area *area, - struct sg_table *sgt, unsigned long off) + struct sg_table *sgt) { struct scatterlist *sg; unsigned i, niov_idx = 0;
@@ -61,11 +61,6 @@ static int io_populate_area_dma(struct io_zcrx_ifq *ifq, for_each_sgtable_dma_sg(sgt, sg, i) { dma_addr_t dma = sg_dma_address(sg); unsigned long sg_len = sg_dma_len(sg); - unsigned long sg_off = min(sg_len, off); - - off -= sg_off; - sg_len -= sg_off; - dma += sg_off; while (sg_len && niov_idx < area->nia.num_niovs) { struct net_iov *niov = &area->nia.niovs[niov_idx];
@@ -149,7 +144,6 @@ static int io_import_dmabuf(struct io_zcrx_ifq *ifq, goto err; } - mem->dmabuf_offset = off; mem->size = len; return 0; err:
@@ -269,7 +263,6 @@ static void io_zcrx_unmap_area(struct io_zcrx_ifq *ifq, static int io_zcrx_map_area(struct io_zcrx_ifq *ifq, struct io_zcrx_area *area) { - unsigned long offset; struct sg_table *sgt; int ret;
@@ -283,13 +276,11 @@ static int io_zcrx_map_area(struct io_zcrx_ifq *ifq, struct io_zcrx_area *area) if (ret < 0) return ret; sgt = &area->mem.page_sg_table; - offset = 0; } else { sgt = area->mem.sgt; - offset = area->mem.dmabuf_offset; } - ret = io_populate_area_dma(ifq, area, sgt, offset); + ret = io_populate_area_dma(ifq, area, sgt); if (ret == 0) area->is_mapped = true; return ret;
diff --git a/io_uring/zcrx.h b/io_uring/zcrx.h
index 109c4ca36434..24ed473632c6 100644
--- a/io_uring/zcrx.h
+++ b/io_uring/zcrx.h@@ -20,7 +20,6 @@ struct io_zcrx_mem { struct dma_buf_attachment *attach; struct dma_buf *dmabuf; struct sg_table *sgt; - unsigned long dmabuf_offset; }; struct io_zcrx_area {
--
2.49.0