public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH liburing v3 1/1] tests: test io_uring bpf ops
Date: Wed, 18 Mar 2026 12:24:45 -0600	[thread overview]
Message-ID: <3c00370f-81b0-41d1-8deb-beb1781a75bd@kernel.dk> (raw)
In-Reply-To: <6b9ef71d-118c-46c1-8f33-56145ddd8664@gmail.com>

On 3/18/26 11:43 AM, Pavel Begunkov wrote:
> On 3/18/26 17:36, Pavel Begunkov wrote:
>> Add some BPF struct ops io_uring tests/examples, one is issuing nops in
>> a loop, the other copies a file.
> 
> I needed to conditionally compile based on whether vmlinux.h contains
> io_uring BPF definitions, so now configure probes it by generating a
> temp vmlinux.h. And since I want to be able to pass a path to the
> target vmlinux, it also became a configure parameter. Not sure if there
> is a better way to handle that.

Looks good to me. The configure changes are a bit broken though, you'd
need something like this on top to not have it fail:

diff --git a/configure b/configure
index 3a08e0f12448..7aea26fa7681 100755
--- a/configure
+++ b/configure
@@ -500,15 +500,15 @@ print_config "has_bpftool" "$has_bpftool"
 print_config "has_bpf_clang" "$has_bpf_clang"
 print_config "has_libbpf" "$has_libbpf"
 
-if test $vmlinux == ""; then
+if test -z "$vmlinux"; then
   vmlinux="/sys/kernel/btf/vmlinux"
 else
-  vmlinux=$(realpath $vmlinux)
+  vmlinux=$(realpath "$vmlinux")
 fi
 print_and_output_mak bpf_vmlinux_path $vmlinux
 
 has_bpf_loop_ops="no"
-if test "$has_bpftool" == "yes" && test "$has_bpf_clang" == yes && test "$has_libbpf" == yes; then
+if test "$has_bpftool" = "yes" && test "$has_bpf_clang" = "yes" && test "$has_libbpf" = "yes"; then
   if bpftool btf dump file $vmlinux format c 2>&1 | grep -qF bpf_io_uring_submit_sqes; then
       has_bpf_loop_ops="yes"
       output_sym "CONFIG_HAVE_BPF_LOOP_OPS"

With that, it does detect it fine here. However, it ends in misery with:

axboe@m2max ~/gi/liburing (master)> make                                        6.490s
make[1]: Entering directory '/home/axboe/git/liburing/src'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/axboe/git/liburing/src'
make[1]: Entering directory '/home/axboe/git/liburing/test'
mkdir -p output/bpf
     CC output/bpf/nops.bpf.o
In file included from bpf-progs/nops.bpf.c:3:
/usr/include/bpf/bpf_helpers.h:318:12: error: conflicting types
      for 'bpf_stream_vprintk'
  318 | extern int bpf_stream_vprintk(int stream_id, const char *fmt__str, const void *args,
      |            ^
output/bpf/vmlinux.h:170697:12: note: previous declaration is
      here
 170697 | extern int bpf_stream_vprintk(int stream_id, const char *fmt__str, const void ...
        |            ^
1 error generated.
make[1]: *** [Makefile:379: output/bpf/nops.bpf.o] Error 1
make[1]: Leaving directory '/home/axboe/git/liburing/test'
make: *** [Makefile:11: all] Error 2


-- 
Jens Axboe

  reply	other threads:[~2026-03-18 18:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 17:36 [PATCH liburing v3 1/1] tests: test io_uring bpf ops Pavel Begunkov
2026-03-18 17:43 ` Pavel Begunkov
2026-03-18 18:24   ` Jens Axboe [this message]
2026-03-18 18:28     ` Jens Axboe
2026-03-18 20:57     ` Pavel Begunkov
2026-03-18 20:59 ` Pavel Begunkov
2026-03-18 21:01 ` Pavel Begunkov

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=3c00370f-81b0-41d1-8deb-beb1781a75bd@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --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