]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring/zcrx: remove dmabuf_offset
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 16 Sep 2025 14:27:53 +0000 (15:27 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 16 Sep 2025 18:37:20 +0000 (12:37 -0600)
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c
io_uring/zcrx.h

index bba92774c8016b1344384aea95a51c73ea2576af..bcefb302aadf2ba96893d767a9f4d851a7019996 100644 (file)
@@ -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;
index 109c4ca364344e2b73f47a068cb09b66ee1cc766..24ed473632c616a2e0084dfcc63e12ec3af04087 100644 (file)
@@ -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 {