48 Commits

Author SHA1 Message Date
ohci1 4b8f3098a5 update configure info for 2.14
Co-authored-by: Pavel Begunkov<asml.silence@gmail.com>
Co-authored-by: Guillem Jover<guillem@hadrons.org>
Co-authored-by: Jens Axboe<axboe@kernel.dk>
Co-authored-by: Khem Raj<raj.khem@gmail.com>
Co-authored-by: Michael de Lang<kingoipo@gmail.com>
Co-authored-by: David Disseldorp<ddiss@suse.de>
Co-authored-by: Ming Lei<ming.lei@redhat.com>
2026-04-24 09:24:13 +08:00
fangzhiyi18 0ae77b95ef 升级2.7
Signed-off-by: fangzhiyi18 <fangzhiyi1@huawei.com>
2024-10-21 02:53:20 +00:00
Dylan Yudaken cda40eb34e handle buffered writes in read-write test
When buffered writes are used then two things change:
1 - signals will propogate to the submit() call (as they would be
effectively ignored when going async)
2 - CQE ordering will change

Fix the read-write for both of these cases by ignoring the signal and
handling CQE ordering.

Before the 6.0 kernel, any buffered write would go through io-wq. This
meant any signal delivered would be to io-wq, which ignores any non-fatal
signals.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220815170914.3094167-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-08-15 11:11:25 -06:00
Dylan Yudaken 0fa462df36 fix test_buf_select_pipe on older kernels
timing issues might cause out of order completes on older kernels,
especially regarding selecting a buffer before queueing up IO (as it can
complete with ENOBUFS being queued).
Theres no reason to test ENOBUFS for this problem, so remove those checks.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220704160614.1033371-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-07-05 08:38:34 -06:00
Dylan Yudaken 018701b54a add a test for async reads with buffer_select
Async reads had a bug with buffer selection.
Add a regression test for this.
It fails without the kernel commit: "io_uring: fix provided buffer import"

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220630142812.3212964-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-06-30 09:02:14 -06:00
Mahdi Rakhshandehroo 8027807663 Fix warnings/errors when compiling on Alpine Linux
Silences the following:

* Error due to no definition for `mode_t` in `liburing.h`

* Warning due to use of non-portable `#include <sys/poll.h>` and `#include <sys/signal.h>`

* Warning due to incorrect `printf` format specifier in `test/io_uring_register.c`

* Error due to missing declaration for `strcpy` in `test/sendmsg_fs_cve.c`

* Error due to missing declaration for `strerror` in `test/shutdown.c`

Signed-off-by: Mahdi Rakhshandehroo <mahdi.rakhshandehroo@gmail.com>
2022-02-19 22:44:14 -08:00
Jens Axboe 397729d286 test/read-write: update EFBIG to work with 256M files
A previous commit changed the file size from 128M to 256M, and this
caused the EFBIG test case to be buggy. Update it so it works again.

Fixes: ee61b6e290 ("test/read-write: work on 4kb blocksize devices")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-10 10:32:28 -07:00
Jens Axboe ee61b6e290 test/read-write: work on 4kb blocksize devices
For some tests, we chop the iovec in two. Since the iovec is 4k in
size, this fails on devices that are actually using 4k block sizes.

Just bump the iovec size to 8k, then it'll work fine on 4k devices.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-09 11:00:54 -07:00
Ammar Faizi 8d2d4d59b1 test/{iopoll,read-write}: Use io_uring_free_probe() instead of free()
`io_uring_free_probe()` should really be used to free the return value
of `io_uring_get_probe_ring()`. As we may not always allocate it with
`malloc()`. For example, to support no libc build [1].

Link: https://github.com/axboe/liburing/issues/443 [1]
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-07 06:23:42 -06:00
Pavel Begunkov f4017e98b5 tests: file create/unlink cleanup
Unlink earlier if possible right after getting an fd, so tests don't
leave files when exited abnormally. Also, improve test file naming in a
couple of cases.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/abbcfa9fa56fde7e740a2c887afef74a779bf36f.1630082134.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-27 12:11:20 -06:00
Pavel Begunkov a582c2a337 tests: skip when large buf register fails
Registering lots of memory will fail for non-privileged users, so skip
tests if that happens.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/682c09c1d153cd4dfe505ded6069b294e98078e3.1629913874.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-25 11:57:02 -06:00
Pavel Begunkov 2e8ae7ca68 tests: rw: don't exit ring when init failed
Don't do io_uring_queue_exit() after t_create_ring() got skipped.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/28376af76af7bfb9059b6b9ad3a01eb0b07e7244.1629813328.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-24 08:07:42 -06:00
Pavel Begunkov d7afe2a110 tests: migrate rw tests to t_create_ring()
Use t_create_ring() in read-write.c and iopoll.c, the function will do
all the privilege checks.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-22 07:36:47 -06:00
Pavel Begunkov c9670b9994 tests: create new files for rw testing
Currently rw/iopoll tests use a fixed name file, so several instances of
the same test can't run in parallel. Use unique names instead.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/470033f83e6ee15af154fd1a464ba3118f2bf2eb.1629380408.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-19 08:48:42 -06:00
Jens Axboe d7463a4746 helpers: prefix any helper with t_ instead of io_uring_
As brought up in an issue, this makes it confusing as to what could
potentially be liburing functions. Make it clear that these are test
helpers, hence use the t_ prefix for them.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-24 07:12:47 -07:00
Zhiqiang Liu 4f8e9e17c9 helpers: add io_uring_create_buffers() helper
add io_uring_create_buffers() helper, and replace
create_buffers() with io_uring_create_buffers() helper.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-23 20:34:54 +08:00
Zhiqiang Liu 7679234637 helpers: add io_uring_create_file() helper
cleanup: add io_uring_create_file() helper,
and replace create_file() with io_uring_calloc() in tests.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-23 20:10:26 +08:00
Zhiqiang Liu 107b62048e helpers: add io_uring_calloc helper
add io_uring_calloc() helper, and replace
all calloc() with io_uring_calloc() in all tests.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-23 14:43:57 +08:00
Zhiqiang Liu 3422826619 helpers: add io_uring_posix_memalign helper
add io_uring_posix_memalign helper, and replace
all posix_memalign() with io_uring_posix_memalign()
in all tests.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-23 11:57:53 +08:00
Zhiqiang Liu 7bd307c836 tests: add helpers.h to harden the tests
As axboe said, Right now a lot of basic stuff is duplicated,
and it makes the tests bigger than they should be.
Here, we try to add helpers.h which will contains various
utilities that tests could use, then that'd help make tests simpler.

