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: hyperv: convert to use .get_rx_ring_count

Convert the hyperv netvsc 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 replacing the
switch statement 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/20251121-hyperv_gxrings-v1-1-31293104953b@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
a8ff4842 ec1e48e9

+4 -11
+4 -11
drivers/net/hyperv/netvsc_drv.c
··· 1624 1624 return 0; 1625 1625 } 1626 1626 1627 - static int 1628 - netvsc_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, 1629 - u32 *rules) 1627 + static u32 netvsc_get_rx_ring_count(struct net_device *dev) 1630 1628 { 1631 1629 struct net_device_context *ndc = netdev_priv(dev); 1632 1630 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); 1633 1631 1634 1632 if (!nvdev) 1635 - return -ENODEV; 1636 - 1637 - switch (info->cmd) { 1638 - case ETHTOOL_GRXRINGS: 1639 - info->data = nvdev->num_chn; 1640 1633 return 0; 1641 - } 1642 - return -EOPNOTSUPP; 1634 + 1635 + return nvdev->num_chn; 1643 1636 } 1644 1637 1645 1638 static int ··· 1962 1969 .get_channels = netvsc_get_channels, 1963 1970 .set_channels = netvsc_set_channels, 1964 1971 .get_ts_info = ethtool_op_get_ts_info, 1965 - .get_rxnfc = netvsc_get_rxnfc, 1972 + .get_rx_ring_count = netvsc_get_rx_ring_count, 1966 1973 .get_rxfh_key_size = netvsc_get_rxfh_key_size, 1967 1974 .get_rxfh_indir_size = netvsc_rss_indir_size, 1968 1975 .get_rxfh = netvsc_get_rxfh,