summaryrefslogtreecommitdiff
path: root/include/uapi/linux/io_uring.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-05-08 08:17:50 -0600
committerJens Axboe <axboe@kernel.dk>2024-05-09 12:22:11 -0600
commitd3da8e98592693811c14c31f05380f378411fea1 (patch)
tree885a341cad3532350cdab6c841a78c8d20425805 /include/uapi/linux/io_uring.h
parent7dcc758cca432510f77b2fe1077be2314bc3785b (diff)
io_uring/net: add IORING_ACCEPT_POLL_FIRST flag
Similarly to how polling first is supported for receive, it makes sense to provide the same for accept. An accept operation does a lot of expensive setup, like allocating an fd, a socket/inode, etc. If no connection request is already pending, this is wasted and will just be cleaned up and freed, only to retry via the usual poll trigger. Add IORING_ACCEPT_POLL_FIRST, which tells accept to only initiate the accept request if poll says we have something to accept. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/uapi/linux/io_uring.h')
-rw-r--r--include/uapi/linux/io_uring.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index 4a645d15516f..6dbac55f8686 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -380,6 +380,7 @@ enum io_uring_op {
*/
#define IORING_ACCEPT_MULTISHOT (1U << 0)
#define IORING_ACCEPT_DONTWAIT (1U << 1)
+#define IORING_ACCEPT_POLL_FIRST (1U << 2)
/*
* IORING_OP_MSG_RING command types, stored in sqe->addr