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

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-9-94dbe4dcaa10@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/sfc/falcon/ethtool.c

index 27d1cd6f24ca15d665f6a81c96a9b12bf2616e61..049364031545488304e83908569bdc0ba425a386 100644 (file)
@@ -974,6 +974,13 @@ ef4_ethtool_get_rxfh_fields(struct net_device *net_dev,
        return 0;
 }
 
+static u32 ef4_ethtool_get_rx_ring_count(struct net_device *net_dev)
+{
+       struct ef4_nic *efx = netdev_priv(net_dev);
+
+       return efx->n_rx_channels;
+}
+
 static int
 ef4_ethtool_get_rxnfc(struct net_device *net_dev,
                      struct ethtool_rxnfc *info, u32 *rule_locs)
@@ -981,10 +988,6 @@ ef4_ethtool_get_rxnfc(struct net_device *net_dev,
        struct ef4_nic *efx = netdev_priv(net_dev);
 
        switch (info->cmd) {
-       case ETHTOOL_GRXRINGS:
-               info->data = efx->n_rx_channels;
-               return 0;
-
        case ETHTOOL_GRXCLSRLCNT:
                info->data = ef4_filter_get_rx_id_limit(efx);
                if (info->data == 0)
@@ -1348,6 +1351,7 @@ const struct ethtool_ops ef4_ethtool_ops = {
        .reset                  = ef4_ethtool_reset,
        .get_rxnfc              = ef4_ethtool_get_rxnfc,
        .set_rxnfc              = ef4_ethtool_set_rxnfc,
+       .get_rx_ring_count      = ef4_ethtool_get_rx_ring_count,
        .get_rxfh_indir_size    = ef4_ethtool_get_rxfh_indir_size,
        .get_rxfh               = ef4_ethtool_get_rxfh,
        .set_rxfh               = ef4_ethtool_set_rxfh,