BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Anil Kaushik" <anilkaushikwireless@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [RFC bpf-next] selftests/bpf: Test XDP LRU hash rolling-window map updates
Date: Thu, 17 Sep 2026 14:02:44 +0000	[thread overview]
Message-ID: <20260917140245.574A21F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260917135433.2260048-1-anilkaushikwireless@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] bpf: unnecessary FD validation for skeleton-generated fields
--

commit 382196b03e5bc2ae66b47677cc5a9357a9560542
Author: Anil Kaushik <anilkaushikwireless@gmail.com>

selftests/bpf: Test XDP LRU hash rolling-window map updates

This commit adds a small XDP program that writes packet lengths into
BPF_MAP_TYPE_LRU_HASH at seq % AGGREGATION_WINDOW. It also adds a test_progs
case using bpf_prog_test_run to check wrap, parse-fail isolation, and 5-tuple
isolation.

> diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_lru_window.c b/tools/testing/selftests/bpf/prog_tests/xdp_lru_window.c
> new file mode 100644
> index 0000000000000..fffbb4a0418ef
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/xdp_lru_window.c
[ ... ]
> +void test_xdp_lru_window(void)
> +{
> +	skel = xdp_lru_window__open_and_load();
> +	if (!ASSERT_OK_PTR(skel, "open_and_load"))
> +		return;
> +
> +	prog_fd = bpf_program__fd(skel->progs.xdp_lru_window);
> +	map_fd = bpf_map__fd(skel->maps.flow_table);
> +	if (!ASSERT_GE(prog_fd, 0, "prog_fd") ||
> +	    !ASSERT_GE(map_fd, 0, "map_fd"))
> +		goto out;

[Severity: Low]
Are these ASSERT_GE() checks necessary in test_xdp_lru_window()?

Since the skeleton is successfully initialized with
xdp_lru_window__open_and_load(), the BPF selftest skeleton framework
guarantees that all generated map and program fields contain valid file
descriptors.

Validating prog_fd and map_fd manually here appears redundant and contrary
to the established skeleton API contract. Could we remove this check?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260917135433.2260048-1-anilkaushikwireless@gmail.com?part=1

      reply	other threads:[~2026-09-17 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 13:54 [RFC bpf-next] selftests/bpf: Test XDP LRU hash rolling-window map updates Anil Kaushik
2026-09-17 14:02 ` sashiko-bot [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=20260917140245.574A21F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=anilkaushikwireless@gmail.com \
    --cc=bpf@vger.kernel.org \
    --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