Subject: Re: interrupt sharing improves performance?
To: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-perform
Date: 02/03/2003 14:36:10
On Mon, Feb 03, 2003 at 11:48:43AM +0100, Pavel Cahyna wrote:

 > In section "IRQ" there is an interesting claim that sharing interrupts
 > between netwok cards could improve performance. (I would think the
 > opposite is true.) Quoting the paragraph for your convenience:

...

 > Now, a couple of questions:
 > 
 > - Is this true for NetBSD too?

In theory, it's potentially true (mmm, weasel words :-) for any system.

Let me explain...

Since interrupts are potentially expensive, you want to find other times
to check for new packets on an opportunistic basis.  One way to do this is
to check all network interfaces e.g. whenever there is any trap into the
kernel, such as a timer interrupt, a system call, or a page fault.

What they're describing is a variant of this -- by putting all network
interfaces on the same interrupt source, you check all of them whenever
just one of them signals that a packet has arrived.  For all of the
interfaces which did *not* signal the interrupt, you are essentially
polling them in an opportunistic manner.

It does require some changes to the network drivers, however, in order for
it to actually work.  Right now, NetBSD's network drivers check an interrupt
status register for the device, and return "interrupt not for me" without
doing additional work if their interface was not the source of the interrupt.
In order to make this "opportunistic" method word, they would have to do the
normal Rx processing whenever the ISR were called.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>