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);

Reply via email to