path: root/src/include
AgeCommit message (Collapse)Author
2019-11-06Add test case for IORING_SETUP_CQ_NODROPcqring-nodropJens Axboe
Tests overflows without CQ_NODROP, and correct behavior on a ring setup with CQ_NODROP. The latter backlogs events that otherwise would have been dropped, and returns -EBUSY to an application trying to submit new IO with a backlog pending. Signed-off-by: Jens Axboe <>
2019-11-05barrier.h: add generic smp_mb implementationJeff Moyer
This missing define causes build failures on s390: src/include/liburing.h:298: undefined reference to `io_uring_smp_mb' Signed-off-by: Jeff Moyer <> Signed-off-by: Jens Axboe <>
2019-10-29Add IORING_OP_ASYNC_CANCEL and prep helperJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-17Add io_uring_prep_accept() helperJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-17Sync with kernel io_uring.h headerJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-16Add IORING_OP_TIMEOUT_REMOVEJens Axboe
Add the command opcode, and add two test cases for it. Signed-off-by: Jens Axboe <>
2019-10-15Make io_uring_prep_timeout() take timeout flagsJens Axboe
Not in a released version yet, plan for using the flags since we already have the IORING_TIMEOUT_ABS flag. Signed-off-by: Jens Axboe <>
2019-10-15Add test case for absolute timeoutsJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-08Add io_uring_register_files_update()Jens Axboe
Interface to the new file set update functionality. Signed-off-by: Jens Axboe <>
2019-10-04io_uring.h: add IORING_SETUP_CQSIZEJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-04Add io_uring_queue_init_params()Jens Axboe
Like io_uring_queue_init(), but allows passing in the whole parameter structure, not just the flags. Signed-off-by: Jens Axboe <>
2019-10-03Add test/file-registerJens Axboe
Tests both existing functionality, but also the new sparse maps, update/remove/add functionality. Signed-off-by: Jens Axboe <>
2019-10-01Switch to 32/64-bit agnostic timeout formatJens Axboe
We made a kernel change to support timeouts properly on 32-bit archs, update liburing to use __kernel_timespec instead of the differently sized timespec. Signed-off-by: Jens Axboe <>
2019-10-01Fix timeout detectionJens Axboe
We lost the -ETIME return from a previous commit that optimized the exported peek/wait cqe path, make sure that it works again. Fixes: 20c929379461 ("Inline fast-path of io_uring_{wait,peek}_cqe()") Signed-off-by: Jens Axboe <>
2019-09-28Inline fast-path of io_uring_{wait,peek}_cqe()Jens Axboe
For cases where we usually have completions available, it can be fairly costly to always have to call into the liburing library. Ensure that we handle the fast path of finding completions without needing a library call. Signed-off-by: Jens Axboe <>
2019-09-27Fold io_uring_wait_cqes_timeout() with io_uring_wait_cqes()Jens Axboe
We also need the sigset for certain setups, and adding a third option is pretty crazy. Since io_uring_wait_cqes_timeout() isn't in a released version yet (and neither is io_uring_wait_cqes()), make the necessary adjustments. Signed-off-by: Jens Axboe <>
2019-09-27Add io_uring_wait_cqes()Jens Axboe
Allows to wait for a specific number of CQEs, which can be used more optimally when we can inform the kernel of how many we are waiting for. Calling convention is the same as io_uring_wait_cqe(), we can only return one cqe inline. Signed-off-by: Jens Axboe <>
2019-09-25Add io_uring_peek_batch_cqe()James Rouzier
io_uring_peek_batch_cqe(), get multiple cqe from the queue at once. Returns the number of cqe gotten. test/cq-peek-batch.c: tests io_uring_peek_batch_cqe() Signed-off-by: James Rouzier <>
2019-09-25Add io_uring_cq_ready()James Rouzier
io_uring_cq_ready(), returns the number of completions that are ready. test/cq-ready.c: tests io_uring_cq_ready Signed-off-by: James Rouzier <>
2019-09-25io_uring.h: sync with kernel headerJens Axboe
Was just missing the sqe->timeout_flags, which are (as of yet) totally unused. Signed-off-by: Jens Axboe <>
2019-09-21Add io_uring_wait_cqes_timeout()Jens Axboe
Like io_uring_wait_cqe_timeout(), except this one takes an argument for how many CQEs to ask for when waiting in the kernel. Signed-off-by: Jens Axboe <>
2019-09-21Add io_uring_sq_space_left()James Rouzier
io_uring_sq_space_left(), returns the amount of space left in the submission queue. test/sq-space_left.c tests io_uring_sq_space_left Signed-off-by: James Rouzier <>
2019-09-21Add io_uring_wait_cqe_timeout()Jens Axboe
Like io_uring_wait_cqe(), except it accepts a timeout value as well. Note that an sqe is used internally to handle the timeout. Applications using this function must never set sqe->user_data to LIBURING_UDATA_TIMEOUT! Signed-off-by: Jens Axboe <>
2019-09-20Get rid of memset() for command prep helpersJens Axboe
Also unify all the command prep helpers, so they all use the same core function for setting up the commands. It was a bit hit and miss before this change if it was done manually, or through a helper. Signed-off-by: Jens Axboe <>
2019-09-20Add TIMEOUT supportJens Axboe
Add support for the current TIMEOUT variant. This allows passing in a timeout and event count, first of which will trigger the completion of the timeout command. If the timeout is hit, the command completes with cqe->res == -ETIME. If the asked number of events complete first, the command completes with cqe->res == 0. test/timeout.c tests a variety of timeout conditions. Signed-off-by: Jens Axboe <>
2019-09-19Remove TIMEOUT codeJens Axboe
We'll rework it for the final version, kill the early version test case and liburing addition. This reverts commits: efb39e105afdb4dd5c0f1e964720cfa3cdcceb18 e4269d2c10586c03786df24d6382da99a956f03c 4652762d5be96e08a0ff8194de1e6f6d8127cee5 f102231b0fdbfe8587efda0b24c79a69ee4d8ba7 Signed-off-by: Jens Axboe <>
2019-09-17Add IORING_OP_TIMEOUT opcodeJens Axboe
And associated command prep helper. Signed-off-by: Jens Axboe <>
2019-09-16liburing: add io_uring_prep_{recv,send}msg李通洲
2019-09-06Sync io_uring.h with the kernelJens Axboe
This brings in the features flags. Signed-off-by: Jens Axboe <>
2019-08-30Fixed address prep helpers should include buf_indexJens Axboe
io_uring depends on the caller specifying the index into the array of registered buffers for doing pre-mapped IO. Make this explicit by requiring the caller to pass in this value for the io_uring_prep_read_fixed() and io_uring_prep_write_fixed() helpers. Signed-off-by: Jens Axboe <>
2019-08-20liburing/barrier.h: Add prefix to arm barriersJulia Suvorova
Rename the newly added arm barriers and READ/WRITE_ONCE to avoid using popular names. Signed-off-by: Julia Suvorova <> Signed-off-by: Jens Axboe <>
2019-08-19liburing/barrier.h: Add prefix io_uring to barriersJulia Suvorova
The names of the barriers conflict with the namespaces of other projects when trying to directly include liburing.h. Avoid using popular global names. Reviewed-by: Stefan Hajnoczi <> Signed-off-by: Julia Suvorova <> Signed-off-by: Jens Axboe <>
2019-08-08Add arm64 memory barriers supportJackie Liu
making liburing on arm64 platform failed. let's support it. root@Kylin:/# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux buster/sid" root@Kylin:/# gcc -v gcc version 8.2.0 (Debian 8.2.0-20) root@Kylin:~/liburing# make make[1]: Entering directory '/root/liburing/src' cc -g -fomit-frame-pointer -O2 -Wall -Iinclude/ -c -o setup.ol setup.c In file included from include/liburing.h:14, from setup.c:10: include/liburing.h: In function 'io_uring_cq_advance': include/liburing/barrier.h:73:2: warning: implicit declaration of function 'smp_mb'; did you mean 'smp_wmb'? [-Wimplicit-function-declaration] smp_mb(); \ ^~~~~~ include/liburing.h:111:3: note: in expansion of macro 'smp_store_release' smp_store_release(cq->khead, *cq->khead + nr); ^~~~~~~~~~~~~~~~~ Signed-off-by: Jackie Liu <> Signed-off-by: Jens Axboe <>
2019-07-24src/Makefile: keep private headers in <liburing/*.h>Stefan Hajnoczi
It is not possible to install barrier.h and compat.h into the top-level /usr/include directly since they are likely to conflict with other software. io_uring.h could be confused with the system's kernel header file. Put liburing headers into <liburing/*.h> so there is no chance of conflicts or confusion. Existing applications continue to build successfully since the location of <liburing.h> is unchanged. In-tree examples and tests require modification because src/liburing.h is moved to src/include/liburing.h. Signed-off-by: Stefan Hajnoczi <> Signed-off-by: Jens Axboe <>