public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc
@ 2026-01-26 10:00 Breno Leitao
  2026-01-28  1:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Breno Leitao @ 2026-01-26 10:00 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman
  Cc: netdev, linux-kernel, kernel-team, Breno Leitao

All drivers that need to report the RX ring count now implement the
get_rx_ring_count callback directly. Remove the legacy fallback path
that obtained this information by calling get_rxnfc with ETHTOOL_GRXRINGS.

This simplifies the code and makes get_rx_ring_count the only way
to retrieve the RX ring count.

Note: ethtool_get_rx_ring_count() returns int to allow returning
-EOPNOTSUPP, while the callback returns u32. The implicit conversion
is safe since RX ring counts will not exceed INT_MAX while we are still
alive.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 net/ethtool/common.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 4036561b078b5..c5ed88bccbb41 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -637,21 +637,11 @@ int __ethtool_get_link(struct net_device *dev)
 int ethtool_get_rx_ring_count(struct net_device *dev)
 {
 	const struct ethtool_ops *ops = dev->ethtool_ops;
-	struct ethtool_rxnfc rx_rings = {};
-	int ret;
-
-	if (ops->get_rx_ring_count)
-		return ops->get_rx_ring_count(dev);
 
-	if (!ops->get_rxnfc)
+	if (!ops->get_rx_ring_count)
 		return -EOPNOTSUPP;
 
-	rx_rings.cmd = ETHTOOL_GRXRINGS;
-	ret = ops->get_rxnfc(dev, &rx_rings, NULL);
-	if (ret < 0)
-		return ret;
-
-	return rx_rings.data;
+	return ops->get_rx_ring_count(dev);
 }
 
 static int ethtool_get_rxnfc_rule_count(struct net_device *dev)

---
base-commit: bf2e36c9dab95e41516fbcf7b1cc804539b2d021
change-id: 20260126-grxring_final-e203b87c5d03

Best regards,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc
  2026-01-26 10:00 [PATCH net-next] ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc Breno Leitao
@ 2026-01-28  1:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-28  1:40 UTC (permalink / raw)
  To: Breno Leitao
  Cc: andrew, kuba, davem, edumazet, pabeni, horms, netdev,
	linux-kernel, kernel-team

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 26 Jan 2026 02:00:15 -0800 you wrote:
> All drivers that need to report the RX ring count now implement the
> get_rx_ring_count callback directly. Remove the legacy fallback path
> that obtained this information by calling get_rxnfc with ETHTOOL_GRXRINGS.
> 
> This simplifies the code and makes get_rx_ring_count the only way
> to retrieve the RX ring count.
> 
> [...]

Here is the summary with links:
  - [net-next] ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc
    https://git.kernel.org/netdev/net-next/c/1f6b527baf6f

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:[~2026-01-28  1:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 10:00 [PATCH net-next] ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc Breno Leitao
2026-01-28  1:40 ` 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