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

Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
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-3-94dbe4dcaa10@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c

index 16c828dd5c1a3f83beeeba217eef6c7c5684c150..e88b1c4732a574e412c370d823f60bea0d06329c 100644 (file)
@@ -1435,15 +1435,19 @@ static int nfp_net_get_fs_loc(struct nfp_net *nn, u32 *rule_locs)
        return 0;
 }
 
+static u32 nfp_net_get_rx_ring_count(struct net_device *netdev)
+{
+       struct nfp_net *nn = netdev_priv(netdev);
+
+       return nn->dp.num_rx_rings;
+}
+
 static int nfp_net_get_rxnfc(struct net_device *netdev,
                             struct ethtool_rxnfc *cmd, u32 *rule_locs)
 {
        struct nfp_net *nn = netdev_priv(netdev);
 
        switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = nn->dp.num_rx_rings;
-               return 0;
        case ETHTOOL_GRXCLSRLCNT:
                cmd->rule_cnt = nn->fs.count;
                return 0;
@@ -2501,6 +2505,7 @@ static const struct ethtool_ops nfp_net_ethtool_ops = {
        .get_sset_count         = nfp_net_get_sset_count,
        .get_rxnfc              = nfp_net_get_rxnfc,
        .set_rxnfc              = nfp_net_set_rxnfc,
+       .get_rx_ring_count      = nfp_net_get_rx_ring_count,
        .get_rxfh_indir_size    = nfp_net_get_rxfh_indir_size,
        .get_rxfh_key_size      = nfp_net_get_rxfh_key_size,
        .get_rxfh               = nfp_net_get_rxfh,