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: set IMPORT_BUFFER in generic send setup

Move REQ_F_IMPORT_BUFFER to the common send setup. Currently, the only
user is send zc, but we'll want for normal sends to support that in the
future.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/18b74edfc61d8a1b6c9fed3b78a9276fe80f8ced.1743437358.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
e6f74fd6 e9ff9ae1

+3 -3
+3 -3
io_uring/net.c
··· 359 359 kmsg->msg.msg_name = &kmsg->addr; 360 360 kmsg->msg.msg_namelen = addr_len; 361 361 } 362 - if (sr->flags & IORING_RECVSEND_FIXED_BUF) 362 + if (sr->flags & IORING_RECVSEND_FIXED_BUF) { 363 + req->flags |= REQ_F_IMPORT_BUFFER; 363 364 return 0; 365 + } 364 366 if (req->flags & REQ_F_BUFFER_SELECT) 365 367 return 0; 366 368 return import_ubuf(ITER_SOURCE, sr->buf, sr->len, &kmsg->msg.msg_iter); ··· 1315 1313 return -ENOMEM; 1316 1314 1317 1315 if (req->opcode == IORING_OP_SEND_ZC) { 1318 - if (zc->flags & IORING_RECVSEND_FIXED_BUF) 1319 - req->flags |= REQ_F_IMPORT_BUFFER; 1320 1316 ret = io_send_setup(req, sqe); 1321 1317 } else { 1322 1318 if (unlikely(sqe->addr2 || sqe->file_index))