From: netdev-bot+sashiko@kernel.org
To: maciej.fijalkowski@intel.com
Cc: netdev@vger.kernel.org, magnus.karlsson@intel.com,
stfomichev@gmail.com, kuba@kernel.org, pabeni@redhat.com,
tushar.vyavahare@intel.com, kerneljasonxing@gmail.com,
bjorn@kernel.org
Subject: Re: [PATCH v6 net-next 06/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup
Date: Sat, 28 Nov 2026 15:08:38 +0000 [thread overview]
Message-ID: <179587851820.3135.3520054893170043796@kernel.org> (raw)
In-Reply-To: <20261127150527.1122049-7-maciej.fijalkowski@intel.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] xskxceiver now exits with a different status on several setup
failures, and the commit message does not say so.
--
selftests: xsk: split xskxceiver main() into setup, run and cleanup
This patch splits xskxceiver main() into bind_iface(), detect_mode_caps(),
mode_supported() and cleanup_iface(). It also makes run_pkt_test() return
its result, so that main() has a single exit path. ksft_print_header() is
now called right after option parsing, and -l exits with 0 without a TAP
header.
> diff --git a/tools/testing/selftests/net/lib/xsk/xskxceiver.c b/tools/testing/selftests/net/lib/xsk/xskxceiver.c
> index d82224a4fa4b0..97eece4c57f89 100644
> --- a/tools/testing/selftests/net/lib/xsk/xskxceiver.c
> +++ b/tools/testing/selftests/net/lib/xsk/xskxceiver.c
[ ... ]
> @@ -185,17 +183,40 @@ static void print_usage(char **argv)
> ksft_exit_xfail();
> }
>
> -static bool validate_interface(struct ifobject *ifobj)
> +static void bind_iface(struct ifobject *ifobj, const char *ifname, thread_func_t func,
> + char **argv)
> {
> - if (!strcmp(ifobj->ifname, ""))
> - return false;
> - return true;
> + size_t len = ifname ? strlen(ifname) : 0;
> +
> + if (!len || len >= sizeof(ifobj->ifname))
> + print_usage(argv);
> +
> + memcpy(ifobj->ifname, ifname, len + 1);
> + ifobj->ifindex = if_nametoindex(ifobj->ifname);
> + if (!ifobj->ifindex) {
> + ksft_print_msg("Error: cannot resolve interface %s\n", ifobj->ifname);
> + ksft_exit_fail();
> + }
> +
> + if (init_iface(ifobj, func)) {
> + ksft_print_msg("Error: cannot initialize interface %s\n", ifobj->ifname);
> + ksft_exit_fail();
> + }
> +}
[Severity: Low]
This isn't a bug, but should the commit message mention that the exit
status changes here?
Before this patch, two setup failures exited with KSFT_XFAIL (2):
- an -i name that if_nametoindex() could not resolve went through
exit_with_error(errno), which ends in ksft_exit_xfail()
- an init_iface() failure printed "Error : can't initialize interfaces"
and then called ksft_exit_xfail()
bind_iface() now sends both through ksft_exit_fail(), which exits with 1.
A failed pkt_stream_generate() in main() changes the same way. It used to
call exit_with_error(ENOMEM), and now it does this:
if (!test.tx_pkt_stream_default || !test.rx_pkt_stream_default)
goto out;
...
if (ret)
ksft_exit_fail();
ret is still TEST_FAILURE at that point, so this path also exits with 1.
The interface name handling changed too. The old parse_command_line()
copied min(MAX_INTERFACE_NAME_CHARS, strlen(optarg)) bytes into the 16 byte
ifname[]. A name of 16 or more characters was therefore left without a NUL
terminator. bind_iface() now rejects such a name through print_usage().
The commit message calls this a split of main():
Prepare xskxceiver for one endpoint per process by splitting main():
The only exit status change it mentions is:
-l prints no TAP header and exits with 0.
At this commit, xsk_prereqs.sh test_status() prints [ FAIL ] for status 1
and nothing for status 2. Its summary counts any non-zero status as a
failure, so the overall test_xsk.sh verdict stays the same.
Those scripts are removed in the next patch, "selftests: xsk: run one test
case per xskxceiver invocation". The new exit codes remain until the end
of the series, and no later commit message mentions them.
Could the commit message add a sentence about the new exit codes and the
name length check?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261127150527.1122049-1-maciej.fijalkowski%40intel.com
next prev parent reply other threads:[~2026-11-28 15:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 15:05 [PATCH v6 net-next 00/15] selftests: net: adjust xskxceiver to drv-net Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 01/15] selftests: xsk: fix the stack overrun in is_adjust_tail_supported() Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 02/15] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 03/15] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 04/15] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 05/15] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 06/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-11-28 15:08 ` netdev-bot+sashiko [this message]
2026-11-27 15:05 ` [PATCH v6 net-next 07/15] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 08/15] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 09/15] selftests: xsk: send UDP over IPv4 or IPv6 between the interface MACs Maciej Fijalkowski
2026-11-28 15:08 ` netdev-bot+sashiko
2026-11-27 15:05 ` [PATCH v6 net-next 10/15] selftests: xsk: prepare xskxceiver for endpoints on two hosts Maciej Fijalkowski
2026-11-28 15:08 ` netdev-bot+sashiko
2026-11-27 15:05 ` [PATCH v6 net-next 11/15] selftests: xsk: wait up to --timeout for the RX stats and a busy bind Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 12/15] selftests: xsk: list the endpoint roles of the test cases Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 13/15] selftests: drv-net: rename nsim_test to sw_test Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 14/15] selftests: drv-net: decouple local link setup from netdevsim Maciej Fijalkowski
2026-11-27 15:05 ` [PATCH v6 net-next 15/15] selftests: drv-net: run the AF_XDP tests over veth or a NIC Maciej Fijalkowski
2026-11-28 15:08 ` netdev-bot+sashiko
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=179587851820.3135.3520054893170043796@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=bjorn@kernel.org \
--cc=kerneljasonxing@gmail.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stfomichev@gmail.com \
--cc=tushar.vyavahare@intel.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