]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: mvneta: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Fri, 21 Nov 2025 17:02:35 +0000 (09:02 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Nov 2025 03:45:02 +0000 (19:45 -0800)
Convert the mvneta driver to use the new .get_rx_ring_count ethtool
operation instead of implementing .get_rxnfc solely for handling
ETHTOOL_GRXRINGS command. This simplifies the code by removing the
switch statement and replacing it with a direct return of the queue
count.

The new callback provides the same functionality in a more direct way,
following the ongoing ethtool API modernization.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251121-marvell-v1-1-8338f3e55a4c@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/mvneta.c

index 89ccb8eb82c7def61f6a4ffdfb7b1d96af3355e2..7af44f858fa3b1fec9225924525d0a842fa0da17 100644 (file)
@@ -5012,17 +5012,9 @@ static u32 mvneta_ethtool_get_rxfh_indir_size(struct net_device *dev)
        return MVNETA_RSS_LU_TABLE_SIZE;
 }
 
-static int mvneta_ethtool_get_rxnfc(struct net_device *dev,
-                                   struct ethtool_rxnfc *info,
-                                   u32 *rules __always_unused)
+static u32 mvneta_ethtool_get_rx_ring_count(struct net_device *dev)
 {
-       switch (info->cmd) {
-       case ETHTOOL_GRXRINGS:
-               info->data =  rxq_number;
-               return 0;
-       default:
-               return -EOPNOTSUPP;
-       }
+       return rxq_number;
 }
 
 static int  mvneta_config_rss(struct mvneta_port *pp)
@@ -5356,7 +5348,7 @@ static const struct ethtool_ops mvneta_eth_tool_ops = {
        .get_ethtool_stats = mvneta_ethtool_get_stats,
        .get_sset_count = mvneta_ethtool_get_sset_count,
        .get_rxfh_indir_size = mvneta_ethtool_get_rxfh_indir_size,
-       .get_rxnfc      = mvneta_ethtool_get_rxnfc,
+       .get_rx_ring_count = mvneta_ethtool_get_rx_ring_count,
        .get_rxfh       = mvneta_ethtool_get_rxfh,
        .set_rxfh       = mvneta_ethtool_set_rxfh,
        .get_link_ksettings = mvneta_ethtool_get_link_ksettings,