Subject: Re: [PATCH net-next 02/11] net: ethtool: let driver declare max size of RSS indir table and key

From: Simon Horman <[email-masked]>
Date: Thu, 4 Jul 2024 08:34:46 +0100

On Tue, Jul 02, 2024 at 04:47:47PM -0700, Jakub Kicinski wrote:
> Some drivers (bnxt but I think also mlx5 from ML discussions) change
> the size of the indirection table depending on the number of Rx rings.
> Decouple the max table size from the size of the currently used table,
> so that we can reserve space in the context for table growth.
> 
> Static members in ethtool_ops are good enough for now, we can add
> callbacks to read the max size more dynamically if someone needs
> that.
> 
> Signed-off-by: Jakub Kicinski <[email-masked]>
> ---
>  include/linux/ethtool.h | 20 +++++++-----------
>  net/ethtool/ioctl.c     | 46 ++++++++++++++++++++++++++++++++---------
>  2 files changed, 44 insertions(+), 22 deletions(-)
> 
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 3ce5be0d168a..dc8ed93097c3 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -173,6 +173,7 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
>  struct ethtool_rxfh_context {
>  	u32 indir_size;
>  	u32 key_size;
> +	u32 key_off;
>  	u16 priv_size;
>  	u8 hfunc;
>  	u8 input_xfrm;

nit: key_off should have an entry in the kernel doc for
     struct ethtool_rxfh_context.

...