]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: mana: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Thu, 22 Jan 2026 18:40:16 +0000 (10:40 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Jan 2026 18:53:05 +0000 (10:53 -0800)
Use the newly introduced .get_rx_ring_count ethtool ops callback instead
of handling ETHTOOL_GRXRINGS directly in .get_rxnfc().

Since ETHTOOL_GRXRINGS was the only command handled by mana_get_rxnfc(),
remove the function entirely.

Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Link: https://patch.msgid.link/20260122-grxring_big_v4-v2-4-94dbe4dcaa10@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/mana_ethtool.c

index 0e2f4343ac67fe6246d9d06eefbb979eeb10cddc..f2d220b371b5d0b4c227599a6428bacf351ee771 100644 (file)
@@ -282,18 +282,11 @@ static void mana_get_ethtool_stats(struct net_device *ndev,
        }
 }
 
-static int mana_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *cmd,
-                         u32 *rules)
+static u32 mana_get_rx_ring_count(struct net_device *ndev)
 {
        struct mana_port_context *apc = netdev_priv(ndev);
 
-       switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = apc->num_queues;
-               return 0;
-       }
-
-       return -EOPNOTSUPP;
+       return apc->num_queues;
 }
 
 static u32 mana_get_rxfh_key_size(struct net_device *ndev)
@@ -520,7 +513,7 @@ const struct ethtool_ops mana_ethtool_ops = {
        .get_ethtool_stats      = mana_get_ethtool_stats,
        .get_sset_count         = mana_get_sset_count,
        .get_strings            = mana_get_strings,
-       .get_rxnfc              = mana_get_rxnfc,
+       .get_rx_ring_count      = mana_get_rx_ring_count,
        .get_rxfh_key_size      = mana_get_rxfh_key_size,
        .get_rxfh_indir_size    = mana_rss_indir_size,
        .get_rxfh               = mana_get_rxfh,