๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17325

Re: [PATCH net v9 1/4] net: hsr: keep GRO disabled on HSR/PRP ports

#17325
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 16:27
99 lines
11951 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] The patch puts HSR-specific policy into the generic core function
  __netdev_update_features() in net/core/dev.c (lines 11279-11285):โ€ฆ

--

net: hsr: keep GRO disabled on HSR/PRP ports

This commit adds an hsr_port bit to struct net_device. HSR sets the bit
on its direct members (slave A/B and interlink). While the bit is set,
__netdev_update_features() clears NETIF_F_GRO and configurable
NETIF_F_GRO_HW from both wanted_features and the computed features, and
an attach fails if software GRO stays on.

> diff --git a/net/core/dev.c b/net/core/dev.c
> index df1a840b03343..c8c2de2125567 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -11269,6 +11269,21 @@ int __netdev_update_features(struct net_device *dev)
>  
>  	features = netdev_get_wanted_features(dev);
>  
> +	/* A direct HSR/PRP port needs per-frame metadata. Drop software
> +	 * GRO and configurable GRO_HW from the request as well as from the
> +	 * features passed to ndo_fix_features(), as the core does for
> +	 * upper-disabled features: drivers such as veth derive state from
> +	 * wanted_features and need the requested and the active bit to
> +	 * agree. Fixed-on or driver-required GRO_HW is left to the driver.
> +	 */
> +	if (dev->hsr_port) {
> +		netdev_features_t gro = NETIF_F_GRO |
> +					(dev->hw_features & NETIF_F_GRO_HW);
> +
> +		dev->wanted_features &= ~gro;
> +		features &= ~gro;
> +	}

[Severity: Low]

The comment says this follows what "the core does for upper-disabled
features". Is that right?

netdev_sync_upper_features() runs inside the lower device's own update.
It masks only the computed features and does not touch the request:

    if (!(upper->wanted_features & feature)
        && (features & feature)) {
        ...
        features &= ~feature;
    }

Only netdev_sync_lower_features() clears lower->wanted_features, and it
does that once, when the upper device turns the feature off. In this
patch, the request is cleared inside the same update that is supposed to
apply it.

Can this make the legacy ETHTOOL_SFEATURES ioctl report success for a
GRO request that was never applied? ethtool_set_features() sets
wanted_features and then runs:

net/ethtool/ioctl.c:ethtool_set_features() {
    ...
	__netdev_update_features(dev);

	if ((dev->wanted_features ^ dev->features) & valid)
		ret |= ETHTOOL_F_WISH;
    ...
}

When hsr_port is set, GRO is already gone from both wanted_features and
features when the XOR runs. So ETHTOOL_F_WISH is not set for GRO, and
the ioctl reports full success while GRO stays off. A later ethtool -k
shows GRO off without the "[requested on]" marker.

Compare LRO disabled by an upper device: there the request stays in
wanted_features and ETHTOOL_F_WISH is returned. The netlink path,
ethnl_set_features(), still reports the mismatch, because it compares
against its local req_wanted copy.

The comment on the new struct net_device field also says "Kernel role
state only; no user ABI", but the field changes behaviour that ethtool
users can see. It also puts HSR-specific policy into the generic
__netdev_update_features() under a "net: hsr:" subject. Later patches in
the series do not touch net/core/dev.c, so this is still the case at the
end of the series.

