io_uring: support multishot in recvmsg
authorDylan Yudaken <dylany@fb.com>
Thu, 14 Jul 2022 11:02:58 +0000 (04:02 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Jul 2022 14:47:09 +0000 (08:47 -0600)
commitc56eab65de36c6750a872c4d3750fce70bbe248e
tree4253a025354ab48d3109e36c3a817e04ed07ad8f
parentb787fa827a0ec445471ef9e31fbe63e7bba6023d
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>
include/uapi/linux/io_uring.h
io_uring/net.c
io_uring/net.h