[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8617a74b-959a-761b-3c4a-228a06d2794a@gmail.com>
Date: Tue, 4 Apr 2023 12:30:42 +0100
From: Edward Cree <ecree.xilinx@...il.com>
To: Jakub Kicinski <kuba@...nel.org>, edward.cree@....com
Cc: linux-net-drivers@....com, davem@...emloft.net, pabeni@...hat.com,
edumazet@...gle.com, netdev@...r.kernel.org,
habetsm.xilinx@...il.com, sudheer.mogilappagari@...el.com
Subject: Re: [RFC PATCH net-next 1/6] net: ethtool: attach an IDR of custom
RSS contexts to a netdevice
On 03/04/2023 22:43, Jakub Kicinski wrote:
> On Mon, 3 Apr 2023 17:32:58 +0100 edward.cree@....com wrote:
>> + /* private: indirection table, hash key, and driver private data are
>> + * stored sequentially in @data area. Use below helpers to access
>> + */
>> + u8 data[];
>
> I think that something needs to get aligned here...
> Driver priv needs to guarantee ulong alignment in case someone puts
> a pointer in it.
>
>> +static inline void *ethtool_rxfh_context_priv(struct ethtool_rxfh_context *ctx)
>> +{
>> + return ethtool_rxfh_context_key(ctx) + ctx->key_size;
>
> ALIGN_PTR() ... ?
> Or align data[] and reorder..
Very good points. Indir also needs 4-byte alignment.
Will fix in next version.
>> + u32 rss_ctx_max_id;
>> + struct idr rss_ctx;
>
> noob question, why not xarray?
Because I know how to use the IDR API, but have never used
xarray directly, so would need to learn it.
> Isn't IDR just a legacy wrapper around xarray anyway?
I see it as a *convenience* wrapper. Is it deprecated?
Powered by blists - more mailing lists