Commit Graph

31 Commits

Author SHA1 Message Date
Jens Axboe
093e902c28 test/fsync: error out if we submit less than we wanted
This failure is expected on kernels that don't support the DRAIN
primitive.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-11 09:00:47 -06:00
Jens Axboe
9864409788 test/fsync: update for IOSQE_IO_DRAIN approach
I generalized the barrier flag to be applicable to all commands, so
let's drop the fsync special flag.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-10 21:56:54 -06:00
Jens Axboe
db11f116c7 Use io_uring_cqe_get_data() internally
Replace all cqe->user_data casts with io_uring_cqe_get_data().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-07 18:36:43 -06:00
Jens Axboe
61c27f73f8 Add barrier fsync test case
Also changes the fsync prep helper to require passing in the actual
flag, not just a boolean for fsync vs fdatasync.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-06 21:50:15 -06:00
Jens Axboe
a231fdcaa1 test/io_uring-cp: add some comments
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-06 08:31:26 -07:00
Jens Axboe
f7dac56b4a test/io_uring-cp: make it more efficient
Clean it up, and just use a single io_uring for both the reads
and the writes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-05 20:41:34 -07:00
Jeff Moyer
765ba233c8 add syscall unit tests
Add tests for io_uring_setup, io_uring_register and io_uring_enter.
The test coverage is nowhere near complete and the reporting is not
uniform.  But, it's a start.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-04 15:37:40 -07:00
Jens Axboe
6726376f32 test/fsync: add simple fsync tester
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08 21:02:00 -07:00
Jens Axboe
f171fa43ab test/ring-leak: silence "sending fd" message
We assume that a silent test is good.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08 11:34:38 -07:00
Jens Axboe
5e6a93cf0b test/ring-leak: add test app demonstrating leak of io_uring instance
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-07 12:27:23 -07:00
Jens Axboe
bc4e4a7427 test/poll: ignore parent dying
The parent may well die before the child is done, as long as it wrote to
the pipe, we're fine.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18 18:48:40 -07:00
Jens Axboe
a2fc9f13b5 test/poll: simply test case
Just setup one ring in the child process, and poll for when the
read side of the pipe is readable. From the parent, write something
to the pipe.

If nothing happens within 1 second, fail the test.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18 15:14:43 -07:00
Jens Axboe
d58ea1a0ea test/poll-cancel: improve test case
- Add a timeout, if we don't finish in one second we are definitely
  hung because the poll remove command didn't work.
- Don't assume completion ordering

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18 08:29:44 -07:00
Jens Axboe
3640699bea Switch to IORING_OP_POLL_ADD/REMOVE
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18 07:00:14 -07:00
Jens Axboe
b7e86eb7db 32-bit fixes
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 18:14:21 -07:00
Jens Axboe
5789a6351a Add sqe prep helpers
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 18:12:22 -07:00
Jens Axboe
768d4559d0 Update POLL API
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 14:24:28 -07:00
Jens Axboe
79a7d3a3f6 Add IORING_OP_POLL_CANCEL test
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 13:05:52 -07:00
Jens Axboe
ce899b79f9 Add test case for IORING_OP_POLL
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 11:40:24 -07:00
Jens Axboe
b93edf5b9e Sync with upstream API
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-16 09:00:50 -07:00
Jens Axboe
ff52073504 Sync with kernel API
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-11 10:36:28 -07:00
Jens Axboe
a992ffa482 io_queue_init: pass in flags, not io_uring_params
We don't need any of the information in there in the caller, and
this makes it harder to abuse as we don't require the caller to
have memset() the struct first.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-10 15:11:07 -07:00
Jens Axboe
fa863f6b4a Fix test cases
- Don't use polled IO for the io_uring-test, that'll fail if the
  fs/device doesn't suppor it
- copy read-in was broken for io_uring-cp

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-10 15:08:49 -07:00
Jens Axboe
d5b4ae1c58 Update to newer API
- Fixed buffers are now available through io_uring_register()
- Various thread/wq options are now dead and automatic instead
- sqe->index is now sqe->buf_index
- Fixed buffers require flag, not separate opcode

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-10 14:28:10 -07:00
Jens Axboe
6cdce17753 Update API
- io_uring_sqe added a data field that's passed back at completion
- io_uring_sqe added an index field, for fixed buffer locations
- io_uring_setup(2) system call added a 'nr_iovecs' field

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-10 09:35:34 -07:00
Jens Axboe
7bf7e8e8e5 Update to newer API
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-09 15:26:20 -07:00
Jens Axboe
66a7d05bd8 liburing: include the ring fd in the io_uring
No point in keeping these separate.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08 16:01:59 -07:00
Jens Axboe
baa8d243cc Add simple test/ Makefile
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08 15:49:32 -07:00
Jens Axboe
357ca59684 Add sample 'cp' program
Don't rely on this for anything, it's just a test case / demo.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08 15:41:14 -07:00
Jens Axboe
7f7a66e385 Change API to provide io_uring struct abstraction
This is cleaner than having the app juggle an SQ and CQ ring,
just wrap them in struct io_uring and have the API always take
that. This means the app doesn't need to worry about the different
types of rings, and that we only need to pass in one argument
for setup/teardown.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08 15:38:05 -07:00
Jens Axboe
f93c84e1b0 Initial commit
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08 07:38:15 -07:00