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

net: ena: convert to use .get_rx_ring_count

Use the newly introduced .get_rx_ring_count ethtool ops callback instead
of handling ETHTOOL_GRXRINGS directly in .get_rxnfc().

Since ETHTOOL_GRXRINGS was the only useful command handled by
ena_get_rxnfc(), remove the function entirely.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Arthur Kiyanovski <akiyano@amazon.com>
Link: https://patch.msgid.link/20260115-grxring_big_v2-v1-4-b3e1b58bced5@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
289f714a e33bd8dd

+3 -19
+3 -19
drivers/net/ethernet/amazon/ena/ena_ethtool.c
··· 835 835 return ena_com_fill_hash_ctrl(ena_dev, proto, hash_fields); 836 836 } 837 837 838 - static int ena_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info, 839 - u32 *rules) 838 + static u32 ena_get_rx_ring_count(struct net_device *netdev) 840 839 { 841 840 struct ena_adapter *adapter = netdev_priv(netdev); 842 - int rc = 0; 843 841 844 - switch (info->cmd) { 845 - case ETHTOOL_GRXRINGS: 846 - info->data = adapter->num_io_queues; 847 - rc = 0; 848 - break; 849 - case ETHTOOL_GRXCLSRLCNT: 850 - case ETHTOOL_GRXCLSRULE: 851 - case ETHTOOL_GRXCLSRLALL: 852 - default: 853 - netif_err(adapter, drv, netdev, 854 - "Command parameter %d is not supported\n", info->cmd); 855 - rc = -EOPNOTSUPP; 856 - } 857 - 858 - return rc; 842 + return adapter->num_io_queues; 859 843 } 860 844 861 845 static u32 ena_get_rxfh_indir_size(struct net_device *netdev) ··· 1080 1096 .get_sset_count = ena_get_sset_count, 1081 1097 .get_strings = ena_get_ethtool_strings, 1082 1098 .get_ethtool_stats = ena_get_ethtool_stats, 1083 - .get_rxnfc = ena_get_rxnfc, 1099 + .get_rx_ring_count = ena_get_rx_ring_count, 1084 1100 .get_rxfh_indir_size = ena_get_rxfh_indir_size, 1085 1101 .get_rxfh_key_size = ena_get_rxfh_key_size, 1086 1102 .get_rxfh = ena_get_rxfh,