]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: niu: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Fri, 9 Jan 2026 17:40:56 +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-5-a0f77f732006@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/sun/niu.c

index 893216b0e08dbcbea34113e34d188b343e5a373e..f035e3bbbef8d2ee876ddccff23f1b5bdb485f35 100644 (file)
@@ -7302,6 +7302,13 @@ static int niu_get_ethtool_tcam_all(struct niu *np,
        return ret;
 }
 
+static u32 niu_get_rx_ring_count(struct net_device *dev)
+{
+       struct niu *np = netdev_priv(dev);
+
+       return np->num_rx_rings;
+}
+
 static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
                       u32 *rule_locs)
 {
@@ -7309,9 +7316,6 @@ static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
        int ret = 0;
 
        switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = np->num_rx_rings;
-               break;
        case ETHTOOL_GRXCLSRLCNT:
                cmd->rule_cnt = tcam_get_valid_entry_cnt(np);
                break;
@@ -7928,6 +7932,7 @@ static const struct ethtool_ops niu_ethtool_ops = {
        .set_phys_id            = niu_set_phys_id,
        .get_rxnfc              = niu_get_nfc,
        .set_rxnfc              = niu_set_nfc,
+       .get_rx_ring_count      = niu_get_rx_ring_count,
        .get_rxfh_fields        = niu_get_rxfh_fields,
        .set_rxfh_fields        = niu_set_rxfh_fields,
        .get_link_ksettings     = niu_get_link_ksettings,