Re: [PATCH net-next v12 04/10] bnge: add RXFH ethtool support
From: netdev-bot+sashiko
Date: Sat Dec 05 2026 - 09:46:28 EST
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] bnge_set_rxfh()
(drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c, around lines…
--
bnge: add RXFH ethtool support
This adds the ethtool RXFH operations to bnge: get/set_rxfh for the RSS
hash key and indirection table, and get/set_rxfh_fields for hash field
selection. Both set operations are only allowed while the device is
down. The default RSS key now comes from netdev_rss_key_fill(), and
bnge_reserve_rings() can keep a user-configured indirection table.
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> index 2467e44de291a..878fe4888160f 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
[ ... ]
> +static int bnge_set_rxfh(struct net_device *dev,
> + struct ethtool_rxfh_param *rxfh,
> + struct netlink_ext_ack *extack)
> +{
> + struct bnge_net *bn = netdev_priv(dev);
> +
> + if (rxfh->hfunc && rxfh->hfunc != ETH_RSS_HASH_TOP)
> + return -EOPNOTSUPP;
> +
> + if (netif_running(dev)) {
> + NL_SET_ERR_MSG_MOD(extack,
> + "RSS configuration can only be changed while the interface is down");
> + return -EBUSY;
> + }
[Severity: Low]
Should bnge_set_rxfh() return 0 before the netif_running() check when the
request does not change anything?
The ETHTOOL_SRSSH ioctl path in ethtool_set_rxfh() (net/ethtool/ioctl.c)
calls the driver even when only hfunc is set:
net/ethtool/ioctl.c:ethtool_set_rxfh() {
...
if (!rxfh.rss_context) {
ntf = ETHTOOL_MSG_RSS_NTF;
ret = ops->set_rxfh(dev, &rxfh_dev, extack);
...
}
In that case rxfh->indir and rxfh->key are both NULL, and hfunc is
ETH_RSS_HASH_TOP. Toeplitz is the only hash function bnge supports, so
the request is a no-op. Even so, "ethtool -X ethX hfunc toeplitz" over
the ioctl gets -EBUSY on a running interface.
The netlink path does not hit this, because ethnl_rss_set() skips the
driver call when nothing is modified.
bnge_set_rxfh_fields() in the same patch already handles this case.
It compares the config first and only checks netif_running() after that:
if (bd->rss_hash_cfg == rss_hash_cfg)
return 0;
if (netif_running(dev)) {
Would a check such as "if (!rxfh->key && !rxfh->indir) return 0;" before
the netif_running() test make bnge_set_rxfh() consistent with this? The
behaviour is still the same at the end of the series.
> +
> + bnge_modify_rss(bn, NULL, NULL, rxfh);
> +
> + return 0;
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201132011.2705569-1-vikas.gupta%40broadcom.com