37 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
Guillem Jover b7c5358744 Fix typos
Warned-by: codespell
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2022-08-17 11:43:08 +02:00
Jens Axboe 0eaa2dd733 test/timeout: fix exec-target naming
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: e2ada03c9d ("test/Makefile: Append `.t` to the test binary")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-11 14:52:59 -06:00
Ammar Faizi b55c3b6f1c test/timeout: Fix -Werror=maybe-uninitialized
Fix this:
```
  timeout.c: In function ‘test_multi_timeout’:
  timeout.c:590:20: warning: ‘user_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    590 |                 if (cqe->user_data != user_data) {
        |                    ^
  timeout.c:601:51: warning: ‘time’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    601 |                 if (exp < time / 2 || exp > (time * 3) / 2) {
        |                                             ~~~~~~^~~~
```

Fixes: 37136cb442 ("test/timeout: add multi timeout reqs test with different timeout")
Cc: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/hgUsvvrR9xY-ammarfaizi2@gnuweeb.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-18 06:53:58 -06:00
Pavel Begunkov b75a68e0af io_uring: test IORING_TIMEOUT_ETIME_SUCCESS
Make sure we don't fail links on ETIME when IORING_TIMEOUT_ETIME_SUCCESS
is set.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d1a5b6bdbcfa1ec6b5ca014248e12b3b1edb4e5d.1633259449.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-03 07:06:49 -06:00
Jens Axboe 13106ddf43 test/timeout: improve finding exec-target
The test is currently broken because it assumes that it's in the
same directory, that's never the case if the test is run from the
make runtests target.

Try both ./exec-target and test/exec-target, that should make it work
more reliably.

Fixes: fa4a89bea5 ("tests: test timeout cancellation fails links")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-14 08:44:25 -06:00
Pavel Begunkov fa4a89bea5 tests: test timeout cancellation fails links
Test that we appropriately fail linked requests when we cancel a
normal timeout.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/e9acec809a3d86cab22601fe87c963c4ffac61e6.1631358658.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-11 08:25:22 -06:00
Jens Axboe 0969e5522a test/timeout: newer kernel require separate submit
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-08 21:44:48 -06:00
Marcelo Diop-Gonzalez e0adb4c7c3 tests: add another timeout sequence test case
This test case catches an issue where timeouts may not be flushed
if the number of new events is greater (not equal) to the number
of events requested in the timeout.

Signed-off-by: Marcelo Diop-Gonzalez <marcelo827@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-24 21:33:09 -07:00
Pavel Begunkov 41d011dcc1 timeout/test: clear state for timeout updates
Clear the ring before test_update_nonexistent_timeout(), because
otherwise previous test_single_timeout_wait() may leave an internal
timeout, that would fire and fail the test with -ETIME.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-08 15:44:14 -07:00
Pavel Begunkov 0731c15e60 test/timeout: test timeout updates
Test timeout updates if supported. Fuzzy checks that it sustains
specified timings. Tests async/linked update, rel/abs, short and longer
delays.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-11-30 15:54:16 -07: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 e502435779 Add SPDX license identifiers
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-11 20:34:12 -07:00
Jens Axboe 00dc6876cf test/timeout: remove copied (and wrong) comments
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-04 10:12:56 -07:00
Jens Axboe 7b8d8611b0 test/timeout: add test cases for sqe->flags being set on timeouts
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-04 10:03:38 -07:00
Jens Axboe 96144ea798 Split out system call bits from library interface
Rename the io_uring_* system calls to __sys_io_uring_* and make them
locals.

We only have the system calls because they are not in glibc yet, and
it's somewhat confusing that they share the same namespace as the
library functions. With this change, any exported io_uring_* function
is a library function.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-01 11:22:24 -07:00
Jens Axboe f0d57a101b test/timeout: test_single_timeout_nr should wait for 3, not 4
We only submit 3 requests, so don't wait for 4 of them.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-25 09:43:31 -07:00
Hrvoje Zeba 72bb93940b Printout correct failure locations in test/timeout.c
Some printouts were misleading, probably a c/p bug.

Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-04 19:42:53 -07:00
Hrvoje Zeba 46e870e976 Use msec parameter instead of TIMEOUT_MSEC in msec_to_ts()
Small fix to make sure correct ts structure is filled with correct values.

Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-04 19:42:48 -07:00
zhangyi (F) 6cca9e574c test/timeout: add multi timeout reqs test with different count
Add multi timeout reqs test case which want to test submitting timeout
reqs with different count number, check the return sequence and the
status of each req.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-23 21:41:56 -06:00
zhangyi (F) 37136cb442 test/timeout: add multi timeout reqs test with different timeout
Add multi timeout reqs test case which want to test submitting timeout
reqs with different timeout value, check the return sequence and the
status of each req.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-23 21:41:54 -06:00
Jens Axboe 93a22668c8 Shorten timeout tests
We use 1s for a lot of testing, shrink it down to 200 msec to allow
it to run a bit quicker.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-21 08:42:04 -06:00
Jens Axboe 80d8217c2f Add IORING_OP_TIMEOUT_REMOVE
Add the command opcode, and add two test cases for it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-16 09:14:11 -06:00
Jens Axboe b75b52e2d4 test/timeout: cleanup cqe seen and error prints
Use stderr always, and include the function name.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-16 07:28:37 -06:00
Jens Axboe 11a8f2bc38 Make io_uring_prep_timeout() take timeout flags
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 <axboe@kernel.dk>
2019-10-15 17:31:17 -06:00
Jens Axboe f303986495 Add test case for absolute timeouts
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-15 16:52:44 -06:00
Jens Axboe e2934e1444 Switch to 32/64-bit agnostic timeout format
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 <axboe@kernel.dk>
2019-10-01 10:19:54 -06:00
Jens Axboe ac72640594 Fold io_uring_wait_cqes_timeout() with io_uring_wait_cqes()
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 <axboe@kernel.dk>
2019-09-27 08:32:50 -06:00
Jens Axboe 3ea33cb360 test/timeout: use io_uring_wait_cqes_timeout()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-21 15:05:15 -06:00
Jens Axboe 8b93cca24b io_uring_wait_cqe_timeout: document that io_uring_submit() not needed
We call this internally after queueing the timeout SQE anyway, so
the application doesn't have to do it upfront.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-21 14:44:57 -06:00
Jens Axboe 76e9232baa Add io_uring_wait_cqe_timeout()
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 <axboe@kernel.dk>
2019-09-21 13:02:05 -06:00
Jens Axboe 3ad9074b79 Add TIMEOUT support
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 <axboe@kernel.dk>
2019-09-20 19:49:30 -06:00
Jens Axboe efb4e86701 Remove TIMEOUT code
We'll rework it for the final version, kill the early version
test case and liburing addition.

This reverts commits:

efb39e105a
e4269d2c10
4652762d5b
f102231b0f

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-19 09:55:18 -06:00
Jens Axboe efb39e105a test/timeout: check if we always get a wakeup from timeout
We need a wakeup even if we don't hit the desired number of
available commands if a timeout has triggered. Add a test case
for that.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-17 13:39:47 -06:00
Jens Axboe e4269d2c10 test/timeout: include some notion of verifying length of timeout
In my testing, we're always right on 1000 msec, but allow some slack
and just judge it good if we're within +- 50%.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-17 12:18:07 -06:00
Jens Axboe 4652762d5b Add basic IORING_OP_TIMEOUT test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-17 10:03:00 -06:00