* [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks
@ 2025-11-21 17:02 Breno Leitao
2025-11-21 17:02 ` [PATCH net-next 1/2] net: mvneta: convert to use .get_rx_ring_count Breno Leitao
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Breno Leitao @ 2025-11-21 17:02 UTC (permalink / raw)
To: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King
Cc: netdev, linux-kernel, kernel-team, Breno Leitao
This series converts the Marvell mvneta and mvpp2 drivers to use the new
.get_rx_ring_count ethtool operation, following the ongoing modernization
of the ethtool API introduced in commit 84eaf4359c36 ("net: ethtool: add
get_rx_ring_count callback to optimize RX ring queries").
The conversion simplifies the code by replacing the generic .get_rxnfc
callback with the more specific .get_rx_ring_count callback for retrieving
RX ring counts. For mvneta, this completely removes .get_rxnfc since it
only handled ETHTOOL_GRXRINGS. For mvpp2, the GRXRINGS case is extracted
while keeping other rxnfc handlers intact.
PS: These changes were compile-tested only.
---
Breno Leitao (2):
net: mvneta: convert to use .get_rx_ring_count
net: mvpp2: extract GRXRINGS from .get_rxnfc
drivers/net/ethernet/marvell/mvneta.c | 14 +++-----------
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 11 ++++++++---
2 files changed, 11 insertions(+), 14 deletions(-)
---
base-commit: e2c20036a8879476c88002730d8a27f4e3c32d4b
change-id: 20251121-marvell-0264eb5b214a
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] net: mvneta: convert to use .get_rx_ring_count
2025-11-21 17:02 [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks Breno Leitao
@ 2025-11-21 17:02 ` Breno Leitao
2025-11-21 17:02 ` [PATCH net-next 2/2] net: mvpp2: extract GRXRINGS from .get_rxnfc Breno Leitao
2025-11-25 3:50 ` [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Breno Leitao @ 2025-11-21 17:02 UTC (permalink / raw)
To: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King
Cc: netdev, linux-kernel, kernel-team, Breno Leitao
Convert the mvneta 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>
---
drivers/net/ethernet/marvell/mvneta.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 89ccb8eb82c7..7af44f858fa3 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -5012,17 +5012,9 @@ static u32 mvneta_ethtool_get_rxfh_indir_size(struct net_device *dev)
return MVNETA_RSS_LU_TABLE_SIZE;
}
-static int mvneta_ethtool_get_rxnfc(struct net_device *dev,
- struct ethtool_rxnfc *info,
- u32 *rules __always_unused)
+static u32 mvneta_ethtool_get_rx_ring_count(struct net_device *dev)
{
- switch (info->cmd) {
- case ETHTOOL_GRXRINGS:
- info->data = rxq_number;
- return 0;
- default:
- return -EOPNOTSUPP;
- }
+ return rxq_number;
}
static int mvneta_config_rss(struct mvneta_port *pp)
@@ -5356,7 +5348,7 @@ static const struct ethtool_ops mvneta_eth_tool_ops = {
.get_ethtool_stats = mvneta_ethtool_get_stats,
.get_sset_count = mvneta_ethtool_get_sset_count,
.get_rxfh_indir_size = mvneta_ethtool_get_rxfh_indir_size,
- .get_rxnfc = mvneta_ethtool_get_rxnfc,
+ .get_rx_ring_count = mvneta_ethtool_get_rx_ring_count,
.get_rxfh = mvneta_ethtool_get_rxfh,
.set_rxfh = mvneta_ethtool_set_rxfh,
.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] net: mvpp2: extract GRXRINGS from .get_rxnfc
2025-11-21 17:02 [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks Breno Leitao
2025-11-21 17:02 ` [PATCH net-next 1/2] net: mvneta: convert to use .get_rx_ring_count Breno Leitao
@ 2025-11-21 17:02 ` Breno Leitao
2025-11-25 3:50 ` [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Breno Leitao @ 2025-11-21 17:02 UTC (permalink / raw)
To: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King
Cc: netdev, linux-kernel, kernel-team, Breno Leitao
Commit 84eaf4359c36 ("net: ethtool: add get_rx_ring_count callback to
optimize RX ring queries") added specific support for GRXRINGS callback,
simplifying .get_rxnfc.
Remove the handling of GRXRINGS in .get_rxnfc() by moving it to the new
.get_rx_ring_count() for the mvpp2 driver.
This simplifies the RX ring count retrieval and aligns mvpp2 with the new
ethtool API for querying RX ring parameters, while keeping the other
rxnfc handlers (GRXCLSRLCNT, GRXCLSRULE, GRXCLSRLALL) intact.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index ab0c99aa9f9a..33426fded919 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -5580,6 +5580,13 @@ static int mvpp2_ethtool_set_link_ksettings(struct net_device *dev,
return phylink_ethtool_ksettings_set(port->phylink, cmd);
}
+static u32 mvpp2_ethtool_get_rx_ring_count(struct net_device *dev)
+{
+ struct mvpp2_port *port = netdev_priv(dev);
+
+ return port->nrxqs;
+}
+
static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,
struct ethtool_rxnfc *info, u32 *rules)
{
@@ -5590,9 +5597,6 @@ static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,
return -EOPNOTSUPP;
switch (info->cmd) {
- case ETHTOOL_GRXRINGS:
- info->data = port->nrxqs;
- break;
case ETHTOOL_GRXCLSRLCNT:
info->rule_cnt = port->n_rfs_rules;
break;
@@ -5827,6 +5831,7 @@ static const struct ethtool_ops mvpp2_eth_tool_ops = {
.set_pauseparam = mvpp2_ethtool_set_pause_param,
.get_link_ksettings = mvpp2_ethtool_get_link_ksettings,
.set_link_ksettings = mvpp2_ethtool_set_link_ksettings,
+ .get_rx_ring_count = mvpp2_ethtool_get_rx_ring_count,
.get_rxnfc = mvpp2_ethtool_get_rxnfc,
.set_rxnfc = mvpp2_ethtool_set_rxnfc,
.get_rxfh_indir_size = mvpp2_ethtool_get_rxfh_indir_size,
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks
2025-11-21 17:02 [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks Breno Leitao
2025-11-21 17:02 ` [PATCH net-next 1/2] net: mvneta: convert to use .get_rx_ring_count Breno Leitao
2025-11-21 17:02 ` [PATCH net-next 2/2] net: mvpp2: extract GRXRINGS from .get_rxnfc Breno Leitao
@ 2025-11-25 3:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-25 3:50 UTC (permalink / raw)
To: Breno Leitao
Cc: marcin.s.wojtas, andrew+netdev, davem, edumazet, kuba, pabeni,
linux, netdev, linux-kernel, kernel-team
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 21 Nov 2025 09:02:34 -0800 you wrote:
> This series converts the Marvell mvneta and mvpp2 drivers to use the new
> .get_rx_ring_count ethtool operation, following the ongoing modernization
> of the ethtool API introduced in commit 84eaf4359c36 ("net: ethtool: add
> get_rx_ring_count callback to optimize RX ring queries").
>
> The conversion simplifies the code by replacing the generic .get_rxnfc
> callback with the more specific .get_rx_ring_count callback for retrieving
> RX ring counts. For mvneta, this completely removes .get_rxnfc since it
> only handled ETHTOOL_GRXRINGS. For mvpp2, the GRXRINGS case is extracted
> while keeping other rxnfc handlers intact.
>
> [...]
Here is the summary with links:
- [net-next,1/2] net: mvneta: convert to use .get_rx_ring_count
https://git.kernel.org/netdev/net-next/c/737e14c5dce3
- [net-next,2/2] net: mvpp2: extract GRXRINGS from .get_rxnfc
https://git.kernel.org/netdev/net-next/c/20c20f05cf50
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] 4+ messages in thread
end of thread, other threads:[~2025-11-25 3:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-21 17:02 [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks Breno Leitao
2025-11-21 17:02 ` [PATCH net-next 1/2] net: mvneta: convert to use .get_rx_ring_count Breno Leitao
2025-11-21 17:02 ` [PATCH net-next 2/2] net: mvpp2: extract GRXRINGS from .get_rxnfc Breno Leitao
2025-11-25 3:50 ` [PATCH net-next 0/2] net: marvell: modernize RX ring count ethtool callbacks 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
all inboxes | Powered by JetHome®