In this patch, we just add one helper io_uring_malloc(), which
will call assert() if allocating memory fails.
We will add more helpers in subsequent patches

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-23 10:10:18 +08:00
Jens Axboe 92ce4f21ee test/read-write: skip too-big test on non-root
We can't reset the limits back afterwards without failing, so just
skip this test for a regular user.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-17 10:05:05 -07:00
Pavel Begunkov 8672564649 rem_buf/test: inital testing for OP_REMOVE_BUFFERS
Basic testing for IORING_OP_REMOVE_BUFFERS. test_rem_buf(IOSQE_ASYNC)
should check that it's doing locking right when punted async.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-08 17:24:54 -07:00
Pavel Begunkov 7822112ff4 test/rw: test reg bufs with non-align sizes/offset
Broaden registered buffers coverage with registering buffers with
non-aligned random offsets and sizes. That in particular test how we're
setting and advancing in-kernel bvecs.

Pass exp_len==-1 for that, so it compares against iov_len with which it
was initialised. Also, direct IO requires alignment, so do it in
buffered mode.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-07 08:48:18 -07:00
Pavel Begunkov 995f629e22 test/rw: remove not used mixed_fixed flag
mixed_fixed is not used, kill it

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-07 08:48:16 -07:00
Pavel Begunkov c0c203bb65 test/rw: name flags for clearness
Replace obscure v1-v6 with more readable flag names.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-07 08:48:14 -07:00
Jens Axboe 5a1f4e3349 test/read-write: support configured test files
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 21:53:58 -06:00
Jens Axboe 6c32e92bb0 test: add potential argument, ignore if unused
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 17:36:19 -06:00
Jens Axboe 0e5568c707 Fix 32-bit warnings on compile
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-24 07:47:50 -06:00
Jens Axboe 53d4892db5 test/read-write: skip IOSQE_ASYNC if not supported
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-23 08:58:55 -06:00
Jens Axboe fed116f9ff test/read-write: add RLIMIT_SIZE test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-20 15:16:36 -06:00
Jens Axboe 14bec8eb77 test/read-write: add test case for links with async/drain
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-14 17:00:15 -06:00
Jens Axboe ef7d1fdf0c test/read-write: add more buffer select tests
Test both vectored and non-vectored reads, and also add two test
cases for vectored and non-vectored short reads.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-10 09:00:54 -06:00
Jens Axboe 0242e05972 test/read-write: ensure SQPOLL for non-root just warns
Don't fail the test.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-28 14:10:10 -07:00
Jens Axboe 21892f510a test/read-write: fix non-root failure
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-25 21:32:48 -07:00
Jens Axboe 9d6dbd4dd7 test/read-write: add test case for selectable buffers
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-25 20:24:14 -07:00
Guillem Jover 9502d6d646 test: Unify queue init failed error message
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2020-02-14 14:39:28 +01:00
Guillem Jover 1fb4160e7d test: Skip tests where the kernel lacks support
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2020-02-14 14:39:28 +01:00
Jens Axboe e502435779 Add SPDX license identifiers
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-11 20:34:12 -07:00
Jens Axboe 75d088eaec test/read-write: skip eventfd read if we know we don't have READ
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-01 10:44:08 -07:00
Jens Axboe ec4710a19d Merge branch 'eventfd_test' of https://github.com/cor3ntin/liburing
* 'eventfd_test' of https://github.com/cor3ntin/liburing:
  Add a test for reading from eventfd
2020-02-01 10:42:17 -07:00
Jens Axboe a8dc4979d5 Use stderr consistently in test/ cases
This is a start, still some to go. The goal here is to ensure that we
use stderr consistently for errors, and include the error value as well.
Right now folks copy/paste test cases (which they should), but that
also means they should be doing the right thing so we don't keep adding
test cases that just use stdout for errors, or don't include the error
value.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-01 09:58:07 -07:00
Simon A. F. Lund b7d0d44812 test/read-write: fixed output, and added 'nonvec', when VERBOSE
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-28 08:23:52 -07:00
Corentin Jabot 2c8082f420 Add a test for reading from eventfd 2020-01-26 18:44:11 +01:00
Jens Axboe 3508db90d8 test/read-write: skip non-vectored read/write if not supported
Use the IORING_REGISTER_PROBE op to test for it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-26 10:40:19 -07:00
Jens Axboe 5c0772a5b8 test/read-write: add non-vectored read/write testing
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-24 23:08:25 -07:00
Jens Axboe 6aa467cacd test/read-write: remove debug message
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-24 19:25:13 -07:00
Jens Axboe 3d884919df test/read-write: add linked test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-20 13:50:35 -07:00
Jens Axboe 6cfaab20bf Add read/write test that does various combinations of IO
Tests a mixed of buffered, direct, SQTHREAD, fixed buffers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-27 15:49:31 -06:00