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

From: netdev-bot+sashiko

Date: Thu Nov 19 2026 - 21:22:08 EST


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