aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-04-26 12:11:33 -0600
committerJens Axboe <axboe@kernel.dk>2022-05-05 17:09:31 -0600
commit0455d4ccec548b0fb51db39a4d3350a7a80a0222 (patch)
treedd14449acab4a4236eca3acb438f5c5e01db7c08 /include/uapi
parentio_uring: check IOPOLL/ioprio support upfront (diff)
downloadlinux-dev-0455d4ccec548b0fb51db39a4d3350a7a80a0222.tar.xz
linux-dev-0455d4ccec548b0fb51db39a4d3350a7a80a0222.zip
io_uring: add POLL_FIRST support for send/sendmsg and recv/recvmsg
If IORING_RECVSEND_POLL_FIRST is set for recv/recvmsg or send/sendmsg, then we arm poll first rather than attempt a receive or send upfront. This can be useful if we expect there to be no data (or space) available for the request, as we can then avoid wasting time on the initial issue attempt. Reviewed-by: Hao Xu <howeyxu@tencent.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/io_uring.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index fad63564678a..06621a278cb6 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -214,6 +214,16 @@ enum {
#define IORING_ASYNC_CANCEL_ANY (1U << 2)
/*
+ * send/sendmsg and recv/recvmsg flags (sqe->addr2)
+ *
+ * IORING_RECVSEND_POLL_FIRST If set, instead of first attempting to send
+ * or receive and arm poll if that yields an
+ * -EAGAIN result, arm poll upfront and skip
+ * the initial transfer attempt.
+ */
+#define IORING_RECVSEND_POLL_FIRST (1U << 0)
+
+/*
* IO completion data structure (Completion Queue Entry)
*/
struct io_uring_cqe {