# Re: \[PATCH net-next v3 4/8\] net: ethtool: add get\_rx\_ring\_count callback to optimize RX ring queries

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2025-09-16 16:18:24 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/09/3218774
- Thread: https://ratatoskr.run/netdev/2025/09/3216414/t.md

```text
On Mon, 15 Sep 2025 03:47:29 -0700 Breno Leitao wrote:
> @@ -1217,7 +1237,7 @@ static noinline_for_stack int ethtool_get_rxrings(struct net_device *dev,
>  	size_t info_size;
>  	int ret;
>  
> -	if (!ops->get_rxnfc)
> +	if (!ops->get_rxnfc && !ops->get_rx_ring_count)
>  		return -EOPNOTSUPP;

There's inconsistency in how we check for the ops being present.
Here we check for get_rxnfc and the new callback.
But ethtool_set_rxfh() and ethtool_set_rxfh_indir() are only checking
for get_rxnfc. I suppose we can remove the explicit ops checks and
let ethtool_get_rx_ring_count() return EOPNOTSUPP?
```