Would it work to mask only the computed features here, the way
netdev_sync_upper_features() does? Or, if the request has to be cleared
for veth, could the comment stop citing the upper-disable path as the
model and mention the ETHTOOL_F_WISH change?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112153333.20-1-xiexinet%40gmail.com
Technical Details
Message-ID: <179484644326.3136.10831441284903731799@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364548-linux-kernel-netdev=dewy.ru
References: <20261112153333.20-2-xiexinet@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364548-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v9 1/4] net: hsr: keep GRO disabled on HSR/PRP ports
Date: Mon, 16 Nov 2026 16:27:23 +0000
Organization: Usenet Network
Message-ID: <179484644326.3136.10831441284903731799@kernel.org>
References: <20261112153333.20-2-xiexinet@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2110480"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:mAtF7ZAuGwfERcyVjotBZaVc4XQ= sha256:cBgyjNH1CT3uy5DPULXiuaAzCFEVxa7pwPdZ3oOhCOQ=
	sha1:qDqHvxkkU6xbfJ9w56ordS5Ssvs= sha256:lCoZd/Ga4Cd/jH/vE9jZywJ5lhTVh9wjlJl4VlTkowY=
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 80901114CDF; Mon, 16 Nov 2026 19:27:39 +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 JbUzbSLhnVwS;
	Mon, 16 Nov 2026 19:27:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364548-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id B0463114CCA; Mon, 16 Nov 2026 19:27:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 71CAD24CF0; Mon, 16 Nov 2026 16:27:26 +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=1794846446;
	b=4LmjpDpNPvk4uxvmjTozLt4+btunTZcS7ydqOMeOUPHcmIru/qe5f7atymkIkYzH2Nkm
	 f1Tnlc/FOd8ii6mPZXVBhkEoHNQ5E/htQR4fzi69e3tzNX65ZbbRhmRJuBWUt0UBUftta
	 bhCNk4dI3xX2GgG+ni7CU6rSttwBjRIe8wtNipp3U17jZoZIHr9L6WWkrl7kvu9s1WZqx
	 RY3Az/e4vxR3UKt9wfWd8Ar0eK6uUxfE6imyU/Z48lgKStG0H0nGzbyqywPLprgsYbYTp
	 dZo8GXDLke8AUyCbQf1JdjxGZB5l20uRWLwwmBFc6gtSTYIhAjESWqf0d59E8qXTrzw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794846446;
	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=aqVXnpsGKUb5dmAyOvsZyxLyttfxnbXbLvMJdAHt3hw=;
	b=nIatVFi6sB2iuIJX8laAmIvBgjr3EkrNcFNHcpldmvYVwZTP8j4M5H6Q7GjiZysqowYV
	 osd0c+yR2jWC/evFAGs3cWdWiBTOEnsP/DASDaPK4EaICNXo41Y7MY9i56o6Dt5q3SmYl
	 DGtR1vHpHQ+wqWqx7wYnfffiWsjfdFeytj71jVVJzFdsP6N2h3+klaKQRlP/qhB1j1oCQ
	 dgErL7I2b4MMENntuQ9xH6Y0nFONkdVIKm5kAu+dbX/JeCsAt0qyLH88uMWFhq6MKv2i4
	 HqFGJk5Fwuy0FPadpQE9ZyIRW6CUXir0QqXfcV9l2vciSMpbHSbUN1ykOqmReFJ3Rrg==
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=VIQgZsHP;
	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 33909606A332;
	Mon, 16 Nov 2026 16:27:26 +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=VIQgZsHP
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=1794846445;
	b=5Uxqs9ekbWgv54eee+M9HP2UYdD3m5RHPseOkB83BqOJC7KZIRZcnP/TaEO4ShsekiI5
	 3xkhyOLQ0x72+vo9ZiO9yZ8GGd7/vS1iCTsdxNLkHVh3zn3W4z+ogkLgZbOYNz4mD6urq
	 S4kuDq8/hrtViYjNz9quqBxBG1TX0pwwDwVCxuyv1l772kttWX5qv/R8Owf3QgwEp1mcE
	 8pkuLBr8rxVyTDM7jfSJwzwT1ZJp/RUoIlkVsT8Nv0aKRvlRY5Dek8jeomDExB/vn/Ae7
	 OtV0d5ouYVYpK94nL3zADudhXFIjlMWHbNEyxZcM2DSoXgIq3leg6zAor6CP2lTUCcQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794846445;
	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=aqVXnpsGKUb5dmAyOvsZyxLyttfxnbXbLvMJdAHt3hw=;
	b=A7w7dkQAyLaIoVLaew2opeTEvqNRtajUd8c5W1oAwKfHb8L+t5up/rWtsexdriDm7WaH
	 kcQXdgPfjZ3vS9On9VKKe4LPPcBUzw6keCBUiXDAtSBYktjbMnMrvmYTMwkf7zOYsoNNe
	 2kCrb8BPc3dXfGtpa+Uo/WackBLaKHL5k5M7PMUAHHjOi0ZYggnfcqGldrVFRRP3ewSax
	 A3c+Z+E0VslrdE9U6gbE2ePDCKqtTM8OAehsLQgQRRxRUirqgmKVVyAfLBiMcTCUmpjZZ
	 Rd1XPe0p3gG5rFlEPI/ZGRcRsUHaDpULt7pRTR+f3FZhI/VkXHEGJmV3lWgYQHK87/w==
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=VIQgZsHP;
	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 5312C606A31C;
	Mon, 16 Nov 2026 16:27:25 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC0791F000C4;
	Mon, 16 Nov 2026 16:27:23 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794846444;
	bh=aqVXnpsGKUb5dmAyOvsZyxLyttfxnbXbLvMJdAHt3hw=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=VIQgZsHPU4uQodvLyAAwsRYYmobWrji3K/0jNrzRo6ZcvRJyw2jluC3GEXDumUeHG
	 vshdVlPKJzv2h8ow2lf2LCxd4EtGKG3she1k9a7HNCNCiM+6kCNk/I0CY8N8rULByL
	 TDOkbJhA4OstvcEodNimQ/pM9bRyYgRLmKiC4Kf+WNNmqFVGwSz3hJsOHzKVIhMgEh
	 /GHpCfNPA137OnbSvPSp55ELxA3u56ls5U3K80LMbdFrhVJZUZ9XsxK09S+OpwuJpL
	 kx25cNpEkX2UtvhDGje24GRYxBH/hu3aNINtgMXi2kbxphTkXvvFbtPUuA/FW2qn1h
	 zegWEGlK2AXSQ==
X-Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
 linux-kernel@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, andrew+netdev@lunn.ch,
 shuah@kernel.org, kees@kernel.org, petr.wozniak@gmail.com,
 qingfang.deng@linux.dev, fmaurer@redhat.com, luka.gejak@linux.dev,
 bigeasy@linutronix.de, xiaoliang.yang_1@nxp.com, skhawaja@google.com,
 liuhangbin@gmail.com, stable@vger.kernel.org, sdf.kernel@gmail.com,
 lukma@denx.de, fmancera@suse.de, danishanwar@ti.com
X-In-Reply-To: <20261112153333.20-2-xiexinet@gmail.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