]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: vmxnet3: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Tue, 18 Nov 2025 09:44:56 +0000 (01:44 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 20 Nov 2025 04:14:21 +0000 (20:14 -0800)
Convert the vmxnet3 driver to use the new .get_rx_ring_count ethtool
operation instead of implementing .get_rxnfc solely for handling
ETHTOOL_GRXRINGS command. This simplifies the code by removing the
switch statement and replacing it with a direct return of the queue
count.

The new callback provides the same functionality in a more direct way,
following the ongoing ethtool API modernization.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251118-vmxnet3_grxrings-v1-1-ed8abddd2d52@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/vmxnet3/vmxnet3_ethtool.c

index cc4d7573839dd1cd590f127dd371f35ce6be3174..a14d0ad978e1507150e4c011c86f3e2cef95c60f 100644 (file)
@@ -1081,23 +1081,11 @@ vmxnet3_set_rss_hash_opt(struct net_device *netdev,
        return 0;
 }
 
-static int
-vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
-                 u32 *rules)
+static u32 vmxnet3_get_rx_ring_count(struct net_device *netdev)
 {
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
-       int err = 0;
-
-       switch (info->cmd) {
-       case ETHTOOL_GRXRINGS:
-               info->data = adapter->num_rx_queues;
-               break;
-       default:
-               err = -EOPNOTSUPP;
-               break;
-       }
 
-       return err;
+       return adapter->num_rx_queues;
 }
 
 #ifdef VMXNET3_RSS
@@ -1335,7 +1323,7 @@ static const struct ethtool_ops vmxnet3_ethtool_ops = {
        .get_ethtool_stats = vmxnet3_get_ethtool_stats,
        .get_ringparam     = vmxnet3_get_ringparam,
        .set_ringparam     = vmxnet3_set_ringparam,
-       .get_rxnfc         = vmxnet3_get_rxnfc,
+       .get_rx_ring_count = vmxnet3_get_rx_ring_count,
 #ifdef VMXNET3_RSS
        .get_rxfh_indir_size = vmxnet3_get_rss_indir_size,
        .get_rxfh          = vmxnet3_get_rss,