Article View: linux.kernel.netdev
Article #23913Re: [PATCH v6 net-next 06/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 15:08
Date: Sat, 28 Nov 2026 15:08
106 lines
11687 bytes
11687 bytes
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
Technical Details
Message-ID:
<179587851820.3135.3520054893170043796@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373180-linux-kernel-netdev=dewy.ruReferences:
<20261127150527.1122049-7-maciej.fijalkowski@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373180-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179587851820.3135.3520054893170043796@kernel.org> References: <20261127150527.1122049-7-maciej.fijalkowski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="972447"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:6UA13AjTzon3s2XOAFM+XKqfuOc= sha256:5WTKIk+yovVCDnjykzJnJsZysSIsECh5ONxkVOGji60= sha1:7dI0wBaydMkhgP95ZIJ1L2k0EgQ= sha256:TLHesZZj1oYQbpez+zydS8ihmZwFoByeBDkXZxv+LSA= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 968E8125F83; Sat, 28 Nov 2026 18:08:59 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aUv0FZ97RkXu; Sat, 28 Nov 2026 18:08:55 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373180-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id A7B99125F80; Sat, 28 Nov 2026 18:08:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 5C42A282B5; Sat, 28 Nov 2026 15:08:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795878520; b=XzSQzK+nHRemmzSKReGpK6RTnZt+bkcQofY8Gv1VmuGDHtkYPE3m5y0F0P7jfh2wufP9 y+knUuaMjUDHI0s4nAHdATU1fNieJ8S7cmybLVD1GuDl6UXiZ+mzzOVpPTRrW362Vd//R thcj19Oumug6itFQAVH2OvG43kwzhA0bnkDUn8A61hxIbKhMoWGcEmO7pPY6xqJzf5kP8 updcXJ0Utzb27/TuwnNEZHGz83MaqiilE8d8mbAfM9GTsMBU8PqBWwTsYp2Fd2+nlEqiU jcnYK76nccv+48JsIGakSQaOhyK7rMLlI8cDDnYcKruh/wZr4Qfp+Jihvnky/tKPL9w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795878520; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=KByFkq80/W8HwWeYva3/faNNZPdr67a+Zot4Kn/R/l0=; b=GYpjtaOM2jCk2I3uXIA9pcCm4IYd6NnGXP/geiw8Fm0XIotbx1+ElSfU4/ygHfiJ7L9C 2UQxIEN+9LpGdBlcYbCloO13m4bF+gotOmDg5LJyMvRRGeWLx4uhZV3+qBus2ZsHjEN9N eK2nE7v6xEPhrIGFlUd3//8F24Wal5l2gjxMfhxhCiMGCzO5taaviol/uJedzK4Z9tTqV k5VWKoPtHPkhYFwf9QiZpAwZzMd4pwe+BjpESBBQlp8oTeLpV5oewpnLg9whu0PzzPyym BCFCm1NnAZ9KX4WjRQ7OAD2dP7i2FzlVdk5Rz183un6h5RJN8oBQexrNcJhO0UMOUXg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AwkaxziH; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 316E8606A326; Sat, 28 Nov 2026 15:08:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AwkaxziH X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795878519; b=LdYpCWMXy456Z1Wt+lu1z3tz1cwTAEfXo6nnkpy9X7yRlqfhUfVBK0KO5D1YcJYp1Eoi WmVrmdPI/s8y+5HQmNLj3C16uUPvpDSrDIpWqQsnLzG447DSd27s5MduCCgaDrluxPr+U HJztSeCaEyyDOpsmU1tFgKLZ88rwK9NPkEdhOEyH5C9gXf6r4NO65qdWtnY/u2rl/ld/A J1cuRIZFkNoFpQUQ3g9X4pw2psoGJwPvxE27DFQGew7FNcFnmVUcg9vIkFQLC0iXz+xll 62FZLld+GMNThJ1PoFmm+eTzy3d/G4xjN9MFdhr6NV32DOYnQryksG38Sgd099Ustcw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795878519; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=KByFkq80/W8HwWeYva3/faNNZPdr67a+Zot4Kn/R/l0=; b=RHZr+T6wtNaBZxGiJULFtPAT3HKw4iNKzleU/vh4SnWIwMKr4W1fiN6oHM5ATai35UB3 27bL4wqdzwxtjPmGEmYdrayr+IUXd6nvzHvD2cgbMaEZiFyidVsBx0jbUJpslDoe9TGkb GXIwftWpuvHAUMfrNLno01tm7IEM7RHpBh3UcSP7b9fV8856mK49q641vI5BHpqY9l8tT 4S4SXkg/gXnGiYDL8vqcHJV55mdvn/dRC8j3IjOb6sTtnx1H4RlwEnXSsJ8nuKuN8DL54 tMCzQUEap8VcFVqfLXE34KyJZYAm4L0yqegUhaad9thOD3/2enxsU4ZvHlgsvmjScSQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AwkaxziH; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EEFA606A31C for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 15:08:39 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9A041F000C1; Sat, 28 Nov 2026 15:08:38 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795878519; bh=KByFkq80/W8HwWeYva3/faNNZPdr67a+Zot4Kn/R/l0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=AwkaxziHvIFMwMgYXTW79Qmv0W6HjWWINKVpoBxUa3d0FUd3P8RJZsV+Op0JKgq+J relQXv9qytgguV1y0N4rRR21A/WvcRdZe/yxTRUehE1Ixp+HkUcXC1wgB5UmKey7ll U8nacvPoGQpzzVSvgClSTSn9ebnMize4VN5bFiAlO8jzlwnMVcve9zHIGDr9X+FkgS mIlArksFhelFmrYWpKzmnMcVIlEC0MgqOj2Tcx2LrLTmjCzePkXfPREEsQVsBpDttM cxY0fE0MbCdoh/EJUSY7w9NbZqX57esg38zKf6TRpIKXt0wfhHSn55SVuYzl6GYOdW ZBYaGdr7GHTZQ== X-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 X-In-Reply-To: <20261127150527.1122049-7-maciej.fijalkowski@intel.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list