From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH] io_uring: support to inject result for NOP
Date: Fri, 10 May 2024 11:07:51 +0800 [thread overview]
Message-ID: <Zj2Ph2tzYb7jrNsZ@fedora> (raw)
In-Reply-To: <a9cdda78-99f5-4546-863f-8f17f278610f@kernel.dk>
On Thu, May 09, 2024 at 08:19:40PM -0600, Jens Axboe wrote:
> On 5/9/24 7:14 PM, Ming Lei wrote:
> > Support to inject result for NOP so that we can inject failure from
> > userspace. It is very helpful for covering failure handling code in
> > io_uring core change.
> >
> > With nop flags, it could be possible to add more test feature for NOP in
> > future, but the NOP behavior of direct completion has to be kept.
> >
> > Cleared NOP SQE is required, look both liburing and Rust io-uring crate
> > clears SQE, and it shouldn't be one big deal for raw, especially it is
> > just NOP.
>
> I think this implementation looks fine, but probably would be best if
> you first had a prep patch that adds nop_flags to io_uring_sqe, and
> checks it in io_nop_prep() and fails if it's non-zero. Then we can mark
> that for stable, rather than need to do the whole thing.
>
> Then patch 2 adds the actual meat of this patch, and now adds the proper
> check in io_nop_prep() for whether any unknown flags are set.
>
> > diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
> > index 922f29b07ccc..5db3a209b302 100644
> > --- a/include/uapi/linux/io_uring.h
> > +++ b/include/uapi/linux/io_uring.h
> > @@ -48,7 +48,10 @@ struct io_uring_sqe {
> > __u32 optname;
> > };
> > };
> > - __u32 len; /* buffer size or number of iovecs */
> > + union {
> > + __u32 len; /* buffer size or number of iovecs */
> > + __s32 result; /* for NOP to inject result only */
> > + };
> > union {
>
> And I'd drop that, just use 'len' throughout.
>
> Rest of the patch looks fine as-is.
OK, will do both two in V2.
Thanks,
Ming
prev parent reply other threads:[~2024-05-10 3:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 1:14 [PATCH] io_uring: support to inject result for NOP Ming Lei
2024-05-10 2:19 ` Jens Axboe
2024-05-10 3:07 ` Ming Lei [this message]
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=Zj2Ph2tzYb7jrNsZ@fedora \
--to=ming.lei@redhat.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.