Commit def596e9 authored by Jens Axboe's avatar Jens Axboe

io_uring: support for IO polling

Add support for a polled io_uring instance. When a read or write is
submitted to a polled io_uring, the application must poll for
completions on the CQ ring through io_uring_enter(2). Polled IO may not
generate IRQ completions, hence they need to be actively found by the
application itself.

To use polling, io_uring_setup() must be used with the
IORING_SETUP_IOPOLL flag being set. It is illegal to mix and match
polled and non-polled IO on an io_uring.
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent c992fe29
This diff is collapsed.
...@@ -30,6 +30,11 @@ struct io_uring_sqe { ...@@ -30,6 +30,11 @@ struct io_uring_sqe {
__u64 __pad2[3]; __u64 __pad2[3];
}; };
/*
* io_uring_setup() flags
*/
#define IORING_SETUP_IOPOLL (1U << 0) /* io_context is polled */
#define IORING_OP_NOP 0 #define IORING_OP_NOP 0
#define IORING_OP_READV 1 #define IORING_OP_READV 1
#define IORING_OP_WRITEV 2 #define IORING_OP_WRITEV 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment