Re: [PATCH net-next 1/2] net: renesas: rswitch: use per-port irq handlers
From: Nikita Yushchenko
Date: Fri Dec 20 2024 - 04:33:58 EST
20.12.2024 14:19, Andrew Lunn wrote:
On Fri, Dec 20, 2024 at 09:16:58AM +0500, Nikita Yushchenko wrote:
Instead of handling all possible data interrupts in the same handler,
switch to per-port handlers.
This significantly simplifies handling: when the same interrupt is used
for several ports, system calls all handlers, and each handler only has
to check interrupts for one port's tx and rx queues.
But it is not required to use the same interrupt for all ports - GWCA
provides 8 data interrupts and allows arbitrary per-queue assignment
of those. Support that by reading interrupt index for each port from
optional 'irq-index' device tree property.
It has been pointed out that adding this property breaks backwards
compatibility with older DT blobs.
It does not break backwards compatibility.
Current behavior is that everything is serviced by interrupt 0.
And in case of irq-index not defined, the fallback is exactly that.
(physically there is code that assigns interrupts per chain index, but in the current driver chains that
get non-zero interrupts assigned are never used; anso currently multiple interrupts are just multiple
entries to the exactly same handler that always services everything)
I don't know this hardware...
How many ports are there? Less than 9? Can you just do a static
allocation, port 0 gets interrupt 0, port 1 interrupt 1...
There are only 3 physical ports, however the use case I'm targeting is - virtual ports serving virtual
machines (with offloading features making hardware directly L2-forward or L3-route most traffic between
outside world and VM-owned virtual port frontends). In this setup, some of 8 GWCA irqs will be given to
VMs and thus there are definitely not enough to per-consumer allocation.
Nikita