mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] net: stmmac: Report RSS as not supported
@ 2026-09-28 14:50 Maxime Chevallier
  2026-09-28 14:50 ` [PATCH net-next v2 1/2] net: stmmac: Introduce a helper to check RSS support Maxime Chevallier
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-09-28 14:50 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski, davem, Eric Dumazet, Paolo Abeni,
	Simon Horman, Maxime Coquelin, Alexandre Torgue, Russell King,
	Nicolai Buchwitz, Jitendra Vegiraju
  Cc: Maxime Chevallier, thomas.petazzoni, Alexis Lothoré,
	netdev, linux-kernel, linux-arm-kernel, linux-stm32,
	Peter Robinson

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/aYd4BkAeNW6d0iIC@shell.armlinux.org.uk/
[2]: https://lore.kernel.org/netdev/20260402213629.1996133-1-jitendra.vegiraju@broadcom.com/

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/20260926093343.292181-1-maxime.chevallier@bootlin.com/#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(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH net-next v2 1/2] net: stmmac: Introduce a helper to check RSS support
  2026-09-28 14:50 [PATCH net-next v2 0/2] net: stmmac: Report RSS as not supported Maxime Chevallier
@ 2026-09-28 14:50 ` Maxime Chevallier
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-09-28 14:50 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski, davem, Eric Dumazet, Paolo Abeni,
	Simon Horman, Maxime Coquelin, Alexandre Torgue, Russell King,
	Nicolai Buchwitz, Jitendra Vegiraju
  Cc: Maxime Chevallier, thomas.petazzoni, Alexis Lothoré,
	netdev, linux-kernel, linux-arm-kernel, linux-stm32,
	Peter Robinson

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.

Suggested-by: Nicolai Buchwitz <nb@tipi-net.de>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      | 5 +++++
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 7582fca63741..e2873d46e049 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -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);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4dee3542df3b..08feb18d62ba 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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;
-- 
2.55.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [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 0/2] net: stmmac: Report RSS as not supported Maxime Chevallier
  2026-09-28 14:50 ` [PATCH net-next v2 1/2] net: stmmac: Introduce a helper to check RSS support Maxime Chevallier
@ 2026-09-28 14:50 ` Maxime Chevallier
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-09-28 14:50 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski, davem, Eric Dumazet, Paolo Abeni,
	Simon Horman, Maxime Coquelin, Alexandre Torgue, Russell King,
	Nicolai Buchwitz, Jitendra Vegiraju
  Cc: Maxime Chevallier, thomas.petazzoni, Alexis Lothoré,
	netdev, linux-kernel, linux-arm-kernel, linux-stm32,
	Peter Robinson

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(+)

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-28 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-28 14:50 [PATCH net-next v2 0/2] net: stmmac: Report RSS as not supported Maxime Chevallier
2026-09-28 14:50 ` [PATCH net-next v2 1/2] net: stmmac: Introduce a helper to check RSS support Maxime Chevallier
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®