summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-14 15:35:05 -0600
committerJens Axboe <axboe@kernel.dk>2022-05-14 15:35:05 -0600
commit5d52bb71eeecb92134bd4cea42c280a08f5714c7 (patch)
tree989a6d698107969f649886240a217cbadf5d32ec
parent36d6378c70e682bbacb4625c4ae1b72e4435c8da (diff)
downloadliburing-5d52bb71eeecb92134bd4cea42c280a08f5714c7.tar.gz
liburing-5d52bb71eeecb92134bd4cea42c280a08f5714c7.tar.bz2
io_uring.h: add IORING_RECVSEND_POLL_FIRST
This flag can be used by send/sendmsg or recv/recvmsg to tell io_uring that it expects the socket to not be immediately ready for send or recv. For that case, it's worthless trying to do IO first, it's better to just arm poll internally and let that drive the first attempt. Can be used in conjunction with the IORING_CQE_F_SOCK_NONEMPTY feedback from the kernel, or independently. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing/io_uring.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index fac6518..ce533cd 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -204,6 +204,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 {