]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: enic: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Fri, 9 Jan 2026 17:40:54 +0000 (09:40 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 10 Jan 2026 20:21:06 +0000 (12:21 -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/20260109-grxring_big_v1-v1-3-a0f77f732006@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cisco/enic/enic_ethtool.c

index a50f5dad34d5139c6a8d5c69e66361013b9715e9..471613899ec0e4d3cb99bc3ae1a38fa16d7d20dc 100644 (file)
@@ -573,6 +573,13 @@ static int enic_get_rx_flow_hash(struct net_device *dev,
        return 0;
 }
 
+static u32 enic_get_rx_ring_count(struct net_device *dev)
+{
+       struct enic *enic = netdev_priv(dev);
+
+       return enic->rq_count;
+}
+
 static int enic_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
                          u32 *rule_locs)
 {
@@ -580,9 +587,6 @@ static int enic_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
        int ret = 0;
 
        switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = enic->rq_count;
-               break;
        case ETHTOOL_GRXCLSRLCNT:
                spin_lock_bh(&enic->rfs_h.lock);
                cmd->rule_cnt = enic->rfs_h.max - enic->rfs_h.free;
@@ -689,6 +693,7 @@ static const struct ethtool_ops enic_ethtool_ops = {
        .get_coalesce = enic_get_coalesce,
        .set_coalesce = enic_set_coalesce,
        .get_rxnfc = enic_get_rxnfc,
+       .get_rx_ring_count = enic_get_rx_ring_count,
        .get_rxfh_key_size = enic_get_rxfh_key_size,
        .get_rxfh = enic_get_rxfh,
        .set_rxfh = enic_set_rxfh,