Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: convert to use .get_rx_ring_count

Convert the stmmac driver to use the new .get_rx_ring_count
ethtool operation instead of implementing .get_rxnfc for handling
ETHTOOL_GRXRINGS command.

Since stmmac_get_rxnfc() only handled ETHTOOL_GRXRINGS (returning
-EOPNOTSUPP for all other commands), remove it entirely and replace
it with the simpler stmmac_get_rx_ring_count() callback.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260108-gxring_stmicro-v2-1-3dcadc8ed29b@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
959728f9 6c7ff659

+3 -12
+3 -12
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
··· 914 914 return __stmmac_set_coalesce(dev, ec, queue); 915 915 } 916 916 917 - static int stmmac_get_rxnfc(struct net_device *dev, 918 - struct ethtool_rxnfc *rxnfc, u32 *rule_locs) 917 + static u32 stmmac_get_rx_ring_count(struct net_device *dev) 919 918 { 920 919 struct stmmac_priv *priv = netdev_priv(dev); 921 920 922 - switch (rxnfc->cmd) { 923 - case ETHTOOL_GRXRINGS: 924 - rxnfc->data = priv->plat->rx_queues_to_use; 925 - break; 926 - default: 927 - return -EOPNOTSUPP; 928 - } 929 - 930 - return 0; 921 + return priv->plat->rx_queues_to_use; 931 922 } 932 923 933 924 static u32 stmmac_get_rxfh_key_size(struct net_device *dev) ··· 1112 1121 .get_eee = stmmac_ethtool_op_get_eee, 1113 1122 .set_eee = stmmac_ethtool_op_set_eee, 1114 1123 .get_sset_count = stmmac_get_sset_count, 1115 - .get_rxnfc = stmmac_get_rxnfc, 1124 + .get_rx_ring_count = stmmac_get_rx_ring_count, 1116 1125 .get_rxfh_key_size = stmmac_get_rxfh_key_size, 1117 1126 .get_rxfh_indir_size = stmmac_get_rxfh_indir_size, 1118 1127 .get_rxfh = stmmac_get_rxfh,