🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13996

Re: [PATCH net 1/2] selftests: drv-net: ring_reconfig: handle devices without channel config

#13996
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 15:27
91 lines
11547 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] _configure_min_ring_cnt() in
  tools/testing/selftests/drivers/net/ring_reconfig.py now catches…

--

selftests: drv-net: ring_reconfig: handle devices without channel config

This patch handles drivers that don't implement get_channels (e.g. e1000e)
in ring_reconfig.py. When channels_get returns EOPNOTSUPP, channels() is
now skipped and _configure_min_ring_cnt() returns early. Other netlink
errors are still reported as failures.

> diff --git a/tools/testing/selftests/drivers/net/ring_reconfig.py b/tools/testing/selftests/drivers/net/ring_reconfig.py
> index 6682d4badfbfc..baac20e8d3eba 100755
> --- a/tools/testing/selftests/drivers/net/ring_reconfig.py
> +++ b/tools/testing/selftests/drivers/net/ring_reconfig.py

[ ... ]

> @@ -88,7 +99,14 @@ def channels(cfg) -> None:
>  def _configure_min_ring_cnt(cfg) -> None:
>      """ Try to configure a single Rx/Tx ring. """
>      ehdr = {'header':{'dev-index': cfg.ifindex}}
> -    chans = cfg.eth.channels_get(ehdr)
> +    try:
> +        chans = cfg.eth.channels_get(ehdr)
> +    except NlError as e:
> +        # Reducing the channel count is only an optimization
> +        if e.error == errno.EOPNOTSUPP:
> +            ksft_pr("Channel configuration unsupported; continuing ring test")
> +            return
> +        raise

[Severity: Medium]
This catches EOPNOTSUPP from channels_get, but what about drivers that
implement get_channels but not set_channels? Further down in
_configure_min_ring_cnt() the set call is still unguarded:

    if chans.get('combined-count', 0) > 1:
        config['combined-count'] = 1
    elif chans.get('rx-count', 0) > 1 and chans.get('tx-count', 0) > 1:
        ...

    cfg.eth.channels_set(ehdr | config)
    defer(cfg.eth.channels_set, ehdr | restore)

On the kernel side, CHANNELS_SET is rejected unless both ops are present:

net/ethtool/channels.c:ethnl_set_channels_validate() {
    ...
	return ops->get_channels && ops->set_channels ? 1 : -EOPNOTSUPP;
}

vmxnet3 is one in-tree example. Its ethtool ops set only
.get_channels = vmxnet3_get_channels, and in MSI-X buddy-share mode
vmxnet3_get_channels() reports combined_count = num_tx_queues, which can
be greater than 1.

On such a device channels_get succeeds, so the new early return never
runs. channels_set then raises NlError(95), which propagates out of
_configure_min_ring_cnt() and ringparam(). That means ringparam() fails
before any ring size is tested, which is the symptom the commit message
says this patch fixes.

The comment here says reducing the channel count is only an optimization.
Wouldn't that reasoning also apply to a failed channels_set? Could the
channels_set call get the same handling, i.e. log with ksft_pr() and
return on EOPNOTSUPP before registering the defer?

The later patch in this series ("selftests: drv-net: ring_reconfig: skip
tx stall test without channel config") only changes reconfig_tx_stall(),
so this case still fails after the full series is applied.

>  
>      all_keys = ["rx-count", "tx-count", "combined-count"]
>      restore = {}

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106150509.30458-1-ahmetbilalyazicioglu%40gmail.com
Technical Details
Message-ID: <179432444472.994134.2763803571159924115@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360385-linux-kernel-netdev=dewy.ru
References: <20261106150509.30458-2-ahmetbilalyazicioglu@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360385-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/2] selftests: drv-net: ring_reconfig: handle devices
 without channel config
