Commit Graph

746 Commits

Author SHA1 Message Date
Paul Ewing a7987e94de Update packaging/installation for new man pages 2020-09-15 22:18:56 -07:00
Paul Ewing f98e195d92 Add man page for io_uring_queue_exit 2020-09-14 10:19:24 -07:00
Paul Ewing 4d73e656c2 Add man page for io_uring_queue_init 2020-09-14 08:43:25 -07:00
Jens Axboe eeec5edea3 test/sigfd-deadlock: remove unneeded libaio.h include
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-09-02 19:55:04 -06:00
Jens Axboe 95c86e6b06 Fix missing 'c' in sigfd-deadlock addition
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-09-02 09:15:09 -06:00
Jens Axboe 2e424e8d23 .gitignore: add a few missing tests
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-29 18:51:11 -06:00
Jens Axboe 8dab3799ae Add signalfd deadlock test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-29 18:49:01 -06:00
Jens Axboe c0c96b2757 test/register-restrictions: don't fail if restrictions aren't supported
Also cleanup the tests a bit (static, void).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-28 10:04:45 -06:00
Jens Axboe 6c9ce142a2 Merge branch 'io_uring_restrictions' of https://github.com/stefano-garzarella/liburing into master
* 'io_uring_restrictions' of https://github.com/stefano-garzarella/liburing:
  Add test/register-restrictions.c test case
  Add helper to enable rings
  Add helper to register restrictions
  io_uring.h: add register restrictions and enable ring defines
  io_uring.h: use an enumeration for io_uring_register(2) opcodes
2020-08-28 10:02:05 -06:00
Stefano Garzarella c62e8d2702 Add test/register-restrictions.c test case
This new test stresses the IORING_REGISTER_RESTRICTIONS opcode.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-08-27 15:35:43 +02:00
Stefano Garzarella 85fbd45cb8 Add helper to enable rings
This patch adds io_uring_enable_rings() that can be used to
enable rings created with IORING_SETUP_R_DISABLED flag.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-08-27 15:35:43 +02:00
Stefano Garzarella 7187cd8771 Add helper to register restrictions
This patch adds io_uring_register_restrictions() useful to
register restrictions.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-08-27 15:35:43 +02:00
Stefano Garzarella 8c55dd7970 io_uring.h: add register restrictions and enable ring defines
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-08-27 15:35:43 +02:00
Stefano Garzarella a02a8d036e io_uring.h: use an enumeration for io_uring_register(2) opcodes
The enumeration allows us to keep track of the last
io_uring_register(2) opcode available.

Behaviour and opcodes names don't change.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-08-27 15:35:41 +02:00
Jens Axboe abce98153b Add a test case for closed pipe terminating properly
This is fixed by upstream commit:

commit 68faa4727c0e2d7d255d9b97e754f2cda748f141
Author: Jens Axboe <axboe@kernel.dk>
Date:   Tue Aug 25 12:27:50 2020 -0600

    io_uring: don't use poll handler if file can't be nonblocking read/written

We're testing whether we first get some data, then a zero return on the
next one when it's closed. The buggy behavior was to arm a poll handler,
which isn't notified when the pipe is closed.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-25 17:23:14 -06:00
Jens Axboe fac6b9fc59 io_uring_prep_splice(): fix type (again)
Guillem Jover correctly points out that this did used to be loff_t,
but was changed since it wasn't available everywhere.

Let's just use an int64_t, it's the same size and signed. Hopefully
this is it...

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-24 07:25:38 -06:00
Jens Axboe 5aecdbe26d Use the right type for io_uring_prep_splice()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-24 03:22:49 -06:00
Jens Axboe 2e5274fe62 Merge branch 'refactor_header_file_deps' of https://github.com/gfx/liburing into master
* 'refactor_header_file_deps' of https://github.com/gfx/liburing:
  syscall: make syscall.h independently includeable
2020-08-22 20:12:48 -06:00
Goro Fuji 0b9394fec8 syscall: make syscall.h independently includeable
syscall.h is mising the forward declaration for struct io_uring_params, and sigset_t. Include the necessary
system header to make it independent.

Signed-off-by: Goro Fuji <g.psy.va@gmail.com>
2020-08-23 01:09:49 +00:00
Jens Axboe 5de5b6a042 test/iopoll: only SQPOLL requires root, IOPOLL does not
We can test IOPOLL just fine as a regular user, so just skip the SQPOLL
specific tests.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-21 15:45:47 -06:00
Jens Axboe 895101b8b8 test/iopoll: coding style fixups
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-21 08:40:24 -06:00
Jens Axboe bc2adeb7bb Merge branch 'iopoll-enters-test' of https://github.com/glommer/liburing into master
* 'iopoll-enters-test' of https://github.com/glommer/liburing:
  iopoll: test that we always enter the ring
2020-08-21 08:36:31 -06:00
Glauber Costa 3a745bc3dd iopoll: test that we always enter the ring
If the ring is configured to operate in poll mode we need to always
enter the kernel to fetch new events. This behavior was introduced
in  bf3aeb3dbb but recently broken.

Break me once, shame on you. Break me twice, shame on me:
  - Add a unit test.

The unit test submits sqes manually through the system call, which
guarantees that IORING_ENTER_GETEVENTS will not be present in the flag
set during the initial submission.

The only way we can ever fetch new I/O events is if io_uring_submit
indeed will enter the ring despite not having new sqes to submit.

