net: bnx2x: convert to use get_rx_ring_count
PATCH 1/1 net: bnx2x: convert to use get_rx_ring_count
Convert the bnx2x 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.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +4 -12
@@ -3355,19 +3355,11 @@ static int bnx2x_get_rxfh_fields(struct net_device *dev,return 0 ; } -static int bnx2x_get_rxnfc (struct net_device *dev,struct ethtool_rxnfc *info, -u32 *rules__always_unused ) +static u32 bnx2x_get_rx_ring_count (struct net_device *dev) {struct bnx2x *bp =netdev_priv (dev); -switch (info->cmd) { -case ETHTOOL_GRXRINGS : - info->data =BNX2X_NUM_ETH_QUEUES (bp); -return 0 ; -default : -DP (BNX2X_MSG_ETHTOOL ,"Command parameters not supported\n" ); -return -EOPNOTSUPP ; - } +return BNX2X_NUM_ETH_QUEUES (bp); } static int bnx2x_set_rxfh_fields(struct net_device *dev,
@@ -3674,7 +3666,7 @@ static const struct ethtool_ops bnx2x_ethtool_ops = { .get_strings = bnx2x_get_strings, .set_phys_id = bnx2x_set_phys_id, .get_ethtool_stats = bnx2x_get_ethtool_stats, - .get_rxnfc = bnx2x_get_rxnfc, + .get_rx_ring_count = bnx2x_get_rx_ring_count, .get_rxfh_indir_size = bnx2x_get_rxfh_indir_size, .get_rxfh = bnx2x_get_rxfh, .set_rxfh = bnx2x_set_rxfh,
@@ -3702,7 +3694,7 @@ static const struct ethtool_ops bnx2x_vf_ethtool_ops = { .get_sset_count = bnx2x_get_sset_count, .get_strings = bnx2x_get_strings, .get_ethtool_stats = bnx2x_get_ethtool_stats, - .get_rxnfc = bnx2x_get_rxnfc, + .get_rx_ring_count = bnx2x_get_rx_ring_count, .get_rxfh_indir_size = bnx2x_get_rxfh_indir_size, .get_rxfh = bnx2x_get_rxfh, .set_rxfh = bnx2x_set_rxfh,
---
base-commit: 37eb4c8985f12ea1c5b62defc673346ac4a113cd
change-id: 20251112-bnx_grxrings-0bccd42bd823
Best regards,
Signature · 1 line
Breno Leitao <[email protected]>
Quoted 9 lines · Breno Leitao
Convert the bnx2x driver to use the new .get_rx_ring_count ethtool operation instead of implementing .get_rxnfc solely for handling
ETHTOOL_GRXRINGScommand. 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 <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 12 Nov 2025 01:50:23 -0800 you wrote:
Convert the bnx2x driver to use the new .get_rx_ring_count ethtool operation instead of implementing .get_rxnfc solely for handling
ETHTOOL_GRXRINGScommand. 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: bnx2x: convert to use get_rx_ring_count
https://git.kernel.org/netdev/net-next/c/04ca7a69a35b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html