1io_uring_prep_msg_ring(3)       liburing Manual      io_uring_prep_msg_ring(3)
2
3
4

NAME

6       io_uring_prep_msg_ring - send a message to another ring
7

SYNOPSIS

9       #include <liburing.h>
10
11       void io_uring_prep_msg_ring(struct io_uring_sqe *sqe,
12                               int fd,
13                               unsigned int len,
14                               __u64 data,
15                               unsigned int flags);
16
17       void io_uring_prep_msg_ring_cqe_flags(struct io_uring_sqe *sqe,
18                               int fd,
19                               unsigned int len,
20                               __u64 data,
21                               unsigned int flags,
22                               unsigned int cqe_flags);
23

DESCRIPTION

25       io_uring_prep_msg_ring(3)  prepares  to  send a CQE to an io_uring file
26       descriptor. The submission queue entry sqe is setup to use the file de‐
27       scriptor  fd,  which must identify a io_uring context, to post a CQE on
28       that ring where the target CQE res field will contain  the  content  of
29       len  and  the  user_data of data with the request modifier flags set by
30       flags.  Currently there are no valid flag modifiers,  this  field  must
31       contain 0.
32
33       The targeted ring may be any ring that the user has access to, even the
34       ring itself. This request can be used for simple message passing to an‐
35       other  ring,  allowing 32+64 bits of data to be transferred through the
36       len and data fields. The use case may be anything from simply waking up
37       someone  waiting  on  the targeted ring, or it can be used to pass mes‐
38       sages between the two rings.
39
40       io_uring_prep_msg_ring_cqe_flags(3)    is     similar     to     io_ur‐
41       ing_prep_msg_ring(3).   But  has an addition cqe_flags parameter, which
42       is used to set flags field on CQE side. That way, you can set  the  CQE
43       flags  field  cqe->flags when sending a message. Be aware that io_uring
44       could potentially set additional bits into this field.
45
46

RETURN VALUE

48       None
49
50

ERRORS

52       These are the errors that are reported in the CQE res field.
53
54       -ENOMEM
55              The kernel was unable to allocate memory for the request.
56
57       -EINVAL
58              One of the fields set in the SQE was invalid.
59
60       -EBADFD
61              The descriptor passed in fd does not refer to an  io_uring  file
62              descriptor, or the ring is in a disabled state.
63
64       -EOVERFLOW
65              The kernel was unable to fill a CQE on the target ring. This can
66              happen if the target CQ ring is in an  overflow  state  and  the
67              kernel wasn't able to allocate memory for a new CQE entry.
68
69
70
71liburing-2.2                    March 10, 2022       io_uring_prep_msg_ring(3)
Impressum