Re: [PATCH net-next v2 1/8] net: napi: add irq_flags to napi struct

From
Jakub Kicinski <kuba@kernel.org>
Date
2024-12-20 03:34:04
Also in
intel-wired-lan
Reply to
Ahmed Zaki, 2024-12-18
On Wed, 18 Dec 2024 09:58:36 -0700 Ahmed Zaki wrote:
Add irq_flags to the napi struct. This will allow the drivers to choose
how the core handles the IRQ assigned to the napi via
netif_napi_set_irq().
I haven't read all the code, but I think the flag should be for the
netdev as a while, not NAPI by NAPI. In fact you can combine it with
allocating the map, too.

int netif_enable_cpu_rmap(dev, num_queues)
{
#ifdef CONFIG_RFS_ACCEL
	WARN_ON(dev->rx_cpu_rmap);

	dev->rx_cpu_rmap = alloc_irq_cpu_rmap(adapter->num_queues);
	if ...
	
	dev->rx_cpu_rmap_auto = 1;
	return 0;
#endif
}

void netif_disable_cpu_rmap(dev)
{
	dev->rx_cpu_rmap_auto = 0;
	free_irq_cpu_rmap(dev->rx_cpu_rmap);
}

Then in the NAPI code you just:

void netif_napi_set_irq(...)
{
	...

	if (napi->dev->rx_cpu_rmap_auto) {
		err = irq_cpu_rmap_add(napi->dev->rx_cpu_rmap, irq);
		...
	}
}
Thread (23 messages) 23 messages, 4 authors, last reply 2025-01-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help