Subject: Re: [PATCH v4 net-next 2/7] net: ethtool: attach an XArray of custom RSS contexts to a netdevice

From: Jakub Kicinski <[email-masked]>
Date: Wed, 4 Oct 2023 15:56:55 -0700

On Fri, 29 Sep 2023 11:17:53 -0700 Jacob Keller wrote:
> > +struct ethtool_rxfh_context {
> > +	u32 indir_size;
> > +	u32 key_size;
> > +	u8 hfunc;
> > +	u16 priv_size;
> > +	u8 indir_no_change:1;
> > +	u8 key_no_change:1;
> > +	/* private: driver private data, indirection table, and hash key are
> > +	 * stored sequentially in @data area.  Use below helpers to access.
> > +	 */
> > +	u8 data[] __aligned(sizeof(void *));
> > +};  
> 
> Is it not feasible to use container_of to get to private data for the
> drivers? I guess this change in particular doesn't actually include any
> users yet...

That could work in general but here specifically there are also 
2 variable-size arrays hiding in data[].