[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 4 Apr 2023 12:49:18 +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 2/6] net: ethtool: record custom RSS contexts
in the IDR
On 03/04/2023 22:48, Jakub Kicinski wrote:
> On Mon, 3 Apr 2023 17:32:59 +0100 edward.cree@....com wrote:
>> @@ -880,6 +896,7 @@ struct ethtool_ops {
>> u8 *hfunc);
>> int (*set_rxfh)(struct net_device *, const u32 *indir,
>> const u8 *key, const u8 hfunc);
>> + u16 (*get_rxfh_priv_size)(struct net_device *);
>> int (*get_rxfh_context)(struct net_device *, u32 *indir, u8 *key,
>> u8 *hfunc, u32 rss_context);
>> int (*set_rxfh_context)(struct net_device *, const u32 *indir,
>
> Would a static value not do for most drivers?
Yes, it would.
> We already have a handful of data fields in the "ops" structure.
I didn't notice that / realise it was an option. Will do.
>> @@ -1331,6 +1335,31 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
>> }
>> }
>>
>> + if (create) {
>> + if (delete) {
>> + ret = -EINVAL;
>> + goto out;
>> + }
>> + ctx = kzalloc(ethtool_rxfh_context_size(dev_indir_size,
>> + dev_key_size,
>> + dev_priv_size),
>> + GFP_USER);
>
> GFP_USER? Do you mean it for accounting? GFP_KERNEL_ACCOUNT?
It's an allocation triggerable by userland; I was under the
impression that those were supposed to use GFP_USER for some
reason; the rss_config alloc further up this function does.
Powered by blists - more mailing lists