diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-06-13 13:47:02 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-07-25 03:39:16 +0300 |
commit | e6130eba8a848a7a6ba6c534bd8f6d60749ae1a9 (patch) | |
tree | e13263541388b730b12857689d000cf053615a46 /include/uapi/linux/atmapi.h | |
parent | f110ed8498afa6ff8e9a8c08fb26880e02117616 (diff) | |
download | linux-e6130eba8a848a7a6ba6c534bd8f6d60749ae1a9.tar.xz |
io_uring: add support for passing fixed file descriptors
With IORING_OP_MSG_RING, one ring can send a message to another ring.
Extend that support to also allow sending a fixed file descriptor to
that ring, enabling one ring to pass a registered descriptor to another
one.
Arguments are extended to pass in:
sqe->addr3 fixed file slot in source ring
sqe->file_index fixed file slot in destination ring
IORING_OP_MSG_RING is extended to take a command argument in sqe->addr.
If set to zero (or IORING_MSG_DATA), it sends just a message like before.
If set to IORING_MSG_SEND_FD, a fixed file descriptor is sent according
to the above arguments.
Two common use cases for this are:
1) Server needs to be shutdown or restarted, pass file descriptors to
another onei
2) Backend is split, and one accepts connections, while others then get
the fd passed and handle the actual connection.
Both of those are classic SCM_RIGHTS use cases, and it's not possible to
support them with direct descriptors today.
By default, this will post a CQE to the target ring, similarly to how
IORING_MSG_DATA does it. If IORING_MSG_RING_CQE_SKIP is set, no message
is posted to the target ring. The issuer is expected to notify the
receiver side separately.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/uapi/linux/atmapi.h')
0 files changed, 0 insertions, 0 deletions