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: add support for IORING_SETUP_CQE_MIXED

zcrx currently requires the ring to be set up with fixed 32b CQEs,
allow it to use IORING_SETUP_CQE_MIXED as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+8 -4
+1 -1
Documentation/networking/iou-zcrx.rst
··· 75 75 76 76 IORING_SETUP_SINGLE_ISSUER 77 77 IORING_SETUP_DEFER_TASKRUN 78 - IORING_SETUP_CQE32 78 + IORING_SETUP_CQE32 or IORING_SETUP_CQE_MIXED 79 79 80 80 Create memory area 81 81 ------------------
+7 -3
io_uring/zcrx.c
··· 554 554 return -EPERM; 555 555 556 556 /* mandatory io_uring features for zc rx */ 557 - if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN && 558 - ctx->flags & IORING_SETUP_CQE32)) 557 + if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN)) 558 + return -EINVAL; 559 + if (!(ctx->flags & (IORING_SETUP_CQE32|IORING_SETUP_CQE_MIXED))) 559 560 return -EINVAL; 560 561 if (copy_from_user(&reg, arg, sizeof(reg))) 561 562 return -EFAULT; ··· 921 920 static bool io_zcrx_queue_cqe(struct io_kiocb *req, struct net_iov *niov, 922 921 struct io_zcrx_ifq *ifq, int off, int len) 923 922 { 923 + struct io_ring_ctx *ctx = req->ctx; 924 924 struct io_uring_zcrx_cqe *rcqe; 925 925 struct io_zcrx_area *area; 926 926 struct io_uring_cqe *cqe; 927 927 u64 offset; 928 928 929 - if (!io_defer_get_uncommited_cqe(req->ctx, &cqe)) 929 + if (!io_defer_get_uncommited_cqe(ctx, &cqe)) 930 930 return false; 931 931 932 932 cqe->user_data = req->cqe.user_data; 933 933 cqe->res = len; 934 934 cqe->flags = IORING_CQE_F_MORE; 935 + if (ctx->flags & IORING_SETUP_CQE_MIXED) 936 + cqe->flags |= IORING_CQE_F_32; 935 937 936 938 area = io_zcrx_iov_to_area(niov); 937 939 offset = off + (net_iov_idx(niov) << PAGE_SHIFT);