Subject: Re: NAPI of many interfaces with just an interruption source

From: Stephen Hemminger <[email-masked]>
Date: Fri, 20 Feb 2009 10:54:13 -0800

On Fri, 20 Feb 2009 19:33:23 +0100
Miguel Ángel Álvarez <[email-masked]> wrote:

> Hi
> 
> I have four interfaces that share the same interruption source (four
> hdlc channels in ixp4xx that share the same rx queue... but I am
> trying to do the question generic).
> 
> My first approach was to declare a napi interface for each device.
> When I detected the first interrupt, I determine the correct net
> interface, and schedule a poll for it.
> 
> The question is that there is no warranty that the data received in
> the polling belongs to the same interface, so...
> 
> - It is correct to do like this, and just analyse the data to check to
> which net interface should the data be sent.
> - Or NAPI is not correct for this case and we should just use the
> simple interruption mechanism?
> 
> Thanks
> 
> Miguel Ángel Álvarez

Several other devices have this (like sky2).  Since NAPI needs
to control irq, you need to have 1 NAPI instance per IRQ, so for
these type of drivers there is 1 NAPI in hardware structure
and multiple network devices.

Note: netconsole/netpoll will only work on a single channel,
but usually a big issue.