From 6c185117291a85937fa67d402efc4f11b2891c6a Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Tue, 16 Sep 2025 15:27:53 +0100 Subject: [PATCH] io_uring/zcrx: remove dmabuf_offset 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 Signed-off-by: Jens Axboe --- 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 bba92774c8016..bcefb302aadf2 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 109c4ca364344..24ed473632c61 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.47.3