Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: vmxnet3: convert to use .get_rx_ring_count

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>

authored by

Breno Leitao and committed by
Jakub Kicinski
672cb5c2 6152f41d

+3 -15
+3 -15
drivers/net/vmxnet3/vmxnet3_ethtool.c
··· 1081 1081 return 0; 1082 1082 } 1083 1083 1084 - static int 1085 - vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info, 1086 - u32 *rules) 1084 + static u32 vmxnet3_get_rx_ring_count(struct net_device *netdev) 1087 1085 { 1088 1086 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1089 - int err = 0; 1090 1087 1091 - switch (info->cmd) { 1092 - case ETHTOOL_GRXRINGS: 1093 - info->data = adapter->num_rx_queues; 1094 - break; 1095 - default: 1096 - err = -EOPNOTSUPP; 1097 - break; 1098 - } 1099 - 1100 - return err; 1088 + return adapter->num_rx_queues; 1101 1089 } 1102 1090 1103 1091 #ifdef VMXNET3_RSS ··· 1323 1335 .get_ethtool_stats = vmxnet3_get_ethtool_stats, 1324 1336 .get_ringparam = vmxnet3_get_ringparam, 1325 1337 .set_ringparam = vmxnet3_set_ringparam, 1326 - .get_rxnfc = vmxnet3_get_rxnfc, 1338 + .get_rx_ring_count = vmxnet3_get_rx_ring_count, 1327 1339 #ifdef VMXNET3_RSS 1328 1340 .get_rxfh_indir_size = vmxnet3_get_rss_indir_size, 1329 1341 .get_rxfh = vmxnet3_get_rss,