All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artyom Pavlov <newpavlov@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: Re: Sending CQE to a different ring
Date: Thu, 10 Mar 2022 19:22:51 +0300	[thread overview]
Message-ID: <0b9831d8-0597-9d17-e871-e964e257e8a7@gmail.com> (raw)
In-Reply-To: <2ba7fb27-0eec-e2a2-c986-529175c79cbe@kernel.dk>

>> I like IORING_OP_WAKEUP_RING with sqe->len being copied to
>> cqe->result. The only question I have is how should "negative" (i.e.
>> bigger or equal to 2^31) lengths be handled. They either should be
>> copied similarly to positive values or we should get an error.
> 
> Any IO transferring syscall in Linux supports INT_MAX as the maximum in
> one request, which is also why the res field is sized the way it is. So
> you cannot transfer more than that anyway, hence it should not be an
> issue (at least specific to io_uring).
> 
>> Also what do you think about registering ring fds? Could it be
>> beneficial?
> 
> Definitely, it'll make the overhead a bit lower for issuing the
> IORING_OP_MSG_RING (it's been renamed ;-) request.
> 

I mean the case when sqe->len is used to transfer arbitrary data set by 
user. I believe IORING_OP_MSG_RING behavior for this edge case should be 
explicitly documented.

It looks like we have 3 options:
1) Copy sqe->len to cqe->result without any checks. Disadvantage: 
user-provided value may collide with EBADFD and EOVERFLOW.
2) Submit error CQE to the submitter ring.
3) Submit error CQE to the receiver ring (cqe->result will contain error 
code).

  reply	other threads:[~2022-03-10 16:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 23:49 Sending CQE to a different ring Artyom Pavlov
2022-03-10  1:36 ` Jens Axboe
2022-03-10  1:55   ` Jens Axboe
2022-03-10  2:33     ` Jens Axboe
2022-03-10  9:15       ` Chris Panayis
2022-03-10 13:53       ` Pavel Begunkov
2022-03-10 15:38         ` Jens Axboe
2022-03-10  2:11   ` Artyom Pavlov
2022-03-10  3:00     ` Jens Axboe
2022-03-10  3:48       ` Artyom Pavlov
2022-03-10  4:03         ` Jens Axboe
2022-03-10  4:14           ` Jens Axboe
2022-03-10 14:00             ` Artyom Pavlov
2022-03-10 15:36             ` Artyom Pavlov
2022-03-10 15:43               ` Jens Axboe
2022-03-10 15:46                 ` Jens Axboe
2022-03-10 15:52                   ` Artyom Pavlov
2022-03-10 15:57                     ` Jens Axboe
2022-03-10 16:07                       ` Artyom Pavlov
2022-03-10 16:12                         ` Jens Axboe
2022-03-10 16:22                           ` Artyom Pavlov [this message]
2022-03-10 16:25                             ` Jens Axboe
2022-03-10 16:28                               ` Artyom Pavlov
2022-03-10 16:30                                 ` Jens Axboe
2022-03-10 13:34       ` Pavel Begunkov
2022-03-10 13:43         ` Jens Axboe
2022-03-10 13:51           ` Pavel Begunkov
2022-03-10  3:06     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b9831d8-0597-9d17-e871-e964e257e8a7@gmail.com \
    --to=newpavlov@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.