[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250215095834.6cfc923f@kernel.org>
Date: Sat, 15 Feb 2025 09:58:34 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Ahmed Zaki <ahmed.zaki@...el.com>
Cc: netdev@...r.kernel.org, intel-wired-lan@...ts.osuosl.org,
andrew+netdev@...n.ch, edumazet@...gle.com, horms@...nel.org,
pabeni@...hat.com, davem@...emloft.net, michael.chan@...adcom.com,
tariqt@...dia.com, anthony.l.nguyen@...el.com,
przemyslaw.kitszel@...el.com, jdamato@...tly.com, shayd@...dia.com,
akpm@...ux-foundation.org, shayagr@...zon.com,
kalesh-anakkur.purayil@...adcom.com, pavan.chebbi@...adcom.com
Subject: Re: [PATCH net-next v8 3/6] net: napi: add CPU affinity to
napi_config
On Tue, 11 Feb 2025 14:06:54 -0700 Ahmed Zaki wrote:
> @@ -11575,9 +11615,9 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
> void (*setup)(struct net_device *),
> unsigned int txqs, unsigned int rxqs)
> {
> + unsigned int maxqs, i, numa;
> struct net_device *dev;
> size_t napi_config_sz;
> - unsigned int maxqs;
>
> BUG_ON(strlen(name) >= sizeof(dev->name));
>
> @@ -11679,6 +11719,11 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
> if (!dev->napi_config)
> goto free_all;
>
> + numa = dev_to_node(&dev->dev);
Does this work? dev->dev is the "software" device, IOW the netdev itself.
The HW dev is dev->dev.parent but it won't be set at this stage, we'd
need to move the init to register, or maybe netif_enable_cpu_rmap() /
netif_set_affinity_auto() ?
> + for (i = 0; i < maxqs; i++)
> + cpumask_set_cpu(cpumask_local_spread(i, numa),
> + &dev->napi_config[i].affinity_mask);
Powered by blists - more mailing lists