Closed CPestka closed 2 months ago
Thanks for doing this!
IORING_OP_URING_CMD should maybe have its own man page? Currently it is only nvme that is using it
I think it should have its own man page, but it's not true that only nvme is using it. Yes it's used for nvme passthrough, but if you look at the socket op methods for get/setsockopt, then those use the uring_cmd interface as well. And that part will only grow. You can consider OP_URING_CMD as a way of doing per-file type private operations, kind of like ioctls (except async).
IORING_OP_URING_CMD should maybe have its own man page? Currently it is only nvme that is using it
It takes a registered file index and installs it in the normal process file table, turning it into a file descriptor you can use with regular syscalls as well. It remains a registered descriptor as well.
It takes a registered file index and installs it in the normal process file table, turning it into a file descriptor you can use with regular syscalls as well. It remains a registered descriptor as well.
Oh, that makes a lot of sense. I was wondering a while back how one would e.g. call smth like getpeername() on a connection made with accept using registered fds. I guess that's the answer ^^
Btw it seems like the ability to pass the new "non-registered" fd back to the user is implemented in receive_fd(), but not wired up to the IORING_OP_FIXED_FD_INSTALL, which always passes it NULL for the user space ptr. Is that an oversight or intentional?
Btw it seems like the ability to pass the new "non-registered" fd back to the user is implemented in receive_fd(), but not wired up to the IORING_OP_FIXED_FD_INSTALL, which always passes it NULL for the user space ptr. Is that an oversight or intentional?
That's intentional - the userptr doesn't exist on the io_uring side. If you look at receive_fd(), it both returns the fd value where the regular file descriptor was installed, and copies it to a userspace address, if one is given. io_uring just uses the former.
This adds documentation for the following missing Op codes:
It also adds documentation about:
As it seems there are no man pages for the new futex syscalls yet (they are normally done by glibc right?) I'm not very sure that I got everything right regarding these syscalls.
Two Ops that are still missing now are IORING_OP_FIXED_FD_INSTALL and IORING_OP_URING_CMD. IORING_OP_URING_CMD should maybe have its own man page? Currently it is only nvme that is using it, but i supposed the description of it could grow large over time. (As a side note liburing helper functions for nvme cmds would be neat :) ) Regarding IORING_OP_FIXED_FD_INSTALL I wasn't entirely sure how it works. It is apparently used to take "ownership" (installing it in the reg file table and dealing with the file refcount) of a registered file of another ring, but I wasn't sure how the passing of the file struct is actually happening. Does that have smth to do with MSG rings?
On another side note: IORING_OP_FIXED_FD_INSTALL, IORING_OP_FTRUNCATE, IORING_OP_BIND, IORING_OP_LISTEN seem to be missing in the enum in tools/include/uapi/linux/io_uring.h, right?
git request-pull output:
Click to show/hide pull request guidelines
## Pull Request Guidelines 1. To make everyone easily filter pull request from the email notification, use `[GIT PULL]` as a prefix in your PR title. ``` [GIT PULL] Your Pull Request Title ``` 13. Follow the commit message format rules below. 14. Follow the Linux kernel coding style (see: https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst). ### Commit message format rules: 1. The first line is title (don't be more than 72 chars if possible). 5. Then an empty line. 6. Then a description (may be omitted for truly trivial changes). 15. Then an empty line again (if it has a description). 16. Then a `Signed-off-by` tag with your real name and email. For example: ``` Signed-off-by: Foo BarBy submitting this pull request, I acknowledge that: