On Fri, 17 Jan 2025 17:33:32 -0700 Ahmed Zaki wrote:
> A common task for most drivers is to remember the user-set CPU affinity
> to its IRQs. On each netdev reset, the driver should re-assign the
> user's settings to the IRQs.
> @@ -393,8 +394,8 @@ struct napi_struct {
> struct list_head dev_list;
> struct hlist_node napi_hash_node;
> int irq;
> -#ifdef CONFIG_RFS_ACCEL
> struct irq_affinity_notify notify;
> +#ifdef CONFIG_RFS_ACCEL
Let's remove the #ifdef completely, one int won't make much difference,
it's ~1% of the whole struct..
> @@ -11585,7 +11606,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv,
> const char *name,
> {
> struct net_device *dev;
> size_t napi_config_sz;
> - unsigned int maxqs;
> + unsigned int maxqs, i, numa;
nit: reverse xmas tree
> BUG_ON(strlen(name) >= sizeof(dev->name));
>
> @@ -11681,6 +11702,10 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv,
> const char *name,
> dev->napi_config = kvzalloc(napi_config_sz, GFP_KERNEL_ACCOUNT);
> if (!dev->napi_config)
> goto free_all;
nit: empty line here
> + numa = dev_to_node(&dev->dev);
> + for (i = 0; i < maxqs; i++)
> + cpumask_set_cpu(cpumask_local_spread(i, numa),
> + &dev->napi_config[i].affinity_mask);
>
> strscpy(dev->name, name);
> dev->name_assign_type = name_assign_type;