* [PATCH net-next 1/3] net: gianfar: convert to use .get_rx_ring_count
2025-11-28 13:11 [PATCH net-next 0/3] net: freescale: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
@ 2025-11-28 13:11 ` Breno Leitao
2025-11-30 15:21 ` Simon Horman
2025-11-28 13:11 ` [PATCH net-next 2/3] net: dpaa2: " Breno Leitao
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Breno Leitao @ 2025-11-28 13:11 UTC (permalink / raw)
To: Claudiu Manoil, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Ioana Ciornei, Vladimir Oltean,
Wei Fang, Clark Wang
Cc: netdev, linux-kernel, imx, Breno Leitao
Convert the gianfar driver to use the new .get_rx_ring_count
ethtool operation instead of implementing .get_rxnfc for handling
ETHTOOL_GRXRINGS command. This simplifies the code by removing the
ETHTOOL_GRXRINGS case from the switch statement and replacing it with
a direct return of the queue count.
The driver still maintains .get_rxnfc for other commands including
ETHTOOL_GRXCLSRLCNT, ETHTOOL_GRXCLSRULE, and ETHTOOL_GRXCLSRLALL.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
drivers/net/ethernet/freescale/gianfar_ethtool.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 5fd1f7327680..6fa752d3b60d 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -1431,6 +1431,13 @@ static int gfar_set_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
return ret;
}
+static u32 gfar_get_rx_ring_count(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+
+ return priv->num_rx_queues;
+}
+
static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
u32 *rule_locs)
{
@@ -1438,9 +1445,6 @@ static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
int ret = 0;
switch (cmd->cmd) {
- case ETHTOOL_GRXRINGS:
- cmd->data = priv->num_rx_queues;
- break;
case ETHTOOL_GRXCLSRLCNT:
cmd->rule_cnt = priv->rx_list.count;
break;
@@ -1519,6 +1523,7 @@ const struct ethtool_ops gfar_ethtool_ops = {
#endif
.set_rxnfc = gfar_set_nfc,
.get_rxnfc = gfar_get_nfc,
+ .get_rx_ring_count = gfar_get_rx_ring_count,
.set_rxfh_fields = gfar_set_rxfh_fields,
.get_ts_info = gfar_get_ts_info,
.get_link_ksettings = phy_ethtool_get_link_ksettings,
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next 1/3] net: gianfar: convert to use .get_rx_ring_count
2025-11-28 13:11 ` [PATCH net-next 1/3] net: gianfar: convert to use .get_rx_ring_count Breno Leitao
@ 2025-11-30 15:21 ` Simon Horman
0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2025-11-30 15:21 UTC (permalink / raw)
To: Breno Leitao
Cc: Claudiu Manoil, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Ioana Ciornei, Vladimir Oltean,
Wei Fang, Clark Wang, netdev, linux-kernel, imx
On Fri, Nov 28, 2025 at 05:11:45AM -0800, Breno Leitao wrote:
> Convert the gianfar driver to use the new .get_rx_ring_count
> ethtool operation instead of implementing .get_rxnfc for handling
> ETHTOOL_GRXRINGS command. This simplifies the code by removing the
> ETHTOOL_GRXRINGS case from the switch statement and replacing it with
> a direct return of the queue count.
>
> The driver still maintains .get_rxnfc for other commands including
> ETHTOOL_GRXCLSRLCNT, ETHTOOL_GRXCLSRULE, and ETHTOOL_GRXCLSRLALL.
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 2/3] net: dpaa2: convert to use .get_rx_ring_count
2025-11-28 13:11 [PATCH net-next 0/3] net: freescale: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
2025-11-28 13:11 ` [PATCH net-next 1/3] net: gianfar: convert to use .get_rx_ring_count Breno Leitao
@ 2025-11-28 13:11 ` Breno Leitao
2025-11-30 15:21 ` Simon Horman
2025-11-28 13:11 ` [PATCH net-next 3/3] net: enetc: " Breno Leitao
2025-12-01 20:00 ` [PATCH net-next 0/3] net: freescale: migrate to .get_rx_ring_count() ethtool callback patchwork-bot+netdevbpf
3 siblings, 1 reply; 8+ messages in thread
From: Breno Leitao @ 2025-11-28 13:11 UTC (permalink / raw)
To: Claudiu Manoil, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Ioana Ciornei, Vladimir Oltean,
Wei Fang, Clark Wang
Cc: netdev, linux-kernel, imx, Breno Leitao
Convert the dpaa2 driver to use the new .get_rx_ring_count
ethtool operation instead of implementing .get_rxnfc for handling
ETHTOOL_GRXRINGS command. This simplifies the code by removing the
ETHTOOL_GRXRINGS case from the switch statement and replacing it with
a direct return of the queue count.
The driver still maintains .get_rxnfc for other commands including
ETHTOOL_GRXCLSRLCNT, ETHTOOL_GRXCLSRULE, and ETHTOOL_GRXCLSRLALL.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
index 00474ed11d53..baab4f1c908d 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
@@ -711,6 +711,13 @@ static int dpaa2_eth_update_cls_rule(struct net_device *net_dev,
return 0;
}
+static u32 dpaa2_eth_get_rx_ring_count(struct net_device *net_dev)
+{
+ struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
+
+ return dpaa2_eth_queue_count(priv);
+}
+
static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
struct ethtool_rxnfc *rxnfc, u32 *rule_locs)
{
@@ -719,9 +726,6 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
int i, j = 0;
switch (rxnfc->cmd) {
- case ETHTOOL_GRXRINGS:
- rxnfc->data = dpaa2_eth_queue_count(priv);
- break;
case ETHTOOL_GRXCLSRLCNT:
rxnfc->rule_cnt = 0;
rxnfc->rule_cnt = dpaa2_eth_num_cls_rules(priv);
@@ -949,6 +953,7 @@ const struct ethtool_ops dpaa2_ethtool_ops = {
.get_strings = dpaa2_eth_get_strings,
.get_rxnfc = dpaa2_eth_get_rxnfc,
.set_rxnfc = dpaa2_eth_set_rxnfc,
+ .get_rx_ring_count = dpaa2_eth_get_rx_ring_count,
.get_rxfh_fields = dpaa2_eth_get_rxfh_fields,
.set_rxfh_fields = dpaa2_eth_set_rxfh_fields,
.get_ts_info = dpaa2_eth_get_ts_info,
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next 2/3] net: dpaa2: convert to use .get_rx_ring_count
2025-11-28 13:11 ` [PATCH net-next 2/3] net: dpaa2: " Breno Leitao
@ 2025-11-30 15:21 ` Simon Horman
0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2025-11-30 15:21 UTC (permalink / raw)
To: Breno Leitao
Cc: Claudiu Manoil, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Ioana Ciornei, Vladimir Oltean,
Wei Fang, Clark Wang, netdev, linux-kernel, imx
On Fri, Nov 28, 2025 at 05:11:46AM -0800, Breno Leitao wrote:
> Convert the dpaa2 driver to use the new .get_rx_ring_count
> ethtool operation instead of implementing .get_rxnfc for handling
> ETHTOOL_GRXRINGS command. This simplifies the code by removing the
> ETHTOOL_GRXRINGS case from the switch statement and replacing it with
> a direct return of the queue count.
>
> The driver still maintains .get_rxnfc for other commands including
> ETHTOOL_GRXCLSRLCNT, ETHTOOL_GRXCLSRULE, and ETHTOOL_GRXCLSRLALL.
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 3/3] net: enetc: convert to use .get_rx_ring_count
2025-11-28 13:11 [PATCH net-next 0/3] net: freescale: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
2025-11-28 13:11 ` [PATCH net-next 1/3] net: gianfar: convert to use .get_rx_ring_count Breno Leitao
2025-11-28 13:11 ` [PATCH net-next 2/3] net: dpaa2: " Breno Leitao
@ 2025-11-28 13:11 ` Breno Leitao
2025-11-30 15:22 ` Simon Horman
2025-12-01 20:00 ` [PATCH net-next 0/3] net: freescale: migrate to .get_rx_ring_count() ethtool callback patchwork-bot+netdevbpf
3 siblings, 1 reply; 8+ messages in thread
From: Breno Leitao @ 2025-11-28 13:11 UTC (permalink / raw)
To: Claudiu Manoil, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Ioana Ciornei, Vladimir Oltean,
Wei Fang, Clark Wang
Cc: netdev, linux-kernel, imx, Breno Leitao
Convert the enetc driver to use the new .get_rx_ring_count
ethtool operation instead of implementing .get_rxnfc for handling
ETHTOOL_GRXRINGS command. This simplifies the code in two ways:
1. For enetc_get_rxnfc(): Remove the ETHTOOL_GRXRINGS case from the
switch statement while keeping other cases for classifier rules.
2. For enetc4_get_rxnfc(): Remove it completely and use
enetc_get_rxnfc() instead.
Now on, enetc_get_rx_ring_count() is the callback that returns the
number of RX rings for enetc driver.
Also, remove the documentation around enetc4_get_rxnfc(), which was not
matching what the function did(?!).
Signed-off-by: Breno Leitao <leitao@debian.org>
---
.../net/ethernet/freescale/enetc/enetc_ethtool.c | 37 +++++++---------------
1 file changed, 11 insertions(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
index 3e222321b937..fed89d4f1e1d 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
@@ -633,6 +633,13 @@ static int enetc_set_cls_entry(struct enetc_si *si,
return enetc_set_fs_entry(si, &rfse, fs->location);
}
+static u32 enetc_get_rx_ring_count(struct net_device *ndev)
+{
+ struct enetc_ndev_priv *priv = netdev_priv(ndev);
+
+ return priv->num_rx_rings;
+}
+
static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc,
u32 *rule_locs)
{
@@ -640,9 +647,6 @@ static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc,
int i, j;
switch (rxnfc->cmd) {
- case ETHTOOL_GRXRINGS:
- rxnfc->data = priv->num_rx_rings;
- break;
case ETHTOOL_GRXCLSRLCNT:
/* total number of entries */
rxnfc->data = priv->si->num_fs_entries;
@@ -681,27 +685,6 @@ static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc,
return 0;
}
-/* i.MX95 ENETC does not support RFS table, but we can use ingress port
- * filter table to implement Wake-on-LAN filter or drop the matched flow,
- * so the implementation will be different from enetc_get_rxnfc() and
- * enetc_set_rxnfc(). Therefore, add enetc4_get_rxnfc() for ENETC v4 PF.
- */
-static int enetc4_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc,
- u32 *rule_locs)
-{
- struct enetc_ndev_priv *priv = netdev_priv(ndev);
-
- switch (rxnfc->cmd) {
- case ETHTOOL_GRXRINGS:
- rxnfc->data = priv->num_rx_rings;
- break;
- default:
- return -EOPNOTSUPP;
- }
-
- return 0;
-}
-
static int enetc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc)
{
struct enetc_ndev_priv *priv = netdev_priv(ndev);
@@ -1335,6 +1318,7 @@ const struct ethtool_ops enetc_pf_ethtool_ops = {
.get_rmon_stats = enetc_get_rmon_stats,
.get_eth_ctrl_stats = enetc_get_eth_ctrl_stats,
.get_eth_mac_stats = enetc_get_eth_mac_stats,
+ .get_rx_ring_count = enetc_get_rx_ring_count,
.get_rxnfc = enetc_get_rxnfc,
.set_rxnfc = enetc_set_rxnfc,
.get_rxfh_key_size = enetc_get_rxfh_key_size,
@@ -1363,7 +1347,7 @@ const struct ethtool_ops enetc4_ppm_ethtool_ops = {
ETHTOOL_COALESCE_MAX_FRAMES |
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
.get_eth_mac_stats = enetc_ppm_get_eth_mac_stats,
- .get_rxnfc = enetc4_get_rxnfc,
+ .get_rx_ring_count = enetc_get_rx_ring_count,
.get_rxfh_key_size = enetc_get_rxfh_key_size,
.get_rxfh_indir_size = enetc_get_rxfh_indir_size,
.get_rxfh = enetc_get_rxfh,
@@ -1386,6 +1370,7 @@ const struct ethtool_ops enetc_vf_ethtool_ops = {
.get_sset_count = enetc_get_sset_count,
.get_strings = enetc_get_strings,
.get_ethtool_stats = enetc_get_ethtool_stats,
+ .get_rx_ring_count = enetc_get_rx_ring_count,
.get_rxnfc = enetc_get_rxnfc,
.set_rxnfc = enetc_set_rxnfc,
.get_rxfh_indir_size = enetc_get_rxfh_indir_size,
@@ -1413,7 +1398,7 @@ const struct ethtool_ops enetc4_pf_ethtool_ops = {
.set_wol = enetc_set_wol,
.get_pauseparam = enetc_get_pauseparam,
.set_pauseparam = enetc_set_pauseparam,
- .get_rxnfc = enetc4_get_rxnfc,
+ .get_rx_ring_count = enetc_get_rx_ring_count,
.get_rxfh_key_size = enetc_get_rxfh_key_size,
.get_rxfh_indir_size = enetc_get_rxfh_indir_size,
.get_rxfh = enetc_get_rxfh,
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next 3/3] net: enetc: convert to use .get_rx_ring_count
2025-11-28 13:11 ` [PATCH net-next 3/3] net: enetc: " Breno Leitao
@ 2025-11-30 15:22 ` Simon Horman
0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2025-11-30 15:22 UTC (permalink / raw)
To: Breno Leitao
Cc: Claudiu Manoil, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Ioana Ciornei, Vladimir Oltean,
Wei Fang, Clark Wang, netdev, linux-kernel, imx
On Fri, Nov 28, 2025 at 05:11:47AM -0800, Breno Leitao wrote:
> Convert the enetc driver to use the new .get_rx_ring_count
> ethtool operation instead of implementing .get_rxnfc for handling
> ETHTOOL_GRXRINGS command. This simplifies the code in two ways:
>
> 1. For enetc_get_rxnfc(): Remove the ETHTOOL_GRXRINGS case from the
> switch statement while keeping other cases for classifier rules.
>
> 2. For enetc4_get_rxnfc(): Remove it completely and use
> enetc_get_rxnfc() instead.
>
> Now on, enetc_get_rx_ring_count() is the callback that returns the
> number of RX rings for enetc driver.
>
> Also, remove the documentation around enetc4_get_rxnfc(), which was not
> matching what the function did(?!).
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 0/3] net: freescale: migrate to .get_rx_ring_count() ethtool callback
2025-11-28 13:11 [PATCH net-next 0/3] net: freescale: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
` (2 preceding siblings ...)
2025-11-28 13:11 ` [PATCH net-next 3/3] net: enetc: " Breno Leitao
@ 2025-12-01 20:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-12-01 20:00 UTC (permalink / raw)
To: Breno Leitao
Cc: claudiu.manoil, andrew+netdev, davem, edumazet, kuba, pabeni,
ioana.ciornei, vladimir.oltean, wei.fang, xiaoning.wang, netdev,
linux-kernel, imx
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 28 Nov 2025 05:11:44 -0800 you wrote:
> This series migrates Freescale network drivers to use the new .get_rx_ring_count()
> ethtool callback introduced in commit 84eaf4359c36 ("net: ethtool: add
> get_rx_ring_count callback to optimize RX ring queries").
>
> The new callback simplifies the .get_rxnfc() implementation by removing
> ETHTOOL_GRXRINGS handling and moving it to a dedicated callback. This provides
> a cleaner separation of concerns and aligns these drivers with the modern
> ethtool API.
>
> [...]
Here is the summary with links:
- [net-next,1/3] net: gianfar: convert to use .get_rx_ring_count
https://git.kernel.org/netdev/net-next/c/d3fbfb8b2c4a
- [net-next,2/3] net: dpaa2: convert to use .get_rx_ring_count
https://git.kernel.org/netdev/net-next/c/b2d633926901
- [net-next,3/3] net: enetc: convert to use .get_rx_ring_count
https://git.kernel.org/netdev/net-next/c/ca8df5b877d4
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] 8+ messages in thread