From: Breno Leitao <leitao@debian.org>
To: Andrew Lunn <andrew@lunn.ch>, Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, Breno Leitao <leitao@debian.org>
Subject: [PATCH net-next] ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc
Date: Mon, 26 Jan 2026 02:00:15 -0800 [thread overview]
Message-ID: <20260126-grxring_final-v1-1-0981cb24512e@debian.org> (raw)
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>
next reply other threads:[~2026-01-26 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 10:00 Breno Leitao [this message]
2026-01-28 1:40 ` [PATCH net-next] ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260126-grxring_final-v1-1-0981cb24512e@debian.org \
--to=leitao@debian.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox