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: set MSG_ZEROCOPY for sendzc in advance

We can set MSG_ZEROCOPY at the preparation step, do it so we don't have
to care about it later in the issue callback.

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

authored by

Pavel Begunkov and committed by
Jens Axboe
d285da7d 6b7f864b

+3 -3
+3 -3
io_uring/net.c
··· 1050 1050 1051 1051 zc->buf = u64_to_user_ptr(READ_ONCE(sqe->addr)); 1052 1052 zc->len = READ_ONCE(sqe->len); 1053 - zc->msg_flags = READ_ONCE(sqe->msg_flags) | MSG_NOSIGNAL; 1053 + zc->msg_flags = READ_ONCE(sqe->msg_flags) | MSG_NOSIGNAL | MSG_ZEROCOPY; 1054 1054 if (zc->msg_flags & MSG_DONTWAIT) 1055 1055 req->flags |= REQ_F_NOWAIT; 1056 1056 ··· 1167 1167 return ret; 1168 1168 } 1169 1169 1170 - msg_flags = zc->msg_flags | MSG_ZEROCOPY; 1170 + msg_flags = zc->msg_flags; 1171 1171 if (issue_flags & IO_URING_F_NONBLOCK) 1172 1172 msg_flags |= MSG_DONTWAIT; 1173 1173 if (msg_flags & MSG_WAITALL) ··· 1229 1229 (sr->flags & IORING_RECVSEND_POLL_FIRST)) 1230 1230 return -EAGAIN; 1231 1231 1232 - flags = sr->msg_flags | MSG_ZEROCOPY; 1232 + flags = sr->msg_flags; 1233 1233 if (issue_flags & IO_URING_F_NONBLOCK) 1234 1234 flags |= MSG_DONTWAIT; 1235 1235 if (flags & MSG_WAITALL)