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

Configure Feed

Select the types of activity you want to include in your feed.

net: ixgbe: convert to use .get_rx_ring_count

Convert the ixgbe driver to use the new .get_rx_ring_count ethtool
operation for handling ETHTOOL_GRXRINGS command. This simplifies the
code by extracting the ring count logic into a dedicated callback.

The new callback provides the same functionality in a more direct way,
following the ongoing ethtool API modernization.

This was compile-tested only.

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251113-ixgbe_gxrings-v2-1-0ecf57808a78@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
f455d3f0 06ac4706

+10 -5
+10 -5
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
··· 2805 2805 return 64; 2806 2806 } 2807 2807 2808 + static u32 ixgbe_get_rx_ring_count(struct net_device *dev) 2809 + { 2810 + struct ixgbe_adapter *adapter = ixgbe_from_netdev(dev); 2811 + 2812 + return min_t(u32, adapter->num_rx_queues, 2813 + ixgbe_rss_indir_tbl_max(adapter)); 2814 + } 2815 + 2808 2816 static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 2809 2817 u32 *rule_locs) 2810 2818 { ··· 2820 2812 int ret = -EOPNOTSUPP; 2821 2813 2822 2814 switch (cmd->cmd) { 2823 - case ETHTOOL_GRXRINGS: 2824 - cmd->data = min_t(int, adapter->num_rx_queues, 2825 - ixgbe_rss_indir_tbl_max(adapter)); 2826 - ret = 0; 2827 - break; 2828 2815 case ETHTOOL_GRXCLSRLCNT: 2829 2816 cmd->rule_cnt = adapter->fdir_filter_count; 2830 2817 ret = 0; ··· 3746 3743 .get_ethtool_stats = ixgbe_get_ethtool_stats, 3747 3744 .get_coalesce = ixgbe_get_coalesce, 3748 3745 .set_coalesce = ixgbe_set_coalesce, 3746 + .get_rx_ring_count = ixgbe_get_rx_ring_count, 3749 3747 .get_rxnfc = ixgbe_get_rxnfc, 3750 3748 .set_rxnfc = ixgbe_set_rxnfc, 3751 3749 .get_rxfh_indir_size = ixgbe_rss_indir_size, ··· 3795 3791 .get_ethtool_stats = ixgbe_get_ethtool_stats, 3796 3792 .get_coalesce = ixgbe_get_coalesce, 3797 3793 .set_coalesce = ixgbe_set_coalesce, 3794 + .get_rx_ring_count = ixgbe_get_rx_ring_count, 3798 3795 .get_rxnfc = ixgbe_get_rxnfc, 3799 3796 .set_rxnfc = ixgbe_set_rxnfc, 3800 3797 .get_rxfh_indir_size = ixgbe_rss_indir_size,