Skip to content

Commit 6c18511

Browse files
isilenceaxboe
authored andcommitted
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>
1 parent 439a98b commit 6c18511

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

io_uring/zcrx.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,14 @@ static inline struct page *io_zcrx_iov_page(const struct net_iov *niov)
5353

5454
static int io_populate_area_dma(struct io_zcrx_ifq *ifq,
5555
struct io_zcrx_area *area,
56-
struct sg_table *sgt, unsigned long off)
56+
struct sg_table *sgt)
5757
{
5858
struct scatterlist *sg;
5959
unsigned i, niov_idx = 0;
6060

6161
for_each_sgtable_dma_sg(sgt, sg, i) {
6262
dma_addr_t dma = sg_dma_address(sg);
6363
unsigned long sg_len = sg_dma_len(sg);
64-
unsigned long sg_off = min(sg_len, off);
65-
66-
off -= sg_off;
67-
sg_len -= sg_off;
68-
dma += sg_off;
6964

7065
while (sg_len && niov_idx < area->nia.num_niovs) {
7166
struct net_iov *niov = &area->nia.niovs[niov_idx];
@@ -149,7 +144,6 @@ static int io_import_dmabuf(struct io_zcrx_ifq *ifq,
149144
goto err;
150145
}
151146

152-
mem->dmabuf_offset = off;
153147
mem->size = len;
154148
return 0;
155149
err:
@@ -269,7 +263,6 @@ static void io_zcrx_unmap_area(struct io_zcrx_ifq *ifq,
269263

270264
static int io_zcrx_map_area(struct io_zcrx_ifq *ifq, struct io_zcrx_area *area)
271265
{
272-
unsigned long offset;
273266
struct sg_table *sgt;
274267
int ret;
275268

@@ -283,13 +276,11 @@ static int io_zcrx_map_area(struct io_zcrx_ifq *ifq, struct io_zcrx_area *area)
283276
if (ret < 0)
284277
return ret;
285278
sgt = &area->mem.page_sg_table;
286-
offset = 0;
287279
} else {
288280
sgt = area->mem.sgt;
289-
offset = area->mem.dmabuf_offset;
290281
}
291282

292-
ret = io_populate_area_dma(ifq, area, sgt, offset);
283+
ret = io_populate_area_dma(ifq, area, sgt);
293284
if (ret == 0)
294285
area->is_mapped = true;
295286
return ret;

io_uring/zcrx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ struct io_zcrx_mem {
2020
struct dma_buf_attachment *attach;
2121
struct dma_buf *dmabuf;
2222
struct sg_table *sgt;
23-
unsigned long dmabuf_offset;
2423
};
2524

2625
struct io_zcrx_area {

0 commit comments

Comments
 (0)