aboutsummaryrefslogtreecommitdiff
path: root/man/io_uring_prep_msg_ring.3
blob: 9cf3444d86de851ee64b81a127511e165b97b682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_prep_msg_ring 3 "March 10, 2022" "liburing-2.2" "liburing Manual"
.SH NAME
io_uring_prep_msg_ring \- send a message to another ring
.SH SYNOPSIS
.nf
.B #include <liburing.h>
.PP
.BI "void io_uring_prep_msg_ring(struct io_uring_sqe *" sqe ","
.BI "                        int " fd ","
.BI "                        unsigned int " len ","
.BI "                        __u64 " data ","
.BI "                        unsigned int " flags ");"
.fi
.SH DESCRIPTION
.PP
.BR io_uring_prep_msg_ring (3)
prepares a to send a CQE to an io_uring file descriptor. The submission queue
entry
.I sqe
is setup to use the file descriptor
.IR fd ,
which must identify a io_uring context, to post a CQE on that ring where the
target CQE
.B res
field will contain the content of
.I len
and the
.B user_data
of
.I data
with the request modifier flags set by
.IR flags .
Currently there are no valid flag modifiers, this field must contain
.BR 0 .

The targeted ring may be any ring that the user has access to, even the ring
itself. This request can be used for simple message passing to another ring,
allowing 32+64 bits of data to be transferred through the
.I len
and
.I data
fields. The use case may be anything from simply waking up someone waiting
on the targeted ring, or it can be used to pass messages between the two
rings.

.SH RETURN VALUE
None

.SH ERRORS
These are the errors that are reported in the CQE
.I res
field.
.TP
.B -ENOMEM
The kernel was unable to allocate memory for the request.
.TP
.B -EINVAL
One of the fields set in the SQE was invalid.
.TP
.B -EBADFD
The descriptor passed in
.I fd
does not refer to an io_uring file descriptor.
.TP
.B -EOVERFLOW
The kernel was unable to fill a CQE on the target ring. This can happen if
the target CQ ring is in an overflow state and the kernel wasn't able to
allocate memory for a new CQE entry.