summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-16test/poll-cancel-all: add async read test casecancel-fd-allJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-16test/poll-cancel-all: test IORING_ASYNC_CANCEL_ANYJens Axboe
_ANY will match any request, no keys needed. Allows canceling any request on the ring. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-16io_uring.h: add IORING_ASYNC_CANCEL_ANYJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-16test/poll-cancel-all: abort test if cancel flags not supportedJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-16test/poll-cancel-all: add test case canceling a subset of pendingJens Axboe
Have two different files active, cancel each set separately and check we get the expected results. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-15test/poll-cancel-all: test issuing CANCEL_ALL | CANCEL_FDJens Axboe
Not complete yet, but tests the basic functionality of canceling based on a file descriptor and canceling all requests pending with just a single cancelation request. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-15liburing.h: add io_uring_prep_cancel_fd()Jens Axboe
This sets up the cancelation request to be fd based. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-15io_uring: add new cancel flagsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-14Merge tag 'test-fixes-2022-04-15' of https://github.com/ammarfaizi2/liburingJens Axboe
Pull test fixes from Ammar Faizi: - Two fixes for `-Wunused-but-set-variable` warning from clang-15. - Fix the wrong assertion condition and testfile cleanup in test/submit_reuse. Link: https://github.com/axboe/liburing/pull/567 * tag 'test-fixes-2022-04-15' of https://github.com/ammarfaizi2/liburing: test/submit-reuse: Fix `-Wunused-but-set-variable` warning from clang-15 test/35fa71a030ca: Fix `-Wunused-but-set-variable` warning from clang-15 test/rw_merge_test: Fix the wrong assertion condition and unlink testfile
2022-04-15test/submit-reuse: Fix `-Wunused-but-set-variable` warning from clang-15Ammar Faizi
clang-15 correctly warns: ``` submit-reuse.c:29:6: error: variable 'i' set but not used \ [-Werror,-Wunused-but-set-variable] int i = 0; ^ 1 error generated. make[1]: *** [Makefile:210: submit-reuse.t] Error 1 ``` Remove the i variable here, it's not used. Fixes: ad543701a816d0d84383a8aafb1ce27ee2f93053 ("Add test case for -EFAULT triggered by iov reuse") Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-04-15test/35fa71a030ca: Fix `-Wunused-but-set-variable` warning from clang-15Ammar Faizi
clang-15 correctly warns: ``` 35fa71a030ca.c:241:7: error: variable 'iter' set but not used \ [-Werror,-Wunused-but-set-variable] int iter; ^ 1 error generated. make[1]: *** [Makefile:210: 35fa71a030ca.t] Error 1 ``` Remove the iter variable here, it's not used. Fixes: 78f59df3339191a500d9a27e2fe9d2eea888a2e0 ("Add regression test cases for three recent issues") Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-04-15test/rw_merge_test: Fix the wrong assertion condition and unlink testfileAmmar Faizi
The following code: ``` ret = pipe(pipe1); assert(!ret); fd = open("testfile", O_RDWR | O_CREAT, 0644); assert(ret >= 0); // wrong assertion condition here ``` is wrong, we should check the @fd after open(), not @ret. While in there, add unlink("testfile") to make the "git status" clean after running this test. Fixes: d731f67819523f76520994b8408a76da4ec30309 ("add test case for 5.4 io merge regression logic") Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-04-14man/io_uring_setup.2: document recent FEAT flag additionsJens Axboe
The man page was missing IORING_FEAT_CQE_SKIP and IORING_FEAT_LINKED_FILE, add an explanation for them. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-14io_uring.h: add IORING_FEAT_LINKED_FILEJens Axboe
If this is set in features, applications can rely on file assignments being done sanely in deferred execution setups (like links, or drain). Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-14Revert "make: let src/Makefile set *dir vars properly"Stefan Hajnoczi
This reverts commit 9236f53a8ffe96cc2430f7131bbcba5756b97bc2. "make install DESTDIR=..." specifies a root directory where files are installed. For example, includedir=/usr/include DESTDIR=/a should install header files into /a/usr/include. Commit 9236f53a8ffe removed the includedir=, etc arguments on the make command-line in ./Makefile, leaving only prefix=$(DESTDIR)$(prefix). It claimed "prefix suffice for setting *dir variables in src/Makefile" but this is incorrect. "make install DESTDIR=..." now has no effect and files are not installed with a DESTDIR prefix. The GNU make manual 9.5 Overriding Variables says: all ordinary assignments of the same variable in the makefile are ignored; we say they have been overridden by the command line argument. This explains why it was necessary to set includedir=, etc on the make command-line in ./Makefile. We need to override these variables with DESTDIR from the command-line so they are not clobbered in src/Makefile when config-host.mak is included. Cc: Paymon MARANDI <darwinskernel@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Link: https://lore.kernel.org/r/20220414063651.81341-1-stefanha@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-11test/timeout: fix exec-target namingJens Axboe
A previous commit renamed all test targets to foo.t, but didn't update the timeout test case. Hence it now tries to exec something that isn't there and rightfully complains about it: Running test timeout.t Can't find exec-target, skipping Update the test to use the right target. Fixes: f200b5bba701 ("test/Makefile: Append `.t` to the test binary") Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-09src/queue: protect io_uring_get_sqe() with LIBURING_INTERNALJens Axboe
This isn't important to liburing itself, but may be to users that do odd things like include this file. And it makes it consistent with the exported header. Fixes: https://github.com/axboe/liburing/issues/560 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-08man/io_uring_register_ring_fd.3: try to improve NOTES sectionJens Axboe
Threaded applications can use this optimization, but they cannot use it if they share any given ring between multiple threads. Link: https://github.com/axboe/liburing/issues/559 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-04Merge branch 'changes-3' of https://github.com/ewyler/liburingJens Axboe
* 'changes-3' of https://github.com/ewyler/liburing: Review and update .3 and .7 man pages
2022-04-04Review and update .3 and .7 man pagesEric Wyler
- Use of "consumed" vs "processed" was inconsistent - "consumed" was more common, so I changed the few instances of "processed" to that. It was non-obvious to me if consumption was different from processing, so this removes that ambiguity. - Fixed a few comma splices and typos in both function names and descriptions. Signed-off-by: Eric Wyler <ewyler@gmail.com>
2022-04-04Merge branch 'dankamongmen/remove-double-cast' of ↵Jens Axboe
https://github.com/dankamongmen/liburing * 'dankamongmen/remove-double-cast' of https://github.com/dankamongmen/liburing: remove double casts
2022-04-04remove double castsnick black
Signed-off-by: nick black <nickblack@linux.com>
2022-04-03test/Makefile: fixup sq-full-cpp targetJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-03test/MakefileJens Axboe
statx target is now statx.t, make sure it's correct in all_targets. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-03test/Makefile: Append `.t` to the test binaryAmmar Faizi
When adding a new test, we often forget to add the new test binary to `.gitignore`. Append `.t` to the test binary filename, this way we can use a wildcard matching "test/*.t" in `.gitignore` to ignore all test binary files. Goals: - Make the .gitignore simpler. - Avoid the burden of adding a new test to .gitignore. Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Link: https://lore.kernel.org/r/20220403182200.259937-4-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-03test/Makefile: Append `-lpthread` to `LDFLAGS` for all testsAmmar Faizi
Instead of overriding LDFLAGS one by one for tests that need pthread, append -lpthread to LDFLAGS for all tests. This makes the Makefile script simpler. It also saves some hassle when we add a new test that does use pthread. Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Link: https://lore.kernel.org/r/20220403182200.259937-3-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-03test: Rename `[0-9a-f]-test.c` to `[0-9a-f].c`Ammar Faizi
Simplify the test filename. mv -v test/232c93d07b74-test.c test/232c93d07b74.c mv -v test/35fa71a030ca-test.c test/35fa71a030ca.c mv -v test/500f9fbadef8-test.c test/500f9fbadef8.c mv -v test/7ad0e4b2f83c-test.c test/7ad0e4b2f83c.c mv -v test/8a9973408177-test.c test/8a9973408177.c mv -v test/917257daa0fe-test.c test/917257daa0fe.c mv -v test/a0908ae19763-test.c test/a0908ae19763.c mv -v test/a4c0b3decb33-test.c test/a4c0b3decb33.c mv -v test/b19062a56726-test.c test/b19062a56726.c mv -v test/b5837bd5311d-test.c test/b5837bd5311d.c mv -v test/ce593a6c480a-test.c test/ce593a6c480a.c mv -v test/d4ae271dfaae-test.c test/d4ae271dfaae.c mv -v test/d77a67ed5f27-test.c test/d77a67ed5f27.c mv -v test/eeed8b54e0df-test.c test/eeed8b54e0df.c mv -v test/fc2a85cb02ef-test.c test/fc2a85cb02ef.c Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Link: https://lore.kernel.org/r/20220403182200.259937-2-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-03src/int_flags.h: Add missing SPDX-License-IdentifierAmmar Faizi
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Link: https://lore.kernel.org/r/20220403095602.133862-2-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-01Merge tag 'liburing-2022-05-01' of https://github.com/ammarfaizi2/liburingJens Axboe
Pull a configure script fix from Ammar Faizi: - Allow the configure script to fail with a non-zero exit code. Link: https://github.com/axboe/liburing/pull/553 Link: https://github.com/axboe/liburing/pull/554 * tag 'liburing-2022-05-01' of https://github.com/ammarfaizi2/liburing: configure: Allow the configure script to fail with a non-zero exit code
2022-04-01configure: Allow the configure script to fail with a non-zero exit codeAmmar Faizi
For poorly configured environments, configure may fail but will still exit with code 0. This, in turn, causes cryptic build errors later. Fix this by adding "set -e". Also, append "|| true" to prevent the `expr` command breaks because it will return a non-zero exit code if the regex doesn't match. Closes: https://github.com/axboe/liburing/pull/553 Co-authored-by: Roman Gershman <romange@gmail.com> Signed-off-by: Roman Gershman <romange@gmail.com> Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-03-30test/fixed-reuse: test that linked file slot reuse is correctJens Axboe
If we do: <open fileX into slot 0> <open fileY into slot 0><read slot 0><close slot 0> this should be consistent with not having opened fileX first, and the read should be satisfied from fileY. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-30helpers: add file creation with patternJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-30test/submit-link-fail: set invalid ioprio to force request to be droppedJens Axboe
We need it dropped at prep time, don't assume that read prep will validate the fd. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-30test/drop-submit: set invalid ioprio to force request to be droppedJens Axboe
We need it dropped at prep time, don't assume that read prep will validate the fd. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-29man/io_uring.7: line breaksJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-29test/open-direct-link: add IOSQE_ASYNCJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-29test/open-direct-link: don't test if CQE_SKIP isn't availableJens Axboe
This just limits us to a newer kernel, and we use SKIP in testing it anyway. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-29test/open-direct-link: add test case for linked open+read+closeJens Axboe
Test that it works with both LINK and DRAIN. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-29Merge branch 'master' of https://github.com/rojkov/liburingJens Axboe
* 'master' of https://github.com/rojkov/liburing: Add SECURITY.md
2022-03-29Add SECURITY.mdDmitry Rozhkov
Define an initial security policy in the file SECURITY.md. The content of the file will become the content of the page https://github.com/axboe/liburing/security/policy. Fixes: https://github.com/axboe/liburing/issues/534 Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@intel.com>
2022-03-29man/io_uring_prep_cancel.3: add io_uring_prep_poll_remove(3) to see alsoJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-25Add test for multiple concurrent acceptsDylan Yudaken
Add tests for accept that queues multiple accepts and then ensures the correct things happen. Check that when connections arrive one at a time that only one CQE is posted (in blocking and nonblocking sockets), as well as make sure that closing the accept socket & cancellation all work as expected. This relies on a kernel with [1] for the tests to pass. [1]: https://lore.kernel.org/io-uring/20220325093755.4123343-1-dylany@fb.com/ Signed-off-by: Dylan Yudaken <dylany@fb.com> Link: https://lore.kernel.org/r/20220325094013.4132496-1-dylany@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-24add tests for nonblocking accept socketsDylan Yudaken
Add tests for accept sockets with O_NONBLOCK. Add a test for queueing the accept both before and after connect(), which tests slightly different code paths. After connect() has always worked, but before required changes to the kernel. Signed-off-by: Dylan Yudaken <dylany@fb.com> Link: https://lore.kernel.org/r/20220324143547.2882041-1-dylany@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-24man/io_uring_queue_init.3: add note on CQ ring sizingJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-24Remove IORING_CQE_F_MSGJens Axboe
Remove it from the io_uring_prep_msg_ring.3 man page as it's no longer being set by the kernel, and remove the definition and comment from the kernel header. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-24test/test/msg-ring: don't test for IORING_CQE_F_MSGJens Axboe
It's not strictly needed, just don't test for it. We validate the user_data being passed. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-23test/recv-msgall-stream: remove nonblocking connect codeJens Axboe
Not using nonblocking sockets here anymore, so just kill it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-23Actually wire up recv-msgall-stream test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-23test/recv-msgall-stream: add stream based MSG_WAITALL test caseJens Axboe
Submit two separate writes, and a receiver that asks for the combined length should receive the combined length, not half of it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-23test/msg-recvall: fix testJens Axboe
We should expect just half of the requested amount for a DGRAM socket. Signed-off-by: Jens Axboe <axboe@kernel.dk>