Re: [PATCH net-next 4/9] net: ethtool: add dedicated callbacks for getting and setting rxfh fields

Joe Damato
2025-06-13T05:36:21Z

On Wed, Jun 11, 2025 at 07:59:44AM -0700, Jakub Kicinski wrote:
> We mux multiple calls to the drivers via the .get_nfc and .set_nfc
> callbacks. This is slightly inconvenient to the drivers as they
> have to de-mux them back. It will also be awkward for netlink code
> to construct struct ethtool_rxnfc when it wants to get info about
> RX Flow Hash, from the RSS module.
>
> Add dedicated driver callbacks. Create struct ethtool_rxfh_fields
> which contains only data relevant to RXFH. Maintain the names of
> the fields to avoid having to heavily modify the drivers.
>
> For now support both callbacks, once all drivers are converted
> ethtool_*et_rxfh_fields() will stop using the rxnfc callbacks.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: andrew@lunn.ch
> CC: ecree.xilinx@gmail.com
> ---

[...]

> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index bd9fd95bb82f..f4d4d60275f8 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c

[...]

> @@ -1492,7 +1527,7 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
> u8 *rss_config;
> int ret;
>
> - if (!ops->get_rxnfc || !ops->set_rxfh)
> + if ((!ops->get_rxnfc && !ops->get_rxfh_fields) || !ops->set_rxfh)
> return -EOPNOTSUPP;

I realize I am late to the thread, but is this part above correct? It seems
like ethtool_set_rxfh calls ops->get_rxnfc but not ops->get_rxfh_fields,
unless I missed something in an earlier patch?