[Intel-wired-lan] [PATCH net-next v7 2/5] net: napi: add CPU affinity to napi_config

Jakub Kicinski kuba at kernel.org
Fri Feb 7 02:33:52 UTC 2025


On Wed, 5 Feb 2025 08:20:20 -0700 Ahmed Zaki wrote:
> >> +	if (napi->dev->rx_cpu_rmap_auto) {
> >>   		rc = napi_irq_cpu_rmap_add(napi, irq);
> >>   		if (rc)
> >>   			netdev_warn(napi->dev, "Unable to update ARFS map (%d)\n",
> >>   				    rc);
> >> +	} else if (napi->config && napi->dev->irq_affinity_auto) {
> >> +		napi->notify.notify = netif_napi_irq_notify;
> >> +		napi->notify.release = netif_napi_affinity_release;
> >> +
> >> +		rc = irq_set_affinity_notifier(irq, &napi->notify);
> >> +		if (rc)
> >> +			netdev_warn(napi->dev, "Unable to set IRQ notifier (%d)\n",
> >> +				    rc);
> >>   	}  
> > 
> > Should there be a WARN_ON or WARN_ON_ONCE in here somewhere if the
> > driver calls netif_napi_set_irq_locked but did not link NAPI config
> > with a call to netif_napi_add_config?
> > 
> > It seems like in that case the driver is buggy and a warning might
> > be helpful.
> >   
> 
> I think that is a good idea, if there is a new version I can add this in 
> the second part of the if:
> 
> 
> if (WARN_ON_ONCE(!napi->config))
> 	return;

To be clear, this will make it illegal to set IRQ on a NAPI instance
before it's listed. Probably for the best if we also have auto-remove
in netif_napi_del().


More information about the Intel-wired-lan mailing list