* Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
2026-09-28 14:50 ` [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported Maxime Chevallier
@ 2026-09-29 0:07 ` Joe Damato
2026-09-29 7:13 ` Lorenzo Bianconi
2026-09-29 8:48 ` netdev-bot+sashiko
2 siblings, 0 replies; 11+ messages in thread
From: Joe Damato @ 2026-09-29 0:07 UTC (permalink / raw)
To: Maxime Chevallier
Cc: Andrew Lunn, Jakub Kicinski, davem, Eric Dumazet, Paolo Abeni,
Simon Horman, Maxime Coquelin, Alexandre Torgue, Russell King,
Nicolai Buchwitz, Jitendra Vegiraju, thomas.petazzoni,
Alexis Lothoré,
netdev, linux-kernel, linux-arm-kernel, linux-stm32,
Peter Robinson
On Mon, Sep 28, 2026 at 04:50:42PM +0200, Maxime Chevallier wrote:
> The RSS kselftests fail on stmmac, and this is partly due to the driver
> reporting bogus data for the RSS ops :
>
> - ethtool -x reports an indirection table and a key while the hardware
> doesn't have any of that
> - ethtool -X fails with -EINVAL.
>
> Let's return early in the rss ops if we know the hardware and platform
> don't support RSS.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
2026-09-28 14:50 ` [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported Maxime Chevallier
2026-09-29 0:07 ` Joe Damato
@ 2026-09-29 7:13 ` Lorenzo Bianconi
2026-09-29 8:48 ` netdev-bot+sashiko
2 siblings, 0 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2026-09-29 7:13 UTC (permalink / raw)
To: Maxime Chevallier
Cc: Andrew Lunn, Jakub Kicinski, davem, Eric Dumazet, Paolo Abeni,
Simon Horman, Maxime Coquelin, Alexandre Torgue, Russell King,
Nicolai Buchwitz, Jitendra Vegiraju, thomas.petazzoni,
Alexis Lothoré,
netdev, linux-kernel, linux-arm-kernel, linux-stm32,
Peter Robinson
[-- Attachment #1: Type: text/plain, Size: 2123 bytes --]
> The RSS kselftests fail on stmmac, and this is partly due to the driver
> reporting bogus data for the RSS ops :
>
> - ethtool -x reports an indirection table and a key while the hardware
> doesn't have any of that
> - ethtool -X fails with -EINVAL.
>
> Let's return early in the rss ops if we know the hardware and platform
> don't support RSS.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> index 154cc0c7623d..b78dc301d70d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> @@ -927,6 +927,9 @@ static u32 stmmac_get_rxfh_key_size(struct net_device *dev)
> {
> struct stmmac_priv *priv = netdev_priv(dev);
>
> + if (!stmmac_rss_is_supported(priv))
> + return 0;
> +
> return sizeof(priv->rss.key);
> }
>
> @@ -934,6 +937,9 @@ static u32 stmmac_get_rxfh_indir_size(struct net_device *dev)
> {
> struct stmmac_priv *priv = netdev_priv(dev);
>
> + if (!stmmac_rss_is_supported(priv))
> + return 0;
> +
> return ARRAY_SIZE(priv->rss.table);
> }
>
> @@ -943,6 +949,9 @@ static int stmmac_get_rxfh(struct net_device *dev,
> struct stmmac_priv *priv = netdev_priv(dev);
> int i;
>
> + if (!stmmac_rss_is_supported(priv))
> + return -EOPNOTSUPP;
> +
> if (rxfh->indir) {
> for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++)
> rxfh->indir[i] = priv->rss.table[i];
> @@ -962,6 +971,9 @@ static int stmmac_set_rxfh(struct net_device *dev,
> struct stmmac_priv *priv = netdev_priv(dev);
> int i;
>
> + if (!stmmac_rss_is_supported(priv))
> + return -EOPNOTSUPP;
> +
> if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
> rxfh->hfunc != ETH_RSS_HASH_TOP)
> return -EOPNOTSUPP;
> --
> 2.55.0
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
2026-09-28 14:50 ` [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported Maxime Chevallier
2026-09-29 0:07 ` Joe Damato
2026-09-29 7:13 ` Lorenzo Bianconi
@ 2026-09-29 8:48 ` netdev-bot+sashiko
2026-09-29 8:57 ` Maxime Chevallier
2 siblings, 1 reply; 11+ messages in thread
From: netdev-bot+sashiko @ 2026-09-29 8:48 UTC (permalink / raw)
To: maxime.chevallier
Cc: andrew+netdev, kuba, davem, edumazet, pabeni, horms,
mcoquelin.stm32, alexandre.torgue, linux, nb, jitendra.vegiraju,
thomas.petazzoni, alexis.lothore, netdev, linux-kernel,
linux-arm-kernel, linux-stm32, pbrobinson
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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] This patch makes stmmac_get_rxfh() in
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c return…
- [Low] The commit message describes a user-visible bug: on stmmac
devices without RSS, 'ethtool -x reports an indirection table and a…
--
net: stmmac: Don't set or get RSS parameters when not supported
This commit changes the stmmac ethtool RSS ops to return early when
stmmac_rss_is_supported() is false. The key and indirection sizes now
report 0, and get_rxfh/set_rxfh return -EOPNOTSUPP. The aim is to stop
reporting bogus RSS data and to make the RSS kselftests work on stmmac.
> The RSS kselftests fail on stmmac, and this is partly due to the driver
> reporting bogus data for the RSS ops :
>
> - ethtool -x reports an indirection table and a key while the hardware
> doesn't have any of that
> - ethtool -X fails with -EINVAL.
>
> Let's return early in the rss ops if we know the hardware and platform
> don't support RSS.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
[Severity: Low]
The commit message describes a bug that users can see, but there is no
Fixes: tag.
Blame shows that the unconditional stmmac_get_rxfh_key_size(),
stmmac_get_rxfh_indir_size(), stmmac_get_rxfh() and stmmac_set_rxfh()
logic came from commit 76067459c686. The later refactor fb6e30a72539 only
moved these functions to the ethtool_rxfh_param API.
Should this carry the following tag?
Fixes: 76067459c686 ("net: stmmac: Implement RSS and enable it in XGMAC core")
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> index 1cf0f8820b33..56019683f399 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
[ ... ]
> @@ -943,6 +949,9 @@ static int stmmac_get_rxfh(struct net_device *dev,
> struct stmmac_priv *priv = netdev_priv(dev);
> int i;
>
> + if (!stmmac_rss_is_supported(priv))
> + return -EOPNOTSUPP;
> +
[Severity: Medium]
Does this -EOPNOTSUPP break namespace-wide ETHTOOL_MSG_RSS_GET dumps?
rss_dump_one_dev() in net/ethtool/rss.c only skips a device when it has
no get_rxfh op, and stmmac still provides one:
net/ethtool/rss.c:rss_dump_one_dev() {
...
if (!dev->ethtool_ops->get_rxfh)
return 0;
if (!ctx->ctx_idx) {
ret = rss_dump_one_ctx(skb, cb, dev, 0);
if (ret)
return ret;
...
}
The error then comes back through this path:
ethnl_rss_dumpit()
rss_dump_one_dev()
rss_dump_one_ctx()
rss_prepare()
rss_prepare_get()
ops->get_rxfh() -> stmmac_get_rxfh() returns -EOPNOTSUPP
When it reaches ethnl_rss_dumpit(), the loop stops:
for_each_netdev_lock_ops_compat_scoped(net, dev, ctx->ifindex) {
...
ret = rss_dump_one_dev(skb, cb, dev);
if (ret)
break;
}
return ret;
So the dump fails at the stmmac netdev, and no device with a higher
ifindex gets reported. That includes NICs that do support RSS.
No in-tree platform sets plat->rss_en. The only match is the declaration
in include/linux/stmmac.h. That means stmmac_rss_is_supported() is false
for every in-tree stmmac device.
Before this patch, stmmac_get_rxfh() always returned 0. The dump used to
complete, even though it reported bogus data.
The RSS selftests use this dump path. In
tools/testing/selftests/drivers/net/hw/rss_ctx.py,
test_rss_context_dump() calls:
ctxs = cfg.ethnl.rss_get({}, dump=True)
It also runs a dump with {'start-context': 1}. On a test host that has a
stmmac port plus the NIC under test, would these now fail, when they
passed before?
mvpp2 and mvneta already return -EOPNOTSUPP from get_rxfh, so the core
already stopped dumps this way. This patch applies that behaviour to every
in-tree stmmac device.
Would it be better to have rss_dump_one_dev() skip devices whose get_rxfh
returns -EOPNOTSUPP, or that report zero indir and key sizes? Another
option is to not provide the stmmac get_rxfh op when RSS is unsupported.
> if (rxfh->indir) {
> for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++)
> rxfh->indir[i] = priv->rss.table[i];
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260928145043.1228968-1-maxime.chevallier%40bootlin.com
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
2026-09-29 8:48 ` netdev-bot+sashiko
@ 2026-09-29 8:57 ` Maxime Chevallier
2026-09-30 1:09 ` Jakub Kicinski
0 siblings, 1 reply; 11+ messages in thread
From: Maxime Chevallier @ 2026-09-29 8:57 UTC (permalink / raw)
To: netdev-bot+sashiko
Cc: andrew+netdev, kuba, davem, edumazet, pabeni, horms,
mcoquelin.stm32, alexandre.torgue, linux, nb, jitendra.vegiraju,
thomas.petazzoni, alexis.lothore, netdev, linux-kernel,
linux-arm-kernel, linux-stm32, pbrobinson
On 9/29/26 10:48, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 1
>
> 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] This patch makes stmmac_get_rxfh() in
> drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c return…
> - [Low] The commit message describes a user-visible bug: on stmmac
> devices without RSS, 'ethtool -x reports an indirection table and a…
>
> --
>
> net: stmmac: Don't set or get RSS parameters when not supported
>
> This commit changes the stmmac ethtool RSS ops to return early when
> stmmac_rss_is_supported() is false. The key and indirection sizes now
> report 0, and get_rxfh/set_rxfh return -EOPNOTSUPP. The aim is to stop
> reporting bogus RSS data and to make the RSS kselftests work on stmmac.
>
>> The RSS kselftests fail on stmmac, and this is partly due to the driver
>> reporting bogus data for the RSS ops :
>>
>> - ethtool -x reports an indirection table and a key while the hardware
>> doesn't have any of that
>> - ethtool -X fails with -EINVAL.
>>
>> Let's return early in the rss ops if we know the hardware and platform
>> don't support RSS.
>>
>> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
>
> [Severity: Low]
> The commit message describes a bug that users can see, but there is no
> Fixes: tag.
>
> Blame shows that the unconditional stmmac_get_rxfh_key_size(),
> stmmac_get_rxfh_indir_size(), stmmac_get_rxfh() and stmmac_set_rxfh()
> logic came from commit 76067459c686. The later refactor fb6e30a72539 only
> moved these functions to the ethtool_rxfh_param API.
>
> Should this carry the following tag?
>
> Fixes: 76067459c686 ("net: stmmac: Implement RSS and enable it in XGMAC core")
targetting net-next, problem always existed, doesn't crash the kernel,
it's just returning bogus harmless stuff
>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
>> index 1cf0f8820b33..56019683f399 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
>
> [ ... ]
>
>> @@ -943,6 +949,9 @@ static int stmmac_get_rxfh(struct net_device *dev,
>> struct stmmac_priv *priv = netdev_priv(dev);
>> int i;
>>
>> + if (!stmmac_rss_is_supported(priv))
>> + return -EOPNOTSUPP;
>> +
>
> [Severity: Medium]
> Does this -EOPNOTSUPP break namespace-wide ETHTOOL_MSG_RSS_GET dumps?
This was reported by Nicolai already, and other drivers report -EOPNOTSUPP
here.
If we address that, I'd say we do that in the RSS ethnl code.
Maxime
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
2026-09-29 8:57 ` Maxime Chevallier
@ 2026-09-30 1:09 ` Jakub Kicinski
2026-09-30 7:30 ` Maxime Chevallier
0 siblings, 1 reply; 11+ messages in thread
From: Jakub Kicinski @ 2026-09-30 1:09 UTC (permalink / raw)
To: Maxime Chevallier
Cc: netdev-bot+sashiko, andrew+netdev, davem, edumazet, pabeni,
horms, mcoquelin.stm32, alexandre.torgue, linux, nb,
jitendra.vegiraju, thomas.petazzoni, alexis.lothore, netdev,
linux-kernel, linux-arm-kernel, linux-stm32, pbrobinson
On Tue, 29 Sep 2026 10:57:10 +0200 Maxime Chevallier wrote:
> >> @@ -943,6 +949,9 @@ static int stmmac_get_rxfh(struct net_device *dev,
> >> struct stmmac_priv *priv = netdev_priv(dev);
> >> int i;
> >>
> >> + if (!stmmac_rss_is_supported(priv))
> >> + return -EOPNOTSUPP;
> >> +
> >
> > [Severity: Medium]
> > Does this -EOPNOTSUPP break namespace-wide ETHTOOL_MSG_RSS_GET dumps?
>
> This was reported by Nicolai already, and other drivers report -EOPNOTSUPP
> here.
>
> If we address that, I'd say we do that in the RSS ethnl code.
Let's get this in the same series, cause I'm not 100% convinced.
My instinct is that returning 0 size for indir table and key
would be correct and less hairy for the core to handle.
All pieces of RSS are optional so returning 0 size for everything
should be equivalent to having no RSS.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
2026-09-30 1:09 ` Jakub Kicinski
@ 2026-09-30 7:30 ` Maxime Chevallier
0 siblings, 0 replies; 11+ messages in thread
From: Maxime Chevallier @ 2026-09-30 7:30 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev-bot+sashiko, andrew+netdev, davem, edumazet, pabeni,
horms, mcoquelin.stm32, alexandre.torgue, linux, nb,
jitendra.vegiraju, thomas.petazzoni, alexis.lothore, netdev,
linux-kernel, linux-arm-kernel, linux-stm32, pbrobinson
Hi Jakub,
On 9/30/26 03:09, Jakub Kicinski wrote:
> On Tue, 29 Sep 2026 10:57:10 +0200 Maxime Chevallier wrote:
>>>> @@ -943,6 +949,9 @@ static int stmmac_get_rxfh(struct net_device *dev,
>>>> struct stmmac_priv *priv = netdev_priv(dev);
>>>> int i;
>>>>
>>>> + if (!stmmac_rss_is_supported(priv))
>>>> + return -EOPNOTSUPP;
>>>> +
>>>
>>> [Severity: Medium]
>>> Does this -EOPNOTSUPP break namespace-wide ETHTOOL_MSG_RSS_GET dumps?
>>
>> This was reported by Nicolai already, and other drivers report -EOPNOTSUPP
>> here.
>>
>> If we address that, I'd say we do that in the RSS ethnl code.
>
> Let's get this in the same series, cause I'm not 100% convinced.
> My instinct is that returning 0 size for indir table and key
> would be correct and less hairy for the core to handle.
> All pieces of RSS are optional so returning 0 size for everything
> should be equivalent to having no RSS.
Ok no problem, I'll also give it a test on mvpp2 as well then.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 11+ messages in thread