* [PATCH net-next] net: hyperv: convert to use .get_rx_ring_count
@ 2025-11-21 9:59 Breno Leitao
2025-11-25 3:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Breno Leitao @ 2025-11-21 9:59 UTC (permalink / raw)
To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: linux-hyperv, netdev, linux-kernel, kernel-team, Breno Leitao
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>
---
Note: This was compile-tested only.
---
drivers/net/hyperv/netvsc_drv.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 39c892e46cb0..3d47d749ef9f 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1624,22 +1624,15 @@ netvsc_get_rxfh_fields(struct net_device *ndev,
return 0;
}
-static int
-netvsc_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
- u32 *rules)
+static u32 netvsc_get_rx_ring_count(struct net_device *dev)
{
struct net_device_context *ndc = netdev_priv(dev);
struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev);
if (!nvdev)
- return -ENODEV;
-
- switch (info->cmd) {
- case ETHTOOL_GRXRINGS:
- info->data = nvdev->num_chn;
return 0;
- }
- return -EOPNOTSUPP;
+
+ return nvdev->num_chn;
}
static int
@@ -1969,7 +1962,7 @@ static const struct ethtool_ops ethtool_ops = {
.get_channels = netvsc_get_channels,
.set_channels = netvsc_set_channels,
.get_ts_info = ethtool_op_get_ts_info,
- .get_rxnfc = netvsc_get_rxnfc,
+ .get_rx_ring_count = netvsc_get_rx_ring_count,
.get_rxfh_key_size = netvsc_get_rxfh_key_size,
.get_rxfh_indir_size = netvsc_rss_indir_size,
.get_rxfh = netvsc_get_rxfh,
---
base-commit: e2c20036a8879476c88002730d8a27f4e3c32d4b
change-id: 20251118-hyperv_gxrings-1285e8fa7407
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next] net: hyperv: convert to use .get_rx_ring_count
2025-11-21 9:59 [PATCH net-next] net: hyperv: convert to use .get_rx_ring_count Breno Leitao
@ 2025-11-25 3:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-25 3:50 UTC (permalink / raw)
To: Breno Leitao
Cc: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
kuba, pabeni, linux-hyperv, netdev, linux-kernel, kernel-team
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 21 Nov 2025 01:59:23 -0800 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net-next] net: hyperv: convert to use .get_rx_ring_count
https://git.kernel.org/netdev/net-next/c/a8ff4842da50
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-25 3:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 9:59 [PATCH net-next] net: hyperv: convert to use .get_rx_ring_count Breno Leitao
2025-11-25 3:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).