]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: macb: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Thu, 15 Jan 2026 14:37:55 +0000 (06:37 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 18 Jan 2026 02:10:16 +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-8-b3e1b58bced5@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c

index 2d5f3eb0953038dfcbb28db591227cbe5f6e80f0..8135c5c2a51acf8ae6fff49159e7c4739a7c844d 100644 (file)
@@ -3850,6 +3850,13 @@ static int gem_get_all_flow_entries(struct net_device *netdev,
        return 0;
 }
 
+static u32 gem_get_rx_ring_count(struct net_device *netdev)
+{
+       struct macb *bp = netdev_priv(netdev);
+
+       return bp->num_queues;
+}
+
 static int gem_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
                u32 *rule_locs)
 {
@@ -3857,9 +3864,6 @@ static int gem_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
        int ret = 0;
 
        switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = bp->num_queues;
-               break;
        case ETHTOOL_GRXCLSRLCNT:
                cmd->rule_cnt = bp->rx_fs_list.count;
                break;
@@ -3941,6 +3945,7 @@ static const struct ethtool_ops gem_ethtool_ops = {
        .set_ringparam          = macb_set_ringparam,
        .get_rxnfc                      = gem_get_rxnfc,
        .set_rxnfc                      = gem_set_rxnfc,
+       .get_rx_ring_count              = gem_get_rx_ring_count,
 };
 
 static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)