From: Pavel Begunkov <asml.silence@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: io-uring <io-uring@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH v4 6/6] selftests/io_uring: add a bpf io_uring selftest
Date: Tue, 27 Jan 2026 19:20:38 +0000 [thread overview]
Message-ID: <8b2cee27-e6ac-42fa-bf9a-38a1af39b0dd@gmail.com> (raw)
In-Reply-To: <CAADnVQ+w1OEm7gFb04u6V=5LVw6VefNr_V2FuczBjtaOioH=Cw@mail.gmail.com>
On 1/27/26 18:53, Alexei Starovoitov wrote:
> On Tue, Jan 27, 2026 at 10:42 AM Pavel Begunkov <asml.silence@gmail.com> wrote:
>>
>> On 1/27/26 17:32, Alexei Starovoitov wrote:
>>> On Tue, Jan 27, 2026 at 2:15 AM Pavel Begunkov <asml.silence@gmail.com> wrote:
>>>>
>>>> index 000000000000..7a170cb2f388
>>>> --- /dev/null
>>>> +++ b/tools/testing/selftests/io_uring/types.bpf.h
>>>> @@ -0,0 +1,131 @@
>>>> +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
>>>> +#include <linux/types.h>
>>>> +#include <bpf/bpf_helpers.h>
>>>> +
>>>> +struct io_ring_ctx {
>>>> +};
>>>> +
>>>> +struct io_uring_sqe {
>>>> + __u8 opcode; /* type of operation for this sqe */
>>>> + __u8 flags; /* IOSQE_ flags */
>>>> + __u16 ioprio; /* ioprio for the request */
>>>> + __s32 fd; /* file descriptor to do IO on */
>>>
>>> 1.
>>> No need to copy paste. Just include vmlinux.h. It's there.
>>>
>>> 2.
>>> drop KF_TRUSTED_ARGS from kfunc. It's a default now and this flag
>>> was removed.
>>
>> Got it, will change both, thanks
>>
>>> 3.
>>> add a runtime logic to check that the return value is either IOU_LOOP_CONTINUE
>>> or IOU_LOOP_STOP or instruct the verifier do it statically.
>>> Otherwise it will be less convenient to extend to other commands,
>>> since the way I read it IOU_LOOP_CONTINUE == 0 aliases to any value > 1.
>>
>> Is there a struct_ops hook that can help with that? check_return_code()
>> has some hard-coded checks, but I can't find anything customizable for
>> struct_ops.
>
> yep. check_return_code() is the one and you're correct. It's not
> customizable atm. Much simpler to do a runtime check for now and
> improve through the verifier support later.
Makes sense, thanks!
--
Pavel Begunkov
prev parent reply other threads:[~2026-01-27 19:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 10:14 [PATCH v4 0/6] BPF controlled io_uring Pavel Begunkov
2026-01-27 10:14 ` [PATCH v4 1/6] io_uring: introduce callback driven main loop Pavel Begunkov
2026-01-27 10:14 ` [PATCH v4 2/6] io_uring/bpf-ops: add basic bpf struct_ops boilerplate Pavel Begunkov
2026-01-27 10:14 ` [PATCH v4 3/6] io_uring/bpf-ops: add loop_step struct_ops callback Pavel Begunkov
2026-01-27 10:14 ` [PATCH v4 4/6] io_uring/bpf-ops: add kfunc helpers Pavel Begunkov
2026-01-27 10:14 ` [PATCH v4 5/6] io_uring/bpf-ops: add bpf struct ops registration Pavel Begunkov
2026-01-27 10:14 ` [PATCH v4 6/6] selftests/io_uring: add a bpf io_uring selftest Pavel Begunkov
2026-01-27 17:32 ` Alexei Starovoitov
2026-01-27 18:42 ` Pavel Begunkov
2026-01-27 18:53 ` Alexei Starovoitov
2026-01-27 19:20 ` Pavel Begunkov [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=8b2cee27-e6ac-42fa-bf9a-38a1af39b0dd@gmail.com \
--to=asml.silence@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox