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

Configure Feed

Select the types of activity you want to include in your feed.

net: thunder: convert to use .get_rx_ring_count

Convert the Cavium Thunder NIC VF 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/20251126-gxring_cavium-v1-1-a066c0c9e0c6@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
73880e66 8048168d

+3 -13
+3 -13
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
··· 541 541 return 0; 542 542 } 543 543 544 - static int nicvf_get_rxnfc(struct net_device *dev, 545 - struct ethtool_rxnfc *info, u32 *rules) 544 + static u32 nicvf_get_rx_ring_count(struct net_device *dev) 546 545 { 547 546 struct nicvf *nic = netdev_priv(dev); 548 - int ret = -EOPNOTSUPP; 549 547 550 - switch (info->cmd) { 551 - case ETHTOOL_GRXRINGS: 552 - info->data = nic->rx_queues; 553 - ret = 0; 554 - break; 555 - default: 556 - break; 557 - } 558 - return ret; 548 + return nic->rx_queues; 559 549 } 560 550 561 551 static int nicvf_set_rxfh_fields(struct net_device *dev, ··· 851 861 .get_coalesce = nicvf_get_coalesce, 852 862 .get_ringparam = nicvf_get_ringparam, 853 863 .set_ringparam = nicvf_set_ringparam, 854 - .get_rxnfc = nicvf_get_rxnfc, 864 + .get_rx_ring_count = nicvf_get_rx_ring_count, 855 865 .get_rxfh_key_size = nicvf_get_rxfh_key_size, 856 866 .get_rxfh_indir_size = nicvf_get_rxfh_indir_size, 857 867 .get_rxfh = nicvf_get_rxfh,