Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fm10k: extract GRXRINGS from .get_rxnfc

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().

This simplifies the RX ring count retrieval and aligns fm10k with the new
ethtool API for querying RX ring parameters.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Link: https://patch.msgid.link/20251125-gxring_intel-v2-8-f55cd022d28b@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
73d834cd 3399fd51

+3 -14
+3 -14
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
··· 734 734 return 0; 735 735 } 736 736 737 - static int fm10k_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 738 - u32 __always_unused *rule_locs) 737 + static u32 fm10k_get_rx_ring_count(struct net_device *dev) 739 738 { 740 739 struct fm10k_intfc *interface = netdev_priv(dev); 741 - int ret = -EOPNOTSUPP; 742 740 743 - switch (cmd->cmd) { 744 - case ETHTOOL_GRXRINGS: 745 - cmd->data = interface->num_rx_queues; 746 - ret = 0; 747 - break; 748 - default: 749 - break; 750 - } 751 - 752 - return ret; 741 + return interface->num_rx_queues; 753 742 } 754 743 755 744 static int fm10k_set_rssh_fields(struct net_device *dev, ··· 1149 1160 .set_ringparam = fm10k_set_ringparam, 1150 1161 .get_coalesce = fm10k_get_coalesce, 1151 1162 .set_coalesce = fm10k_set_coalesce, 1152 - .get_rxnfc = fm10k_get_rxnfc, 1163 + .get_rx_ring_count = fm10k_get_rx_ring_count, 1153 1164 .get_regs = fm10k_get_regs, 1154 1165 .get_regs_len = fm10k_get_regs_len, 1155 1166 .self_test = fm10k_self_test,