On Mon, 15 Sep 2025 03:47:29 -0700 Breno Leitao wrote:
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -1208,6 +1208,26 @@ static noinline_for_stack int ethtool_set_rxnfc(struct
> net_device *dev,
> return 0;
> }
>
> +int ethtool_get_rx_ring_count(struct net_device *dev)
> +{
> + const struct ethtool_ops *ops = dev->ethtool_ops;
> + struct ethtool_rxnfc rx_rings = {};
> + int ret;
> +
> + if (ops->get_rx_ring_count)
> + return ops->get_rx_ring_count(dev);
> +
> + if (!ops->get_rxnfc)
> + return -EOPNOTSUPP;
> +
> + rx_rings.cmd = ETHTOOL_GRXRINGS;
> + ret = ops->get_rxnfc(dev, &rx_rings, NULL);
> + if (ret < 0)
> + return ret;
> +
> + return rx_rings.data;
> +}
This gets called from netlink, so I think it needs to be in common.c