]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: tsnep: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Thu, 15 Jan 2026 14:37:49 +0000 (06:37 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 18 Jan 2026 02:10:15 +0000 (18:10 -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>
Link: https://patch.msgid.link/20260115-grxring_big_v2-v1-2-b3e1b58bced5@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/engleder/tsnep_ethtool.c

index 228a638eae1698f264fefffa515b1ae71c5d95fb..d11168278515db2ae85c925009328e96936b592f 100644 (file)
@@ -257,15 +257,19 @@ static int tsnep_ethtool_get_sset_count(struct net_device *netdev, int sset)
        }
 }
 
+static u32 tsnep_ethtool_get_rx_ring_count(struct net_device *netdev)
+{
+       struct tsnep_adapter *adapter = netdev_priv(netdev);
+
+       return adapter->num_rx_queues;
+}
+
 static int tsnep_ethtool_get_rxnfc(struct net_device *netdev,
                                   struct ethtool_rxnfc *cmd, u32 *rule_locs)
 {
        struct tsnep_adapter *adapter = netdev_priv(netdev);
 
        switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = adapter->num_rx_queues;
-               return 0;
        case ETHTOOL_GRXCLSRLCNT:
                cmd->rule_cnt = adapter->rxnfc_count;
                cmd->data = adapter->rxnfc_max;
@@ -469,6 +473,7 @@ const struct ethtool_ops tsnep_ethtool_ops = {
        .get_sset_count = tsnep_ethtool_get_sset_count,
        .get_rxnfc = tsnep_ethtool_get_rxnfc,
        .set_rxnfc = tsnep_ethtool_set_rxnfc,
+       .get_rx_ring_count = tsnep_ethtool_get_rx_ring_count,
        .get_channels = tsnep_ethtool_get_channels,
        .get_ts_info = tsnep_ethtool_get_ts_info,
        .get_coalesce = tsnep_ethtool_get_coalesce,