Commit Graph

42 Commits

Author SHA1 Message Date
Jens Axboe
8471fb944d man/io_uring_setup: mention that IORING_SETUP_SQPOLL needs fixed files
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-05 11:42:04 -07:00
Jeff Moyer
450033065f io_uring_register takes 4 args
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-05 11:37:19 -07:00
Jens Axboe
be33b0a219 src/io_uring.h: sync with kernel header
Just a removal of the IORING_MAX_ENTRIES user visible define.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-31 22:58:02 -07:00
Jens Axboe
091b18fb85 man/io_uring_enter.2: we no longer EBUSY on mutex trylock failure
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-31 22:57:14 -07:00
Jeff Moyer
59bb09c553 man: add io_uring_setup.2 man page
Initial man page for io_uring_setup.  Content was taken from the kernel
commit logs and from an LWN article written by Jon Corbet.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-30 06:43:00 -07:00
Jens Axboe
27ad3317fb Update kernel io_uring header
- struct io_uring_params changed (u16 -> u32 for sq options)
- Use unsigned for the flag types

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-29 06:32:13 -07:00
Jeff Moyer
9688b4a00f man: fixup description of fixed files I/O
The man page suggests that IOSQE_FIXED_FILE must be specified for all
sqes when the io_uring instance has files registered.  This is not
the case, so clear that up.

Also fix a typo (few->new) while we're in there.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-26 06:40:48 -07:00
Jeff Moyer
2a8e5b105c man: io_uring_register: use a .TP list for flags
This seems to be the canonical way to do things.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-26 06:40:47 -07:00
Jeff Moyer
4a700b7e35 man: alphabetize the error section for io_uring_register
This also includes a couple of whitespace cleanups.  Most man pages
don't leave spaces between directives.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-26 06:40:44 -07:00
Jens Axboe
bceccde79a System calls have been renumbered
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-23 08:03:41 -07:00
Jeff Moyer
81f9d4616e io_uring_enter.2 man page
Initial man page for io_uring_enter.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-22 12:57:07 -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
213d6f39ef Split src/io_uring.c up
Let's have the various helpers be in usefully named functions, no
need to bundle them all into the same one.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 21:40:30 -07:00
Jens Axboe
257578052a liburing: ensure prep helpers actually set iovec count
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 21:33:39 -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
Jeff Moyer
980cc0f025 man: add a man page for io_uring_register
Initial content was taken from the kernel commits (Jens Axboe).

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17 16:19:07 -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
6110279661 Update barriers for x86/x86-64
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-16 09:04:02 -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
f16b83b293 Add configure script
Some older installs don't have __kernel_rwf_t in linux/fs.h, so
add a check for that.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-15 11:19:16 -07:00
Jens Axboe
89167b457f Add x86 32-bit support
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-13 11:03:04 -07:00
Jens Axboe
4fe9645fa4 io_uring_get_iocb() -> io_uring_get_sqe()
Missed this part when the switch was made to full 'sqe'.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-13 09:19:20 -07:00
Jens Axboe
58004cd7a6 Sync io_uring.h with the kernel
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-13 09:18:11 -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
f47f24cea7 liburing: add io_uring_iocb_from_ev() helper
Returns the iocb associated with a completion event.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08 15:38:03 -07:00
Jens Axboe
6a44c6e0f7 Add option for getting a completion without waiting
This now exposes two helpers:

io_uring_get_completion()
	Return a completion, if we have one (or more) available in
	the ring

io_uring_wait_completion()
	Return a completion, waiting for it if necessary

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