From: sashiko-bot@kernel.org
To: "Puranjay Mohan" <puranjay@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [RFC PATCH bpf-next 6/6] selftests/bpf: Add XDP load-balancer benchmark run script
Date: Mon, 20 Apr 2026 17:36:22 +0000 [thread overview]
Message-ID: <20260420173622.B99B2C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260420111726.2118636-7-puranjay@kernel.org>
Sashiko AI review found 1 potential issue(s):
- [Medium] The script's error handling is bypassed by `set -e` if the benchmark tool fails.
--
commit 676755d117c703df4634ef7adbb680cae370c16a
Author: Puranjay Mohan <puranjay@kernel.org>
selftests/bpf: Add XDP load-balancer benchmark run script
This commit adds a convenience script to run all 24 XDP load-balancer
benchmark scenarios. It executes the benchmarks and formats the results
into a table displaying median, standard deviation, and percentiles.
> diff --git a/tools/testing/selftests/bpf/benchs/run_bench_xdp_lb.sh b/tools/testing/selftests/bpf/benchs/run_bench_xdp_lb.sh
> new file mode 100755
> index 0000000000000..1bde3898dfb63
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/benchs/run_bench_xdp_lb.sh
> @@ -0,0 +1,84 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +source ./benchs/run_common.sh
> +
> +set -eufo pipefail
[ ... ]
> +function run_scenario()
> +{
> + local sc="$1"
> + shift
> + local output rline
> +
> + output=$($RUN --scenario "$sc" "$@" 2>&1)
Will this assignment cause the entire script to abort immediately if the
benchmark tool fails?
Because set -e is enabled at the top of the script and output was declared
separately as a local variable on the previous line, this assignment
evaluates to the exact exit status of the command substitution. If the
benchmark tool returns a non-zero exit code (for example, due to an
unsupported XDP feature), the script will terminate right here.
This appears to bypass the intended error handling fallback below that prints
"ERR". Would appending || true to the assignment ensure the error handling
block can execute as intended?
> + rline=$(echo "$output" | grep '^RESULT ' || true)
> +
> + if [ -z "$rline" ]; then
> + printf "$ROW" "$sc" "ERR" "-" "-" "-" "-" "-" "-" "-"
> + return
> + fi
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260420111726.2118636-1-puranjay@kernel.org?part=6
next prev parent reply other threads:[~2026-04-20 17:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 11:17 [RFC PATCH bpf-next 0/6] selftests/bpf: Add XDP load-balancer benchmark Puranjay Mohan
2026-04-20 11:17 ` [RFC PATCH bpf-next 1/6] selftests/bpf: Add bench_force_done() for early benchmark completion Puranjay Mohan
2026-04-20 12:41 ` sashiko-bot
2026-04-20 15:32 ` Mykyta Yatsenko
2026-04-20 11:17 ` [RFC PATCH bpf-next 2/6] selftests/bpf: Add BPF batch-timing library Puranjay Mohan
2026-04-20 13:18 ` sashiko-bot
2026-04-22 1:10 ` Alexei Starovoitov
2026-04-20 11:17 ` [RFC PATCH bpf-next 3/6] selftests/bpf: Add XDP load-balancer common definitions Puranjay Mohan
2026-04-20 13:26 ` sashiko-bot
2026-04-20 11:17 ` [RFC PATCH bpf-next 4/6] selftests/bpf: Add XDP load-balancer BPF program Puranjay Mohan
2026-04-20 13:57 ` sashiko-bot
2026-04-20 11:17 ` [RFC PATCH bpf-next 5/6] selftests/bpf: Add XDP load-balancer benchmark driver Puranjay Mohan
2026-04-20 17:11 ` sashiko-bot
2026-04-20 11:17 ` [RFC PATCH bpf-next 6/6] selftests/bpf: Add XDP load-balancer benchmark run script Puranjay Mohan
2026-04-20 17:36 ` sashiko-bot [this message]
2026-04-22 1:16 ` [RFC PATCH bpf-next 0/6] selftests/bpf: Add XDP load-balancer benchmark Alexei Starovoitov
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=20260420173622.B99B2C19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=puranjay@kernel.org \
--cc=sashiko@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