BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jiayuan Chen" <jiayuan.chen@linux.dev>, bpf@vger.kernel.org
Subject: Re: [PATCH bpf 02/11] selftests/bpf: Add test for unread SK_PASS data with strparser
Date: Sat, 21 Nov 2026 10:59:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-226964@kernel.org> (raw)
In-Reply-To: <20261121103222.88209-3-jiayuan.chen@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/bpf: unbounded FIONREAD polling loop in
  sockmap_strp_wait_fionread()
--

commit 7dc8918154820719ad134eef16ba69d4d7e96153
Author: Jiayuan Chen <jiayuan.chen@linux.dev>

selftests/bpf: Add test for unread SK_PASS data with strparser

This commit adds IPv4 and IPv6 sockmap strparser subtests verifying that
unread SK_PASS data across multiple parser invocations does not stall
subsequent packet delivery.

> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_strp.c b/tools/testing/selftests/bpf/prog_tests/sockmap_strp.c
> index 1d7231728eafd..18eb0c791e492 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_strp.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_strp.c
> @@ -364,6 +364,88 @@ static void test_sockmap_strp_pass(int family, int sotype, bool fionread)
>  	test_sockmap_strp__destroy(strp);
>  }
>  
> +static int sockmap_strp_wait_fionread(int fd, int expected)
> +{
> +	int err, avail = 0;
> +
> +	while (1) {
> +		err = ioctl(fd, FIONREAD, &avail);
> +		if (!ASSERT_OK(err, "ioctl(FIONREAD) error"))
> +			return -1;
> +		if (avail >= expected)
> +			break;
> +		usleep(10000);
> +	}
> +	return ASSERT_EQ(avail, expected, "ioctl(FIONREAD)") ? 0 : -1;
> +}

[Severity: Low]
Can sockmap_strp_wait_fionread() hang test_progs forever if a regression
prevents the expected bytes from arriving?  Without a timeout or retry
bound on the loop, avail < expected spins indefinitely instead of exiting
and failing the ASSERT_EQ() check.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261121103222.88209-1-jiayuan.chen@linux.dev?part=2

  reply	other threads:[~2026-11-21 10:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 10:30 [PATCH bpf 00/11] fix misc sockmap issues Jiayuan Chen
2026-11-21 10:30 ` [PATCH bpf 01/11] bpf, sockmap: Fix copied_seq updates with strparser Jiayuan Chen
2026-11-21 10:59   ` sashiko-bot
2026-11-21 10:30 ` [PATCH bpf 02/11] selftests/bpf: Add test for unread SK_PASS data " Jiayuan Chen
2026-11-21 10:59   ` sashiko-bot [this message]
2026-11-21 10:30 ` [PATCH bpf 03/11] bpf, sockmap: Fix strparser reinit after the parser link is removed Jiayuan Chen
2026-11-21 11:04   ` sashiko-bot
2026-11-21 10:30 ` [PATCH bpf 04/11] bpf, sockmap: Fix empty sk_msg queued by ingress redirect Jiayuan Chen
2026-11-21 10:30 ` [PATCH bpf 05/11] bpf, sockmap: Fix concurrent senders on one psock Jiayuan Chen
2026-11-21 10:53   ` sashiko-bot
2026-11-21 10:30 ` [PATCH bpf 06/11] bpf, sockmap: Fix reconnect with a psock by rejecting disconnect Jiayuan Chen
2026-11-21 10:30 ` [PATCH bpf 07/11] bpf, sockmap: Fix psock refcnt taken in sk_psock_backlog() Jiayuan Chen
2026-11-21 10:30 ` [PATCH bpf 08/11] bpf, sockmap: Fix socket lock taken on a child before accept() Jiayuan Chen
2026-11-21 10:56   ` sashiko-bot
2026-11-21 10:30 ` [PATCH bpf 09/11] bpf, sockmap: Fix apply_bytes when a redirect sends only a part Jiayuan Chen
2026-11-21 11:11   ` bot+bpf-ci
2026-11-21 10:30 ` [PATCH bpf 10/11] selftests/bpf: Fix errno expected by the wait send mem test of test_sockmap Jiayuan Chen
2026-11-21 10:30 ` [PATCH bpf 11/11] selftests/bpf: Add test for apply_bytes when a redirect sends a part Jiayuan Chen

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=sashiko-outbox-226964@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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