summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-01Add test case for commit 7ad0e4b2f83cissue25Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-01Fix flush/submit with internal timeoutJens Axboe
The internal timeout handling relies on __io_uring_get_cqe() always doing a kernel enter, but it doesn't necessarily do that if we already have an available event pending. Make __io_uring_flush_sq() just flush the queue, and don't use the return value for the kernel side. Always just pass in what is pending in the actual ring, not the size of the internal state we flushed. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-29Remove C99'ism from certain testsliming wu
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-28test/connect: fixup a few style issuesJens Axboe
Also, the liburing helpers return -errno, not -1/errno. The usage of io_uring_submit_and_wait() was wrong, fix it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-28liburing: create an installation target for testsJohannes Thumshirn
Create an installation target for liburing's regression test suite. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-27Add a simple connect testHrvoje Zeba
Tests for cases where we try to connect to a closed and opened port. Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-27__io_uring_get_cqe: add safety for SQPOLLJens Axboe
This is just like commit d77a67ed5f27, but for the submit-and-wait path. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-27Add regression test for the bug fix in d77a67ed5f27Jens Axboe
Based on the test case in the issue raised: https://github.com/axboe/liburing/issues/24 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-27__io_uring_submit: always check sq_ring_needs_enter()Jens Axboe
If SQPOLL is used, we must always call sq_ring_needs_enter(). Otherwise we don't get IORING_ENTER_SQ_WAKEUP set in the flags, and we don't wake the sq thread. Fixes: https://github.com/axboe/liburing/issues/24 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-26test/runtests.sh: improve alive worker detectionJens Axboe
Just collect them, if they are there, don't complain about it. If we still have ones after all runs are done, THEN show them. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-25Add io_uring_prep_connect() helperHrvoje Zeba
Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-25test/accept-test: add test case for accept() with addr/addrlenHrvoje Zeba
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-25Add a regression test for behavior before commit b5837bd5311dHrvoje Zeba
This test checks for io_submit_and_wait() behavior where before the specified commit, this function would cap wait_nr parameter and would ignore any sqes submited in previous calls. Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> [axboe: made a few stylistic changes] Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-25Don't cap wait_nr in __io_uring_submit()Hrvoje Zeba
wait_nr is capped to the number of submitted sqes which ignores possible items submitted in previous calls. Removing this cap allows us to wait for any number of completions no matter when they were submitted. Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-25test/timeout: test_single_timeout_nr should wait for 3, not 4Jens Axboe
We only submit 3 requests, so don't wait for 4 of them. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-24test/fc2a85cb02ef-test: make sure we skip on non-rootJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-24test/read-write: remove debug messageJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-24test/stdout: add fixed buffer testsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-22Make __io_uring_submit_and_wait() do the right thing for flushed ring stateJens Axboe
This is a better attempt at fixing what c5bc0ed798e0 was trying to fix. Use the right state internally, and call __io_uring_submit() even if we're only waiting for events. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-22Revert "Fix io_uring_sq_ready()"Jens Axboe
On second thought, let's keep this function as it is, as it's meant to be used on the liburing SQ ring state, not the kernel side. We'll fix this differently internally in liburing. This reverts commit c5bc0ed798e0e79b343b5e438373e71819e6937f.
2019-11-22Add io_uring_wait_cqe_nr()Jens Axboe
This one is safe to use for applications that keep CQ processing to a seperate thread, as it never needs to submit IO. It's identical to io_uring_wait_cqe(), just allows the application to wait for more than 1 CQE before being woken up. Like io_uring_wait_cqe(), if a CQE is readily available in the CQ ring by the time the function is called, the event is returned without waiting for more completions. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-22Don't let io_uring_wait_cqes() submit IOJens Axboe
It's a wait interface, if we let it it also touch the SQ side of things, then it's not possible to use sanely in a situation where someone has a separate thread for completions. Note that this may require application changes, if they are currently relying on io_uring_wait_cqes() on also submitting IO. The risk should be minimal however, since it is a wait-for-completions interface. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-22test/cq-overflow: add test case for c5bc0ed798e0Jens Axboe
Test of both the liburing "failed to submit, resubmit" handling, and the kernel side cq overflow handling. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-22Fix io_uring_sq_ready()Jens Axboe
This is supposed to return the entries that are actually in the SQ ring, not the liburing copy. This fixes an issue where if you fail to submit IO the first time (eg got -EBUSY), then a subsequent submit would think we had nothing to submit. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-22Update link_drain with new kernel methodJackie Liu
Now we are dealing with link-drain in a much simpler way, so the test program is updated as well. Also fixed a bug that did not close fd when an error occurred. and some dead code has been modified, like commit e1420b89c do. Signed-off-by: Jackie Liu <liuyun01@kylinos.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-22Add test/poll-many.cJens Axboe
This tests for many (thousands) of files being polle for, triggering POLLIN events, and re-arming. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-20Merge branch 'debian_build' of https://github.com/changchengx/liburingJens Axboe
* 'debian_build' of https://github.com/changchengx/liburing: script to build liburing into debian package debian rules to package liburing
2019-11-21script to build liburing into debian packageChangcheng Liu
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-11-21debian rules to package liburingChangcheng Liu
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-11-20test/read-write: add linked test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-20test/teardowns: lighten load and wait for childrenJens Axboe
We don't want excessive workers to bleed into the next tests, so make sure the test is quiesced before we move on. We expect -ENOMEM for a regular user here, so just log failure if we get an error that isn't -ENOMEM. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-20Update poll cancellation return codesJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-20test/link-timeout: add a few more test casesJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-19built liburing.so and test binary first when runtestsJackie Liu
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-19Avoid redefined warning of "SIGSTKSZ"Jackie Liu
ucontext-cp.c:24:0: warning: "SIGSTKSZ" redefined #define SIGSTKSZ 8192 In file included from /usr/include/signal.h:316:0, from ucontext-cp.c:13: /usr/include/aarch64-linux-gnu/bits/sigstack.h:30:0: note: this is the location of the previous definition #define SIGSTKSZ 16384 Signed-off-by: Jackie Liu <liuyun01@kylinos.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-19mktemp is dangerous, better use mkostempJackie Liu
jackieliu@aarch64:~/liburing$ make -C test ... /tmp/ccoJ4CQ4.o: In function `main': /home/jackieliu/liburing/test/500f9fbadef8-test.c:41: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp' Signed-off-by: Jackie Liu <liuyun01@kylinos.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-19linked-timeout: check invalid linked timeoutsPavel Begunkov
Check miscounting references for the following case: REQ(fail) -> LINKED_TIMEOUT -> LINKED_TIMEOUT Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-19Add teardown test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-14test/link-timeout: add more chained linked timeout casesJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-14Add test/poll-cancel-tonJens Axboe
Just tests a lot of polls waiting, then cancelling them. Should be nearly instant on a good kernel, takes 5-10s on a slow kernel. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-14test/fixed-link: fix transposed error argumentsJens Axboe
Wanted vs got, arguments were mixed up. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-13Fix 32-bit compile warningsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-13test: add test for READ_FIXED & IOSQE_IO_LINKCarter Li
Signed-off-by: Carter Li <carter.li@eoitek.com> [ Modified by me to be more conformist to the style we use.] Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-13test/fc2a85cb02ef-test: set fail slab/page_alloc verbose to 0Jens Axboe
We don't need this spew. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-13io_uring: invalid fd for file-less operationsPavel Begunkov
If an operation doesn't need a file, set fd to an invalid value. This would help to spot an unwanted fdget() in the kernel, and is conceptually more correct (though negotiable) Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-12test: fix up dead code bugsJeff Moyer
Coverity pointed out some dead code. Fix it. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-12Always use bundled liburing.h for test casesJens Axboe
Don't rely on the systems version, or that the system even has one installed. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-12test/poll-link: use mask check for completion successJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-11Improve reliability of poll/accept-link testsJens Axboe
Back-to-back (or overlapping) runs will hit the same port. Add some poor mans porrt randomization. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-11test/accept-link: add test case for accept linked with timersJens Axboe
Heavily based on a test case from Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>