]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: bnxt: extract GRXRINGS from .get_rxnfc
authorBreno Leitao <leitao@debian.org>
Thu, 27 Nov 2025 10:17:15 +0000 (02:17 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 29 Nov 2025 03:56:22 +0000 (19:56 -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().

This simplifies the RX ring count retrieval and aligns bnxt with the new
ethtool API for querying RX ring parameters.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251127-grxrings_broadcom-v1-1-b0b182864950@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index efb9bf20e66b023400004f2a15d5b05af52f824c..068e191ede19e63c3e172ff24f19ace6cde3f94d 100644 (file)
@@ -1770,6 +1770,13 @@ static int bnxt_set_rxfh_fields(struct net_device *dev,
        return rc;
 }
 
+static u32 bnxt_get_rx_ring_count(struct net_device *dev)
+{
+       struct bnxt *bp = netdev_priv(dev);
+
+       return bp->rx_nr_rings;
+}
+
 static int bnxt_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
                          u32 *rule_locs)
 {
@@ -1777,10 +1784,6 @@ static int bnxt_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
        int rc = 0;
 
        switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = bp->rx_nr_rings;
-               break;
-
        case ETHTOOL_GRXCLSRLCNT:
                cmd->rule_cnt = bp->ntp_fltr_count;
                cmd->data = bp->max_fltr | RX_CLS_LOC_SPECIAL;
@@ -5616,6 +5619,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {
        .set_channels           = bnxt_set_channels,
        .get_rxnfc              = bnxt_get_rxnfc,
        .set_rxnfc              = bnxt_set_rxnfc,
+       .get_rx_ring_count      = bnxt_get_rx_ring_count,
        .get_rxfh_indir_size    = bnxt_get_rxfh_indir_size,
        .get_rxfh_key_size      = bnxt_get_rxfh_key_size,
        .get_rxfh               = bnxt_get_rxfh,