Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/zcrx: declare some constants for query

Add constants for zcrx features and supported registration flags that
can be reused by the query code. I was going to add another registration
flag, and this patch helps to avoid duplication and keeps changes
specific to zcrx files.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
dc156e0f 403fec55

+8 -3
+2 -2
io_uring/query.c
··· 34 34 { 35 35 struct io_uring_query_zcrx *e = &data->zcrx; 36 36 37 - e->register_flags = ZCRX_REG_IMPORT; 37 + e->register_flags = ZCRX_SUPPORTED_REG_FLAGS; 38 38 e->area_flags = IORING_ZCRX_AREA_DMABUF; 39 39 e->nr_ctrl_opcodes = __ZCRX_CTRL_LAST; 40 40 e->rq_hdr_size = sizeof(struct io_uring); 41 41 e->rq_hdr_alignment = L1_CACHE_BYTES; 42 - e->features = ZCRX_FEATURE_RX_PAGE_SIZE; 42 + e->features = ZCRX_FEATURES; 43 43 e->__resv2 = 0; 44 44 return sizeof(*e); 45 45 }
+3 -1
io_uring/zcrx.c
··· 778 778 return -EFAULT; 779 779 if (!mem_is_zero(&reg.__resv, sizeof(reg.__resv)) || reg.zcrx_id) 780 780 return -EINVAL; 781 + if (reg.flags & ~ZCRX_SUPPORTED_REG_FLAGS) 782 + return -EINVAL; 781 783 if (reg.flags & ZCRX_REG_IMPORT) 782 784 return import_zcrx(ctx, arg, &reg); 783 785 if (copy_from_user(&rd, u64_to_user_ptr(reg.region_ptr), sizeof(rd))) 784 786 return -EFAULT; 785 - if (reg.if_rxq == -1 || !reg.rq_entries || reg.flags) 787 + if (reg.if_rxq == -1 || !reg.rq_entries) 786 788 return -EINVAL; 787 789 if (reg.rq_entries > IO_RQ_MAX_ENTRIES) { 788 790 if (!(ctx->flags & IORING_SETUP_CLAMP))
+3
io_uring/zcrx.h
··· 8 8 #include <net/page_pool/types.h> 9 9 #include <net/net_trackers.h> 10 10 11 + #define ZCRX_SUPPORTED_REG_FLAGS (ZCRX_REG_IMPORT) 12 + #define ZCRX_FEATURES (ZCRX_FEATURE_RX_PAGE_SIZE) 13 + 11 14 struct io_zcrx_mem { 12 15 unsigned long size; 13 16 bool is_dmabuf;