2022-05-25 12:42:08 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
io_uring/msg_ring: add support for sending a sync message
Normally MSG_RING requires both a source and a destination ring. But
some users don't always have a ring avilable to send a message from, yet
they still need to notify a target ring.
Add support for using io_uring_register(2) without having a source ring,
using a file descriptor of -1 for that. Internally those are called
blind registration opcodes. Implement IORING_REGISTER_SEND_MSG_RING as a
blind opcode, which simply takes an sqe that the application can put on
the stack and use the normal liburing helpers to initialize it. Then the
app can call:
io_uring_register(-1, IORING_REGISTER_SEND_MSG_RING, &sqe, 1);
and get the same behavior in terms of the target, where a CQE is posted
with the details given in the sqe.
For now this takes a single sqe pointer argument, and hence arg must
be set to that, and nr_args must be 1. Could easily be extended to take
an array of sqes, but for now let's keep it simple.
Link: https://lore.kernel.org/r/20240924115932.116167-3-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-09-24 11:57:31 +00:00
|
|
|
int io_uring_sync_msg_ring(struct io_uring_sqe *sqe);
|
2022-05-25 12:42:08 +00:00
|
|
|
int io_msg_ring_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
|
|
|
|
int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags);
|
2022-12-07 03:53:34 +00:00
|
|
|
void io_msg_ring_cleanup(struct io_kiocb *req);
|
2024-06-06 18:25:01 +00:00
|
|
|
void io_msg_cache_free(const void *entry);
|