public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Artyom Pavlov <[email protected]>, [email protected]
Subject: Re: Sending CQE to a different ring
Date: Thu, 10 Mar 2022 09:30:02 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 3/10/22 9:28 AM, Artyom Pavlov wrote:
>>> 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).
>>
>> #1 should not be an issue, as cqe->result for those values is the
>> original ring result code, not the target ring.
>>
>> I'd say the application should just case it to u32 and intepret it like
>> that, if it's worried about the signed nature of it?
> 
> Ah, indeed. I've missed that EBADFD and EOVERFLOW errors only can
> happen in the submitter ring, so the receiver ring can always
> interpret CQE with the IORING_CQE_F_MSG flag as a successfully
> received message from another ring.

Yes, so I don't think there's any confusion there. I did just make the
prep helper in liburing take an unsigned, and I did test that we don't
have any issues on that front.

Posted v2, passes testing too. I actually think this is quite a nifty
feature, and can be used quite flexibly to communicate between rings.

-- 
Jens Axboe


  reply	other threads:[~2022-03-10 16:30 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
2022-03-10 16:25                             ` Jens Axboe
2022-03-10 16:28                               ` Artyom Pavlov
2022-03-10 16:30                                 ` Jens Axboe [this message]
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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox