aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/net.h
diff options
context:
space:
mode:
authorDylan Yudaken <dylany@fb.com>2022-07-14 04:02:58 -0700
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:18 -0600
commit9bb66906f23e50d6db1e11f7498b72dfca1982a2 (patch)
tree14b0e09894de61541ba244093289b9d1dae94fc8 /io_uring/net.h
parent72c531f8ef3052c682d39dc21dcb5576afda208c (diff)
downloadlinux-9bb66906f23e50d6db1e11f7498b72dfca1982a2.tar.gz
io_uring: support multishot in recvmsg
Similar to multishot recv, this will require provided buffers to be used. However recvmsg is much more complex than recv as it has multiple outputs. Specifically flags, name, and control messages. Support this by introducing a new struct io_uring_recvmsg_out with 4 fields. namelen, controllen and flags match the similar out fields in msghdr from standard recvmsg(2), payloadlen is the length of the payload following the header. This struct is placed at the start of the returned buffer. Based on what the user specifies in struct msghdr, the next bytes of the buffer will be name (the next msg_namelen bytes), and then control (the next msg_controllen bytes). The payload will come at the end. The return value in the CQE is the total used size of the provided buffer. Signed-off-by: Dylan Yudaken <dylany@fb.com> Link: https://lore.kernel.org/r/20220714110258.1336200-4-dylany@fb.com [axboe: style fixups, see link] Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/net.h')
-rw-r--r--io_uring/net.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/io_uring/net.h b/io_uring/net.h
index 178a6d8b76e0a..db20ce9d6546d 100644
--- a/io_uring/net.h
+++ b/io_uring/net.h
@@ -9,6 +9,12 @@
struct io_async_msghdr {
union {
struct iovec fast_iov[UIO_FASTIOV];
+ struct {
+ struct iovec fast_iov_one;
+ __kernel_size_t controllen;
+ int namelen;
+ __kernel_size_t payloadlen;
+ };
struct io_cache_entry cache;
};
/* points to an allocated iov, if NULL we use fast_iov instead */