io_uring/chan: add support for IORING_OP_CHAN_POST
If a ring has setup a unidirectional communication line between two
rings, it can use IORING_OP_CHAN_POST to efficiently send data from one
ring to another.
The destination ring must be setup with DEFER_TASKRUN and be able to
post 32b CQEs. The former for efficiency reasons, the latter to be able
to pass enough information in a IORING_OP_CHAN_POST request.
On the source ring, the SQE must be setup as follows:
->fd Queue to target. Queue IDs are 1..USHRT_MAX and returned
from io_uring_register() with IORING_OP_REGISTER_CHAN.
->rw_flags Modifier flags. Supports IORING_CHAN_IDLE for now, which
picks a source queue that is currently idle (eg waiting
on CQEs). If that flag is set, ->fd must be set to zero.
->addr Target ring cqe->user_data will be set to this value.
->off Target ring cqe->big_cqe[0] will be set to this value.
On the source ring, cqe->res will be set to < 0 in case of error. For
success, cqe->res will be set to the target queue ID that received the
message.
On the target, the cqe->res will be the queue ID to use for a response,
if the communication channel has been setup with IORING_CHAN_REG_BIDI.
If the channel is non-bidi, then the result will be 0.
Signed-off-by: Jens Axboe <axboe@kernel.dk>