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.

ethtool: remove ETHTOOL_GRXRINGS fallback through get_rxnfc

All drivers that need to report the RX ring count now implement the
get_rx_ring_count callback directly. Remove the legacy fallback path
that obtained this information by calling get_rxnfc with ETHTOOL_GRXRINGS.

This simplifies the code and makes get_rx_ring_count the only way
to retrieve the RX ring count.

Note: ethtool_get_rx_ring_count() returns int to allow returning
-EOPNOTSUPP, while the callback returns u32. The implicit conversion
is safe since RX ring counts will not exceed INT_MAX while we are still
alive.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260126-grxring_final-v1-1-0981cb24512e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
1f6b527b 88a95781

+2 -12
+2 -12
net/ethtool/common.c
··· 637 637 int ethtool_get_rx_ring_count(struct net_device *dev) 638 638 { 639 639 const struct ethtool_ops *ops = dev->ethtool_ops; 640 - struct ethtool_rxnfc rx_rings = {}; 641 - int ret; 642 640 643 - if (ops->get_rx_ring_count) 644 - return ops->get_rx_ring_count(dev); 645 - 646 - if (!ops->get_rxnfc) 641 + if (!ops->get_rx_ring_count) 647 642 return -EOPNOTSUPP; 648 643 649 - rx_rings.cmd = ETHTOOL_GRXRINGS; 650 - ret = ops->get_rxnfc(dev, &rx_rings, NULL); 651 - if (ret < 0) 652 - return ret; 653 - 654 - return rx_rings.data; 644 + return ops->get_rx_ring_count(dev); 655 645 } 656 646 657 647 static int ethtool_get_rxnfc_rule_count(struct net_device *dev)