From: sashiko-bot@kernel.org
To: "Cong Wang" <xiyou.wangcong@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [RFC PATCH bpf-next 5/5] selftests/bpf: set SO_BUSY_POLL from the tcp_splice sockops prog
Date: Fri, 12 Jun 2026 01:26:13 +0000 [thread overview]
Message-ID: <20260612012614.1AD3D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260612011452.134466-6-xiyou.wangcong@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The BPF global variable `busy_poll_us` is never initialized by the userspace test runner, rendering the newly added `SO_BUSY_POLL` test logic unreachable dead code.
- [Low] Multi-line comment does not follow BPF subsystem guidelines.
--
commit c9396935bece9a3118a940f3f318b60c9109d778
Author: Cong Wang <xiyou.wangcong@gmail.com>
selftests/bpf: set SO_BUSY_POLL from the tcp_splice sockops prog
Set SO_BUSY_POLL (busy_poll_us) on each paired socket via
bpf_setsockopt() so the splice receiver busy-polls the ring instead of
parking - without net.core.busy_read or an application setsockopt.
> diff --git a/tools/testing/selftests/bpf/progs/test_tcp_splice.c b/tools/testing/selftests/bpf/progs/test_tcp_splice.c
> index 09c7f0f9e3110..da43f00046c0f 100644
> --- a/tools/testing/selftests/bpf/progs/test_tcp_splice.c
> +++ b/tools/testing/selftests/bpf/progs/test_tcp_splice.c
[ ... ]
> @@ -71,6 +80,21 @@ int sockops_splice(struct bpf_sock_ops *skops)
> if (skops->family != 2 /* AF_INET */)
> return 0;
>
> + /* Enable busy-poll on this socket. Both endpoints run this callback,
> + * so each sets its own socket; this must happen here, before the
[Severity: Low]
This isn't a bug, but the BPF subsystem multi-line comment style requires
the opening /* to be on its own line. Should this be updated to match the
modern kernel comment style?
> + * peer-not-found early return below, because pairing is asymmetric -
> + * only the second side to establish finds a peer and calls
> + * bpf_sock_splice_pair. Setting it only on the pairing side would
> + * leave the other side without busy-poll. bpf_setsockopt acts on
> + * skops->sk only - there is no variant to set the peer - but the peer
> + * sets itself when its own ESTABLISHED callback fires.
> + */
> + if (busy_poll_us) {
> + int us = busy_poll_us;
> +
> + bpf_setsockopt(skops, SOL_SOCKET, SO_BUSY_POLL, &us, sizeof(us));
> + }
[Severity: Medium]
Is the global variable busy_poll_us ever initialized by the userspace test
runner?
Since BPF .bss variables are zero-initialized by default, it appears that
skel->bss->busy_poll_us is never assigned a value in the userspace setup
code (like prog_tests/tcp_splice.c). Does this mean the if (busy_poll_us)
condition will always evaluate to false, leaving the new SO_BUSY_POLL logic
unreachable and untested?
> +
> mk_key(skops, &self_key, 0);
> mk_key(skops, &peer_key, 1);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260612011452.134466-1-xiyou.wangcong@gmail.com?part=5
next prev parent reply other threads:[~2026-06-12 1:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 1:14 [RFC PATCH bpf-next 0/5] tcp: opportunistic loopback splice for BPF-paired sockets Cong Wang
2026-06-12 1:14 ` [RFC PATCH bpf-next 1/5] tcp_bpf: add bpf_sock_splice_pair kfunc for opportunistic loopback splice Cong Wang
2026-06-12 1:33 ` sashiko-bot
2026-06-12 2:10 ` bot+bpf-ci
2026-06-12 1:14 ` [RFC PATCH bpf-next 2/5] tcp_bpf: busy-poll the splice ring before parking the receiver Cong Wang
2026-06-12 3:29 ` sashiko-bot
2026-06-12 1:14 ` [RFC PATCH bpf-next 3/5] selftests/bpf: add tcp_splice basic round-trip test Cong Wang
2026-06-12 1:28 ` sashiko-bot
2026-06-12 1:14 ` [RFC PATCH bpf-next 4/5] bpf: allow SO_BUSY_POLL in bpf_setsockopt() Cong Wang
2026-06-12 1:14 ` [RFC PATCH bpf-next 5/5] selftests/bpf: set SO_BUSY_POLL from the tcp_splice sockops prog Cong Wang
2026-06-12 1:26 ` sashiko-bot [this message]
2026-06-12 16:01 ` [RFC PATCH bpf-next 0/5] tcp: opportunistic loopback splice for BPF-paired sockets Alexei Starovoitov
2026-06-12 18:12 ` Cong Wang
2026-06-12 18:34 ` Alexei Starovoitov
2026-06-12 20:17 ` Cong Wang
2026-06-13 17:57 ` Jakub Kicinski
2026-06-13 21:25 ` Cong Wang
2026-06-12 22:10 ` [syzbot ci] " syzbot ci
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=20260612012614.1AD3D1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=xiyou.wangcong@gmail.com \
/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