net: stmmac: Report RSS as not supported
Subsystems (4)
Maxime Chevallier
maintainerv2 cover net: stmmac: Report RSS as not supported
Hi everyone,
This is V2 of an RSS cleanup for stmmac, discovered while running the rss kselftests on stmmac. It returns bogus indirection tables and key sizes, when RSS isn't actually available at all.
RSS is currently not supported on any stmmac devices upstream, so code that was already useless is now effectively dead. It has been the case since 2019 when the code was added, as platforms need to set rss_en in their plat data, and no glue ever did that.
Russell King ran a poll in february 2026 [1] asking if the code should be dropped, without any reply going in either direction.
Jitendra Vegiraju from Broadcom sent 9 iterations of a Broadcom PCIe glue driver [2] that actually sets rss_en = 1, so there's some hope that this may be used in the future.
[1]: https://lore.kernel.org/netdev/[email protected]/
[2]: https://lore.kernel.org/netdev/[email protected]/
Nvidia platforms seem to be RSS capable, but it's not going to work out of the box. Let's leave the feature there for now, with proper -EOPNOTSUPP returned for RSS ops.
V2:
- target net-next
- Add a dedicated helper, following Nicolai's review.
V1: https://lore.kernel.org/netdev/[email protected]/#t
Maxime Chevallier (2):
net: stmmac: Introduce a helper to check RSS support
net: stmmac: Don't set or get RSS parameters when not supported
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 5 +++++ drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 ++++++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-)
Signature · 1 line
2.55.0
Maxime Chevallier
maintainerPATCH v2 1/2 net: stmmac: Introduce a helper to check RSS support
The RSS feature is only available in stmmac if the hardware reports it through the DMA caps and if the platform glue sets rss_en.
Introduce a helper that checks both.
For now, no platform sets rss_en, but there's interest in the topic so leave the door open instead of dropping the feature altogether.
No functional changes intended.
--- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 5 +++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac.h +5 -0
@@ -433,6 +433,11 @@ struct timespec64 stmmac_calc_tas_basetime(ktime_t old_base_time,ktime_t current_time, u64 cycle_time); +static inline bool stmmac_rss_is_supported (const struct stmmac_priv *priv) +{ +return priv->dma_cap.rssen && priv->plat->rss_en; +} +#if IS_ENABLED (CONFIG_STMMAC_SELFTESTS )void stmmac_selftest_run (struct net_device *dev,struct ethtool_test *etest,u64 *buf);
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2 -2
@@ -3538,7 +3538,7 @@ static void stmmac_mac_config_rx_queues_routing(struct stmmac_priv *priv)static void stmmac_mac_config_rss (struct stmmac_priv *priv) { -if (!priv->dma_cap.rssen || !priv->plat->rss_en) { +if (!stmmac_rss_is_supported (priv)) { priv->rss.enable = false;return ; }
@@ -8037,7 +8037,7 @@ static int __stmmac_dvr_probe(struct device *device,for (i =0 ; i <ARRAY_SIZE (priv->rss.table); i++) priv->rss.table[i] =ethtool_rxfh_indir_default (i, rxq); -if (priv->dma_cap.rssen && priv->plat->rss_en) +if (stmmac_rss_is_supported (priv)) ndev->features |=NETIF_F_RXHASH ; ndev->vlan_features |= ndev->features;
Signature · 1 line
2.55.0
Re: [PATCH net-next v2 1/2] net: stmmac: Introduce a helper to check RSS support
Quoted 8 lines · Maxime Chevallier
The RSS feature is only available in stmmac if the hardware reports it through the DMA caps and if the platform glue sets
rss_en.Introduce a helper that checks both.
For now, no platform sets
rss_en, but there's interest in the topic so leave the door open instead of dropping the feature altogether.
Quoted 8 lines
No functional changes intended.
Suggested-by Nicolai Buchwitz <[email protected]>Signed-off-by Maxime Chevallier <[email protected]>--- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 5 +++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
Re: [PATCH net-next v2 1/2] net: stmmac: Introduce a helper to check RSS support
In reply to Maxime ChevallierQuoted 5 lines
The RSS feature is only available in stmmac if the hardware reports it through the DMA caps and if the platform glue sets
rss_en.Introduce a helper that checks both.
Quoted 7 lines
For now, no platform sets
rss_en, but there's interest in the topic so leave the door open instead of dropping the feature altogether.No functional changes intended.
Suggested-by Nicolai Buchwitz <[email protected]>Signed-off-by Maxime Chevallier <[email protected]>
Quoted 47 lines
--- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 5 +++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)drivers/net/ethernet/stmicro/stmmac/stmmac.h +5
-0@@ -433,6 +433,11 @@ struct timespec64 stmmac_calc_tas_basetime(ktime_t old_base_time,ktime_t current_time, u64 cycle_time); +static inline bool stmmac_rss_is_supported (const struct stmmac_priv *priv) +{ +return priv->dma_cap.rssen && priv->plat->rss_en; +} +#if IS_ENABLED (CONFIG_STMMAC_SELFTESTS )void stmmac_selftest_run (struct net_device *dev,struct ethtool_test *etest,u64 *buf);drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2
-2@@ -3538,7 +3538,7 @@ static void stmmac_mac_config_rx_queues_routing(struct stmmac_priv *priv)static void stmmac_mac_config_rss (struct stmmac_priv *priv) { -if (!priv->dma_cap.rssen || !priv->plat->rss_en) { +if (!stmmac_rss_is_supported (priv)) { priv->rss.enable = false;return ; }@@ -8037,7 +8037,7 @@ static int __stmmac_dvr_probe(struct device *device,for (i =0 ; i <ARRAY_SIZE (priv->rss.table); i++) priv->rss.table[i] =ethtool_rxfh_indir_default (i, rxq); -if (priv->dma_cap.rssen && priv->plat->rss_en) +if (stmmac_rss_is_supported (priv)) ndev->features |=NETIF_F_RXHASH ; ndev->vlan_features |= ndev->features;Signature · 1 line
2.55.0
Maxime Chevallier
maintainerPATCH v2 2/2 net: stmmac: Don't set or get RSS parameters when not supported
In reply to Maxime ChevallierThe 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.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +12 -0
@@ -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 ;
Signature · 1 line
2.55.0
Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
Quoted 7 lines · Maxime Chevallier
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.
Quoted 8 lines
Let's return early in the rss ops if we know the hardware and platform don't support RSS.
Signed-off-by Maxime Chevallier <[email protected]>--- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Re: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
In reply to Maxime ChevallierQuoted 11 lines
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 <[email protected]>
Quoted 52 lines
--- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +12
-0@@ -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 ;Signature · 1 line
2.55.0
[email protected]
AI reviewRe: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
In reply to Maxime ChevallierThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.
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.
Quoted 11 lines
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 <[email protected]>
[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?
Quoted 4 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +0
-0
[ ... ]
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c static int stmmac_get_rxfh(struct net_device *dev, · line 954
Quoted 7 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +3
-0@@ -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 -EOPNOTSUPPWhen 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.
Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +0
-0if (rxfh->indir) {for (i =0 ; i <ARRAY_SIZE (priv->rss.table); i++) rxfh->indir[i] = priv->rss.table[i];
[ ... ]
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260928145043.1228968-1-maxime.chevallier%40bootlin.com
Maxime Chevallier
maintainerRe: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
Quoted 41 lines · On 9/29/26 10:48, [email protected] 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()indrivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.creturn…
- [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.Quoted 11 lines
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 <[email protected]>[Severity: Low]
The commit message describes a bug that users can see, but there is no
Fixes: tag.
Quoted 8 lines
Blame shows that the unconditional
stmmac_get_rxfh_key_size(),stmmac_get_rxfh_indir_size(),stmmac_get_rxfh()andstmmac_set_rxfh()logic came from commit76067459c686. The later refactorfb6e30a72539only moved these functions to theethtool_rxfh_paramAPI.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
Quoted 12 lines
Quoted 5 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +0
-0[ ... ]
Quoted 4 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +0
-0@@ -943,6 +949,9 @@ static int stmmac_get_rxfh(struct net_device *dev,struct stmmac_priv *priv =netdev_priv (dev);int i;
Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c static int stmmac_get_rxfh(struct net_device *dev, · line 954
Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +3
-0+if (!stmmac_rss_is_supported (priv)) +return -EOPNOTSUPP ; +[Severity: Medium]
Does this-EOPNOTSUPPbreak namespace-wideETHTOOL_MSG_RSS_GETdumps?
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
Jakub Kicinski
maintainerRe: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
Quoted 11 lines · On Tue, 29 Sep 2026 10:57:10 +0200 Maxime Chevallier wrote:
Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c static int stmmac_get_rxfh(struct net_device *dev, · line 954
Quoted 7 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +3
-0@@ -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-EOPNOTSUPPbreak namespace-wideETHTOOL_MSG_RSS_GETdumps?
Quoted 4 lines
This was reported by Nicolai already, and other drivers report
-EOPNOTSUPPhere.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.
Signature · 1 line
pw-bot: cr
Maxime Chevallier
maintainerRe: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported
Hi Jakub,
Quoted 15 lines · Jakub Kicinski
Quoted 14 lines · On Tue, 29 Sep 2026 10:57:10 +0200 Maxime Chevallier wrote:
Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c static int stmmac_get_rxfh(struct net_device *dev, · line 954
Quoted 7 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +3
-0@@ -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-EOPNOTSUPPbreak namespace-wideETHTOOL_MSG_RSS_GETdumps?This was reported by Nicolai already, and other drivers report
-EOPNOTSUPPhere.
Quoted 7 lines
Quoted 1 line
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