Date: Tue, 10 Nov 2026 15:27:24 +0000
Organization: Usenet Network
Message-ID: <179432444472.994134.2763803571159924115@kernel.org>
References: <20261106150509.30458-2-ahmetbilalyazicioglu@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="639085"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:TdNdD0pzLn2XQt5TeeIgtmoWTio= sha256:FGhwegmXkHJvTFoElfEAHjIRLJ4qCPRryDLwPjX7HIE=
	sha1:QtQHhBNBti4RmvVkemE2ek/9uxk= sha256:bHQNeyMN4ZP9LoRZqEpDDofkyCbJZf2hnIN/JQhyQ7Q=
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 78DF1113C21; Tue, 10 Nov 2026 18:34:31 +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 oOfmapoUyBd8;
	Tue, 10 Nov 2026 18:34:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-360385-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 4BDF4113BCF; Tue, 10 Nov 2026 18:34:19 +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 E13DC109858; Tue, 10 Nov 2026 15:27:35 +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=1794324452;
	b=F3lr7d3xcdibTW4glcmozqwPWKmPwOnW/RhrTedW19x0+Kzm1R733iUZm9ohiA1qslzU
	 75ImQsZJhmyN1ZUQt31kce52UKzrdEaCnF0yKycFb1/aW5TiYjKD0Aic4Hf3s6ObcH6/A
	 J5eeEkucRM7KBzDaGdSr0wTeeaeBvt08CUpKfi/1zauHFZkGXvYo1eyuZ9oYm36jjxiDq
	 843MkzEF99EW1JBtA6Vxaq0tkTOj7XHmtej1UXFXKk0N9u4fq9+GOrGk+UcV6jFrQJ4bq
	 1Fwk2CWApypaod5j2qTzg7BKa7z5cnvewXg3SiaEhyvNtO+3tJg3Jf36K7M6rFUrOdA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794324452;
	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=+3CeEODRSsaJx7luOoBPEtT+sSv1koHnkpRv0Or9SAM=;
	b=UcMTAqVilk2gNWhAVBmVCzHR5xozZ0a7IyeDhv1Ll/hsuRIy8TgRexHyfZTgq6xXNHft
	 U+9+Krcbffg28JaBE2OK3J1DpacUKqdYQeVkLs6VMcnLaAnn2qMZ2F6DxCT5KcskI0xJr
	 JWbOGV4ok71x7kv5xqN/XO2Ut8O6U3PTI/3h90qyhlKmRc/eIxbwmlUnXYLmr8GpTHbxp
	 btQvQYPy2OjSOOw8MZ30zgr1PsP05HyR+7Jb7XQKoKkPNzSja7KSPj5nmSjw4//U0rm33
	 FkFhGsHdlWUogQhRwUk/KsSmW4zCMgBKuWBEnaRIR6rBIH9bG6HPxcJgbZU0OZvk+HQ==
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="QCpbr/1o";
	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 261DF606A330;
	Tue, 10 Nov 2026 15:27:32 +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=QCpbr/1o
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=1794324446;
	b=k+VdSIFp0KWLwyVOMd8mw3JnsUUW1zo3zO+1Icit3qoXDhzpuc+AjVG/8n2Klm4lDSKS
	 VPxOW7HeaSrcsnQAu45Qt9Y0mybVFvttJgc0w8Cb8yC+mHbWsTE3weSW6zzsSP0Uwnmh6
	 gXZESi8sVW1mphENVDTvXwK41k9Yy7rSCAlsIkXKhxakinPRJ06yWUwJKYbXzIYfe58MH
	 bJQAs4cvIeyQDrYvQ99D0ebj4PlVcVmoVyP9t3AoW1fvrvrJNcYnHuCL2St6rtKcjIYEx
	 F/oJYbCsdnOwKr/fgFjTmO+bFjI4n/1uOLqs/tfgkMBKknK6njwG65jv9ZNtttFL4Gg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794324446;
	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=+3CeEODRSsaJx7luOoBPEtT+sSv1koHnkpRv0Or9SAM=;
	b=zf5TlDV8YAS+JiTbzX/lZKg3r1FH/e7V65UMd8MlUERF36sKUNQ/yv03LIKxlnY+J6Ay
	 pWcH20edyYd91R39RVC3ETUpd/dY1EKlge2AlZ6y213cstBeYkkORUvlRtvKUDV3X4fIO
	 4b2EDC6fo6KDtN3JEwB9wpOZzebmgmTZme5bIw15ZhhgLLAaBpzAmXIcDlJUZ1PJTm3/H
	 lpaSb7P+giLZBWhoI7UxkKWwt/qVRFaLFU/vYwVB3iUFLcoCfkIdkwBBrhqYnR8F0yS2s
	 3dHSEwOyrwdAe61dEQiz3Q8nRkYU2rQ4xGB1JinIMMJcoGHrqAfG0mGtSyQg97S9ogA==
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="QCpbr/1o";
	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 EAEF9606A31C;
	Tue, 10 Nov 2026 15:27:25 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3527A1F0089F;
	Tue, 10 Nov 2026 15:27:25 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794324445;
	bh=+3CeEODRSsaJx7luOoBPEtT+sSv1koHnkpRv0Or9SAM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=QCpbr/1oJmrwVEJ7mJUL4nFx5020OqvYhJt+S58+ZW/ETK7mgr/DOiOmv0psrUcyt
	 FZ5E8DrTXxV4T1f7nv4ag1GkFop96paMw60tyAtq1Obvy9i1dVdg8Oh+7OVBhX/IR0
	 C7ssP4f1lome6ED4Cea4cJdPnl8YtqBBcTeMOxBMQcrcuMd/7WArV62DwG+9jtvWWu
	 yPHrnLajX4+owN4OJru65OiD198ELUaB/j1kXuWtLz7pK8zhyOigMCCS6491T4+BeZ
	 2AKsoI6CMg5+t85RhULeGVmetw/8LIXUaZ5HK2vjA+a2gi88orclXIygDxg3G8QcWd
	 /yKotc/Y0F6DQ==
X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org,
 hmohsin@meta.com, linux-kselftest@vger.kernel.org,
 linux-kernel@vger.kernel.org
X-In-Reply-To: <20261106150509.30458-2-ahmetbilalyazicioglu@gmail.com>
X-sashiko-severity: Medium
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