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/net: allow vectorised regbuf send zc

Enable IORING_SEND_VECTORIZED with registered buffers for
IORING_OP_SEND_ZC. Set IORING_SEND_VECTORIZED for all msg send requests
to differentiate if the vectorised version is expected.

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
dce00c83 d8345a21

+9 -5
+9 -5
io_uring/net.c
··· 375 375 kmsg->msg.msg_namelen = addr_len; 376 376 } 377 377 if (sr->flags & IORING_RECVSEND_FIXED_BUF) { 378 - if (sr->flags & IORING_SEND_VECTORIZED) 379 - return -EINVAL; 380 - req->flags |= REQ_F_IMPORT_BUFFER; 381 - return 0; 378 + if (!(sr->flags & IORING_SEND_VECTORIZED)) { 379 + req->flags |= REQ_F_IMPORT_BUFFER; 380 + return 0; 381 + } 382 + 383 + kmsg->msg.msg_iter.nr_segs = sr->len; 384 + return io_prep_reg_iovec(req, &kmsg->vec, sr->buf, sr->len); 382 385 } 383 386 if (req->flags & REQ_F_BUFFER_SELECT) 384 387 return 0; ··· 399 396 struct user_msghdr msg; 400 397 int ret; 401 398 399 + sr->flags |= IORING_SEND_VECTORIZED; 402 400 sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); 403 401 ret = io_msg_copy_hdr(req, kmsg, &msg, ITER_SOURCE, NULL); 404 402 if (unlikely(ret)) ··· 1457 1453 1458 1454 notif->buf_index = req->buf_index; 1459 1455 1460 - if (req->opcode == IORING_OP_SEND_ZC) { 1456 + if (!(sr->flags & IORING_SEND_VECTORIZED)) { 1461 1457 ret = io_import_reg_buf(notif, &kmsg->msg.msg_iter, 1462 1458 (u64)(uintptr_t)sr->buf, sr->len, 1463 1459 ITER_SOURCE, issue_flags);