]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: add support for IORING_OP_MSG_RING command
authorJens Axboe <axboe@kernel.dk>
Thu, 10 Mar 2022 13:27:26 +0000 (06:27 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 10 Mar 2022 16:16:04 +0000 (09:16 -0700)
commitd147ff5a29fa3f87e120268f4c243133fac75d05
tree6f5f47b26c3b1a5c0de6ce92069d8c28f93d7069
parent5edd5d0592c75e4265df839ba4a9c2d8758ad72b
io_uring: add support for IORING_OP_MSG_RING command

This adds support for IORING_OP_MSG_RING, which allows an SQE to signal
another ring. That allows either waking up someone waiting on the ring,
or even passing a 64-bit value via the user_data field in the CQE.

sqe->fd must contain the fd of a ring that should receive the CQE.
sqe->off will be propagated to the cqe->user_data on the target ring,
and sqe->len will be propagated to cqe->res. The results CQE will have
IORING_CQE_F_MSG set in its flags, to indicate that this CQE was generated
from a messaging request rather than a SQE issued locally on that ring.
This effectively allows passing a 64-bit and a 32-bit quantify between
the two rings.

This request type has the following request specific error cases:

- -EBADFD. Set if the sqe->fd doesn't point to a file descriptor that is
  of the io_uring type.
- -EOVERFLOW. Set if we were not able to deliver a request to the target
  ring.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h