summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Semin <fancer.lancer@gmail.com>2025-05-22 21:40:33 +0300
committerSerge Semin <fancer.lancer@gmail.com>2026-08-13 20:31:11 +0300
commit89ae9f43f75bd235c8d91f59d4a5c28aa66bcf50 (patch)
tree617950910aede4f47983be58dc3b7b899199ce4f
parentaab6ebb72d249d08cb7b97b63c2938a7c61939fc (diff)
downloadlinux-89ae9f43f75bd235c8d91f59d4a5c28aa66bcf50.tar.gz
linux-89ae9f43f75bd235c8d91f59d4a5c28aa66bcf50.zip
net: stmmac: Implement RSS dependency from Rx COE feature
The driver permits toggling the NETIF_F_RXCSUM feature flag by the system user requests. In the meantime the RSS feature fully depends on the Rx Checksum Offload Engine to "parse the received packets and extract two or four L3/L4 tuples from them" [1]. So RSS won't work without Rx COE being enabled. Let's fix that by implementing the respective dependencies in the ndo_fix_features()/ndo_set_features() network device callbacks. [1] DesignWare Cores XGMAC - 10G Ethernet MAC Databook, Revision 3.20a, September 2022, p.263. Fixes: 76067459c686 ("net: stmmac: Implement RSS and enable it in XGMAC core") Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d78d2756a517..6b0fd17bd381 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6190,6 +6190,10 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev,
if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN))
features &= ~NETIF_F_CSUM_MASK;
+ /* RSS feature depends on Rx COE */
+ if (!(features & NETIF_F_RXCSUM))
+ features &= ~NETIF_F_RXHASH;
+
return features;
}
@@ -6224,6 +6228,8 @@ static int stmmac_set_features(struct net_device *netdev,
stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
}
+ stmmac_mac_config_rss(priv);
+
if (features & NETIF_F_HW_VLAN_CTAG_RX)
priv->hw->hw_vlan_en = true;
else