summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-06liburing: improve 'make install'Kevin Vigor
'make install' did not install all the headers necessary to use the library; fix. Additionally allow specifying the install prefix, which was previously hardcoded to /usr. Signed-off-by: Kevin Vigor <kvigor@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01test/eeed8b54e0df-test: define RWF_NOWAIT if we don't have itJens Axboe
Older installs/distros don't have this in fs.h. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01test/io_uring_setup: don't fail SQPOLL test case for non-rootJens Axboe
SQPOLL requires root, if the tests are run as a user, we'll get EPERM instead of EINVAL. Don't fail the test because of that, just mention it in the log. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01man/io_uring_enter.2: clarify io_uring_enter(2) return valuesJens Axboe
With the recent change to ensure that submission side errors that happen on behalf of an sqe are returned in the form of a cqe rather than -1/errno from the system call, make sure that the man page reflects that. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01test/eeed8b54e0df-test: check write(2) return valueJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01liburing: improve output for test/io_uring_setup.cShenghui Wang
For the IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF test case, add_pipe is not set, and the output is like: "...flags: IORING_SETUP_SQPOLLIORING_SETUP_SQ_AFF...". Set add_pipe for IORING_SETUP_SQPOLL flag so that the output is like: "...flags: IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF...". Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Shenghui Wang <shhuiw@foxmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-30Update tests for 'sqe submit always posts a cqe'Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-30test/runtests.sh: list all failed tests when doneJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-26liburing: install man pages on running 'make install'Shenghui Wang
Install man pages on running 'make install', so that we can run commands like 'man 2 io_uring_setup'. Signed-off-by: Shenghui Wang <shhuiw@foxmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-25Add test case for -EAGAIN issueJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-23Add regression test cases for three recent issuesJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-23Actually add test/runtests.shJens Axboe
This adds the missing shell script that runs the tests. Fixes: 4916320ec374 ("Separate test cases from examples") Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-23man/io_uring_enter.2: add another ENOTSUPP instanceJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-22man/io_uring_register.2: add another ENXIO caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-18Rename completion helpersJens Axboe
We have io_uring_get_sqe() on the submission side, yet the completion side is named _completion. Rename as follows: io_uring_get_completion() io_uring_peek_cqe() iO_uring_wait_completion() io_uring_wait_cqe() This better tells the user what the _get variant does by calling it _peek instead, and we move to using _cqe() as the postfix instead of _completion. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-17Separate test cases from examplesJens Axboe
Also adds a runtests makefile target.
2019-04-17Add io_uring_cqe_seen()Jens Axboe
There's a failure case where an application gets a cqe entry, but the kernel can then overwrite it before the application is done reading it. This can happen since the io_uring_{get,wait}_completion() interface both returns a CQE pointer AND increments the ring index. If the kernel reuses this entry before the applications is done reading it, the contents may be corrupted. Remove the CQ head increment from the CQE retrieval, and put it into a separate helper, io_uring_cqe_seen(). The application must call this helper when it got a new CQE entry through one of the above calls, and it's now done reading it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-17Add SQ/CQ overflow testsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-11test/nop: add NOP test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-11test/fsync: error out if we submit less than we wantedJens Axboe
This failure is expected on kernels that don't support the DRAIN primitive. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-10test/fsync: update for IOSQE_IO_DRAIN approachJens Axboe
I generalized the barrier flag to be applicable to all commands, so let's drop the fsync special flag. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-10man/io_uring_setup.2: add EPERM case for IORING_SETUP_SQPOLLJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-07Use io_uring_cqe_get_data() internallyJens Axboe
Replace all cqe->user_data casts with io_uring_cqe_get_data(). Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-07Add io_uring_cqe_get_data()Zach Bjornson
Signed-off-by: Zach Bjornson <zbbjornson@gmail.com> Add uintptr_t cast to avoid 32-bit warnings. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-06Add barrier fsync test caseJens Axboe
Also changes the fsync prep helper to require passing in the actual flag, not just a boolean for fsync vs fdatasync. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-19Remove IOCQE_FLAG_CACHEHITJens Axboe
This cache hint has been removed from the io_uring series, as there's some hesitation to leak this information to userspace. Remove it from the header file and the man page. We can always re-introduce it later, if we get some variant of this included. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-13queue: ensure io_uring_submit() returns the system call valueJens Axboe
A previous fix that ensured we pass back the right error messed up the normal return, which is number of entries submitted. This makes the poll test cases fail. Fixes: 8260029608b9 ("queue: ensure io_uring_submit() returns the right error") Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-06test/io_uring-cp: add some commentsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-06Add generated files to .gitignoreJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-05test/io_uring-cp: make it more efficientJens Axboe
Clean it up, and just use a single io_uring for both the reads and the writes. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-05queue: ensure io_uring_submit() returns the right errorJens Axboe
We weren't passing back -errno for the system call failure. This meant any error got turned into EPERM as far as the caller was concerned. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-05Makefile: add cscope targetJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-04add syscall unit testsJeff Moyer
Add tests for io_uring_setup, io_uring_register and io_uring_enter. The test coverage is nowhere near complete and the reporting is not uniform. But, it's a start. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-28Add read/write fixed prep supportJens Axboe
Also unify the setup, all the read/write variants can use the same helper. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-15src/queue: kill bogus ktail_next == head checkJens Axboe
This really wants to be a "will we over-fill the ring?" kind of check, but the sqe_head/sqe_tail should not be that far apart. If they are, that's a bug elsewhere. So just kill the check. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-14io_uring_enter.2: clarify min_completeJeff Moyer
min_complete means slightly different things depending on how the ring was setup. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-12man/io_uring_enter.2: clarify -EMFILE per-user caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-12man/io_uring_enter.2: add mention of -EMFILE for fixed file setsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-10man/io_uring_enter: mention that SQE entries are always fully consumedJens Axboe
With a recent change to the kernel side, we now fully guarantee that once io_uring_enter(2) returns that X entries have been submitted, it's completely safe to reuse tohse entries. This used to not always be the case, if an SQE had to be punted to async context for submission. This makes for a more reliable and nicer interface. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-10Sync io_uring.h with the kernelJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-10src/queue: add comments on the read and write barriersJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-09man/io_uring_register: make note of huge page pinningJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08test/fsync: add simple fsync testerJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08add io_uring_queue_mmapJeff Moyer
io_uring_queue_init does not allow the caller to specify sq_thread_cpu or sq_thread_idle. Users that want to specify those parameters need to call io_uring_setup(2) themselves. Add a helper so that they don't also have to hand-craft the code to map the submission and completion queues, and setup the sqe ring. This allows those applications to still make use of io_uring_submit and get/wait_completion. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08remove sigsz from io_uring_enter.2Jeff Moyer
Users shouldn't be concerned with the size of the sigset. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08io_uring_enter: don't expose sigset_size argumentJens Axboe
Applications should not need to care about this, we can pass it in ourselves. Once the libc support is there, we won't expose this parameter either. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08test/ring-leak: silence "sending fd" messageJens Axboe
We assume that a silent test is good. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08Add sigmask parameter to io_uring_enterJeff Moyer
Update liburing and io_uring_enter.2 to match the kernel. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08syscall: update io_uring_enter() to match kernel typeJens Axboe
We would randomly fail depending on what garbage was passed in the two sigset related fields. Reported-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08man/io_uring_register.2: add EMFILE errnoJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>