Article View: linux.kernel.netdev
Article #19549Re: [PATCH net v10 1/4] net: hsr: keep GRO disabled on HSR/PRP ports
From: netdev-bot+sashiko
Date: Fri, 20 Nov 2026 02:22
Date: Fri, 20 Nov 2026 02:22
115 lines
12516 bytes
12516 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] When dev->hsr_port is set, __netdev_update_features()
(net/core/dev.c) clears NETIF_F_GRO, and NETIF_F_GRO_HW if it is in…
--
net: hsr: keep GRO disabled on HSR/PRP ports
This patch adds an hsr_port role bit to struct net_device and sets it on
HSR/PRP slave and interlink devices. While the bit is set,
__netdev_update_features() removes NETIF_F_GRO and configurable
NETIF_F_GRO_HW from both dev->wanted_features and the computed features.
The attach is refused if software GRO is still on after the update.
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 3c58db732761a..1f51a55ff2b08 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -11289,6 +11289,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(): 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: Medium]
Does clearing dev->wanted_features here make the ethtool uAPI report a
GRO request on an HSR member incorrectly?
With the legacy ioctl, ethtool_set_features() in net/ethtool/ioctl.c
stores the request, calls __netdev_update_features(), and then works out
ETHTOOL_F_WISH from dev->wanted_features:
net/ethtool/ioctl.c:ethtool_set_features() {
...
dev->wanted_features |= wanted & valid;
__netdev_update_features(dev);
if ((dev->wanted_features ^ dev->features) & valid)
ret |= ETHTOOL_F_WISH;
...
}
On a member, "ethtool -K <port> gro on" ends with GRO cleared in both
wanted_features and features. The call therefore succeeds without
ETHTOOL_F_WISH, even though GRO stays off.
include/uapi/linux/ethtool.h documents the flag as:
* %ETHTOOL_F_WISH - some or all changes requested were recorded but the
* resulting state of bits masked by .valid is not equal to .requested.
Is that contract broken in this case?
On the netlink side, ethnl_set_features() in net/ethtool/features.c
builds its reply from the local req_wanted bitmap:
bitmap_xor(wanted_diff_mask, req_wanted, new_active,
NETDEV_FEATURE_COUNT);
So the SET reply says GRO is wanted but not active. A later
ETHTOOL_MSG_FEATURES_GET then reads dev->wanted_features in
features_prepare_data() and shows GRO as not wanted. Can the SET reply
and the GET that follows it disagree about the same request, and can the
ioctl and netlink interfaces disagree with each other?
The commit message describes this behaviour:
A GRO request on a member is dropped,
not kept pending: while GRO stays off, the legacy ETHTOOL_SFEATURES
ioctl returns no ETHTOOL_F_WISH for it, and the netlink reply still
shows the request as not applied.
The other core paths seem to handle this differently.
netdev_sync_upper_features() and ndo_fix_features() only mask the
computed features, so a bridge port's LRO request still returns
ETHTOOL_F_WISH. dev_disable_lro() and dev_disable_gro_hw() clear
wanted_features only once, when they are called. This new branch erases
the request on every recompute.
Could the request stay in wanted_features, with only the computed
features masked here? veth's use of wanted_features (veth_gro_requested()
reads dev->wanted_features) could then be handled separately.
> if (dev->netdev_ops->ndo_fix_features)
> features = dev->netdev_ops->ndo_fix_features(dev, features);
>
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117141922.20-1-xiexinet%40gmail.com
Technical Details
Message-ID:
<179514132000.3136.2415655157145361596@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367562-linux-kernel-netdev=dewy.ruReferences:
<20261117141922.20-2-xiexinet@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367562-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v10 1/4] net: hsr: keep GRO disabled on HSR/PRP ports Date: Fri, 20 Nov 2026 02:22:00 +0000 Organization: Usenet Network Message-ID: <179514132000.3136.2415655157145361596@kernel.org> References: <20261117141922.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="3038575"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:FlHXqohqy5DdeFRt3JDWVXvgYk8= sha256:jwlyXHzioW4YUdZdtK/ajTl6/F+q1q3m7ERPclrP5rg= sha1:9McceZisdZhKH0JPdRrI3HiNETg= sha256:ywQflFSPRxdaRKpsr/IPVn+IKjokwAonsKlsurKf2YM= 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 9E8F8115866; Fri, 20 Nov 2026 05:22:19 +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 UPkJSBwLRVuM; Fri, 20 Nov 2026 05:22:15 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367562-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 E4CC911584F; Fri, 20 Nov 2026 05:22:06 +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 24856242323; Fri, 20 Nov 2026 02:22:04 +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=1795141323; b=K+euZewhG3Gc/sesbUK3Z1GOAsHaJGylA2jNvXG4T2yjvwmGBLQTR8RbzTXNS5HRHoog iE3HGKw6q+VtFbeg2u2s9Uma1DvRG2GAdLvJAHqId1V+HRYdDX6MlJuenhYdgN8cCddzC k9g5iaNYqLbZpi6KA6xDrYPckofIf95cRZ2wdwRMccCF7WKNoY7PJid1/kcLDk7XhW/dS gUUNrzLUHhxDdACGmDIam6/EfJWGHkpsouzWV9lNxoMia3pRx3850Z1rKwE7JbTzAna9x xD/aTeJul9pLxvaZ8zviKjLB7OXY3Jx8+Z0hpGjk0xoWTfx33ZBTmH8dx3AFX7gnzIg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795141323; 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=gDfMbB0iLO5147W7hciH56ETASFEwnLRXOCRyFYMdqQ=; b=iAcdJOgfH7b/EMfZmgZBOOih0+oUvQwIuB2c3haCFlsV/Eub/UrIU+8OlB+jKmpTe0RA +6oVgfB98at5GyqZzZOWjHig8v1kmMJ6pygLb+G45lS8ZSmYUn3U7QBq6rU6MTEPGBfkU OyHtZBfXWFV6/UopiqpaxsQgo+gdWnBn5+QT5d7WJVdTj76BtwnRj3MvroY7dSvavQ4CK A2a1qz2QlDK6t83Kqw9AkEN/Zi/K2Dj0pHtuC6sSHAfZ0CMAE0FeMEUO3vJqY2+m00dzF fM9Yx8SCEu6TgbXH7tVHr/JXIVd0BxXzZQrYmGrEzdc4ZLaiYH1uIuojgwb5qnYpnig== 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=T031gPTS; 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 ED82F606A33B; Fri, 20 Nov 2026 02:22:02 +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=T031gPTS 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=1795141322; b=vV6iChbj/mxnGnRV/gkeOfuVIAZvHgXVjTSKLfWbY7avoP/o81oUD/x5zDZZKqm+dc9d CW22vnQRfIxfS5acORCEkQg8VcJvN/tic6h8p5oVnCSI2qXCo/A6L/1rvfiUAeKCcHOrG V2IpY7Shqwhb7pkPDgPovb1qvlQz6Y8qhHtqJdHSPMvJXZ6RRGOS7LxbF7UjU3EVeEfNx tvbOLtJceqqiIKq4qyGbbdm9r5PWas6ad6+oOWnVqa8wjIjxaQYj/83iMFqsHkFavJAsZ sKkUWQ7kvOKtRVKQkMLDcPoJ8J5djBXxE7Djq3UiU4uZzeh1DxDK0qd23WLDBWOxOrA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795141322; 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=gDfMbB0iLO5147W7hciH56ETASFEwnLRXOCRyFYMdqQ=; b=eTOsGB64fWo7Nhdh/bMEBzRsgI56YzMO7QO1hNfuEKUdGXjQzypq5MyvDLqy1BQmNmUO ukcej3Mw7hq9Gre73VaTIwFU1XUmppU3afWZgL6jUESYSjhWwSER9YYArVFFdvr5o+kLJ kji7TNVtdx2FU4k/+poLVDdYAKgywrHRBauGsvC9xJ/tWVWn+NoNaBFNRlmJYbTEvzlST VZnSEy6z8XMeY6afq9rspsvbKFy6YRHTE2G4+HmJHnKDrIL6JvWoPe9mJYnkEPUpTx5Z3 iUGTYL85deBkW6CiRGSLyD2dGrkf2sDE1oA10WmQRHWnxNv7OhLUIt5vZnSgiccf3jA== 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=T031gPTS; 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 16ECE606A320; Fri, 20 Nov 2026 02:22:01 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72EDE1F000CA; Fri, 20 Nov 2026 02:22:00 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795141321; bh=gDfMbB0iLO5147W7hciH56ETASFEwnLRXOCRyFYMdqQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=T031gPTSzRGf5px/5xZoOAaCt9a/jrJuJTElhgersdptRgSVlRj30JsYC4srxx9Xc XLIw2JLsLZefBUuNyA+0lGphtfeDK0ZylsU3w/oskVDoh8W+gTxvWTauOkS9MJjMJB zWiTOyvjzeQj1IVGa/MAzyBdkwEUXYgeImNGAhG4e5WxD79Qtqq9Fh8XTolVi5+Vrj oYKR3NC+VR7uLE0fQFUtg5M85u5mfYCGQCF2tJgH/lVToFLyw+31Eu2i/O3aQK6uJ6 LVf6VXN3VRVzDc632HVrsybjl81+SDk1/FfbUugS8CUyzFd3/DGoA7zMeQm+MNjxAB etliTNMtri2Hg== 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: <20261117141922.20-2-xiexinet@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