summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2025-09-16 15:27:53 +0100
committerJens Axboe <axboe@kernel.dk>2025-09-16 12:37:20 -0600
commit6c185117291a85937fa67d402efc4f11b2891c6a (patch)
treece79311782fc770822377d3b02c2162ba409b44f
parent439a98b972fbb1991819b5367f482cd4161ba39c (diff)
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 <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_uring/zcrx.c13
-rw-r--r--io_uring/zcrx.h1
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 {