]> Gentwo Git Trees - linux/.git/commitdiff
net: mvpp2: extract GRXRINGS from .get_rxnfc
authorBreno Leitao <leitao@debian.org>
Fri, 21 Nov 2025 17:02:36 +0000 (09:02 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Nov 2025 03:45:02 +0000 (19:45 -0800)
Commit 84eaf4359c36 ("net: ethtool: add get_rx_ring_count callback to
optimize RX ring queries") added specific support for GRXRINGS callback,
simplifying .get_rxnfc.

Remove the handling of GRXRINGS in .get_rxnfc() by moving it to the new
.get_rx_ring_count() for the mvpp2 driver.

This simplifies the RX ring count retrieval and aligns mvpp2 with the new
ethtool API for querying RX ring parameters, while keeping the other
rxnfc handlers (GRXCLSRLCNT, GRXCLSRULE, GRXCLSRLALL) intact.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251121-marvell-v1-2-8338f3e55a4c@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

index ab0c99aa9f9a5a9400f4f58c65c1294dd4c09090..33426fded919aeaed01a01a83d7f934a9e797ec6 100644 (file)
@@ -5580,6 +5580,13 @@ static int mvpp2_ethtool_set_link_ksettings(struct net_device *dev,
        return phylink_ethtool_ksettings_set(port->phylink, cmd);
 }
 
+static u32 mvpp2_ethtool_get_rx_ring_count(struct net_device *dev)
+{
+       struct mvpp2_port *port = netdev_priv(dev);
+
+       return port->nrxqs;
+}
+
 static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,
                                   struct ethtool_rxnfc *info, u32 *rules)
 {
@@ -5590,9 +5597,6 @@ static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,
                return -EOPNOTSUPP;
 
        switch (info->cmd) {
-       case ETHTOOL_GRXRINGS:
-               info->data = port->nrxqs;
-               break;
        case ETHTOOL_GRXCLSRLCNT:
                info->rule_cnt = port->n_rfs_rules;
                break;
@@ -5827,6 +5831,7 @@ static const struct ethtool_ops mvpp2_eth_tool_ops = {
        .set_pauseparam         = mvpp2_ethtool_set_pause_param,
        .get_link_ksettings     = mvpp2_ethtool_get_link_ksettings,
        .set_link_ksettings     = mvpp2_ethtool_set_link_ksettings,
+       .get_rx_ring_count      = mvpp2_ethtool_get_rx_ring_count,
        .get_rxnfc              = mvpp2_ethtool_get_rxnfc,
        .set_rxnfc              = mvpp2_ethtool_set_rxnfc,
        .get_rxfh_indir_size    = mvpp2_ethtool_get_rxfh_indir_size,