]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: txgbe: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Thu, 15 Jan 2026 14:37:56 +0000 (06:37 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 18 Jan 2026 02:10:16 +0000 (18:10 -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/20260115-grxring_big_v2-v1-9-b3e1b58bced5@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c

index f3cb0010952971a5e205aba7ef95845f7c5b227f..59d758acccf0b3d52ee60cce28f0dd0f9cb4ca68 100644 (file)
@@ -193,6 +193,13 @@ static int txgbe_get_ethtool_fdir_all(struct txgbe *txgbe,
        return 0;
 }
 
+static u32 txgbe_get_rx_ring_count(struct net_device *dev)
+{
+       struct wx *wx = netdev_priv(dev);
+
+       return wx->num_rx_queues;
+}
+
 static int txgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
                           u32 *rule_locs)
 {
@@ -201,10 +208,6 @@ static int txgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
        int ret = -EOPNOTSUPP;
 
        switch (cmd->cmd) {
-       case ETHTOOL_GRXRINGS:
-               cmd->data = wx->num_rx_queues;
-               ret = 0;
-               break;
        case ETHTOOL_GRXCLSRLCNT:
                cmd->rule_cnt = txgbe->fdir_filter_count;
                ret = 0;
@@ -587,6 +590,7 @@ static const struct ethtool_ops txgbe_ethtool_ops = {
        .set_channels           = txgbe_set_channels,
        .get_rxnfc              = txgbe_get_rxnfc,
        .set_rxnfc              = txgbe_set_rxnfc,
+       .get_rx_ring_count      = txgbe_get_rx_ring_count,
        .get_rxfh_fields        = wx_get_rxfh_fields,
        .set_rxfh_fields        = wx_set_rxfh_fields,
        .get_rxfh_indir_size    = wx_rss_indir_size,