This test passes with 8e8cb865cd but fails before it due to the
aforementioned regression.

Signed-off-by: Glauber Costa <glauber@datadoghq.com>
2020-08-21 09:34:49 -04:00
Jens Axboe 8e8cb865cd sq_ring_needs_enter: revert change to only enter if submit != 0
This reverts commit c415b39d67.

Glauber reports a regressions for his polled setup with this change.
As it's purely speculative, just revert it.

Reported-by: Glauber Costa <glauber.costa@datadoghq.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-20 21:40:16 -06:00
Jens Axboe 53b4f9af81 examples/io_uring-test: don't error on shorter files
The example currently assumes the file is at least 4*4096 bytes,
and errors when we get 0 reads on EOF. Fix this up.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-20 05:48:24 -06:00
Jens Axboe 7124bfa7e2 test/a4c0b3decb33-test: limit to 5000 iterations
We currently rely on this test being killed by runtests.sh, and
the test expects this and exits nicely when that happens. But let's
give it a finite runtime in general, so that running it independently
will have it exit nicely on its own as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-20 05:38:50 -06:00
Jens Axboe 81d63a87cb test/lfs-openat: add linked files test case
From Pavel, added a version that sets IOSQE_ASYNC as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-16 08:36:17 -07:00
Jens Axboe a1c610c48f test/double-poll-crash: ignore arguments
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-15 11:53:38 -07:00
Jens Axboe 85bdbaa147 Add test case for double poll crash
This is the generated syzkaller reproducer. Should be fixed by this
mainline commit:

commit d4e7cd36a90e38e0276d6ce0c20f5ccef17ec38c (HEAD -> io_uring-5.9, origin/io_uring-5.9)
Author: Jens Axboe <axboe@kernel.dk>
Date:   Sat Aug 15 11:44:50 2020 -0700

    io_uring: sanitize double poll handling

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-15 11:51:29 -07:00
Jens Axboe 8d5397ec28 test/submit-reuse: accept test argument
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-15 08:49:10 -07:00
Jens Axboe 025fa064c4 test/timeout-overflow: don't run on newer kernels
It's known to fail with the batched completions, just disable it
on newer kernels.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-13 18:00:06 -06:00
Jens Axboe be9a28a0fc test: add missing SPDX identifiers
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-13 17:46:01 -06:00
Jens Axboe e6f41a5461 Add test cases for file table exit hang
This should be fixed by the kernel commit:

commit f254ac04c8744cf7bfed012717eac34eacc65dfb
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed Aug 12 17:33:30 2020 -0600

    io_uring: enable lookup of links holding inflight files

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-13 17:44:15 -06:00
Jens Axboe 29342582bd .gitignore: add test/wakeup-hang
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-13 09:56:21 -06:00
Jens Axboe 8a87557966 test/wakeup-hang: ignore argument
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-13 09:55:52 -06:00
Jens Axboe c5060b31ae Add test case for task_work related wakeup hang
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-08-07 16:46:56 -06:00
Jens Axboe c4299cd841 test/eeed8b54e0df-test: allow 4096 as valid return too
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-30 10:44:10 -06:00
Stefano Garzarella 4f0901f2a4 .gitignore: add test/nop-all-sizes
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-28 10:07:41 -06:00
Jens Axboe a4684b96ee man/io_uring_setup.2: document IORING_SETUP_ATTACH_WQ
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-24 09:48:48 -06:00
Jens Axboe a597d46be2 Merge branch 'master-debian' of https://github.com/metze-samba/liburing
* 'master-debian' of https://github.com/metze-samba/liburing:
  update debian/changelog
  update debian/liburing1.symbols
  debian/rules: pass down relativelibdir in order to get an absolute path
2020-07-22 16:58:45 -06:00
Stefan Metzmacher 9408c8b45e update debian/changelog
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2020-07-23 00:53:13 +02:00
Stefan Metzmacher de6bb79f0b update debian/liburing1.symbols
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2020-07-23 00:53:13 +02:00
Stefan Metzmacher 89661f688c debian/rules: pass down relativelibdir in order to get an absolute path
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2020-07-23 00:52:32 +02:00
Jens Axboe a82eb88c7a Merge branch 'man_newdoc' of https://github.com/xuanyi-fu/liburing
* 'man_newdoc' of https://github.com/xuanyi-fu/liburing:
  man/io_uring_setup.2: document IORING_SETUP_CLAMP
2020-07-18 08:38:04 -06:00
xuanyi-fu 01b52000bb man/io_uring_setup.2: document IORING_SETUP_CLAMP
Signed-off-by: Xuanyi Fu <xfu11@jhu.edu>
2020-07-18 15:41:40 +08:00
Jens Axboe 7fceb7d5df Merge branch 'man_fix' of https://github.com/necipfazil/liburing
* 'man_fix' of https://github.com/necipfazil/liburing:
  man/io_uring_enter: fix openat sqe doc
2020-07-16 09:01:14 -06:00
Necip Fazil Yildiran 248415a329 man/io_uring_enter: fix openat sqe doc 2020-07-16 07:33:43 +00:00
Jens Axboe 649f9969b9 test/nop-all-sizes: exit ring for each loop
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-11 10:08:45 -06:00
Jens Axboe a930a04f80 Add test case for testing full fill of SQ and CQ ring
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-11 09:49:45 -06:00
Jens Axboe 31e6ef3227 .gitignore: add test/cq-overflow-peek
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-10 08:29:37 -06:00