interrupt coalescing / polling

John Plevyak jplevyak@inktomi.com
Fri Feb 26 12:04:29 1999



The receive descriptor list structures are:

/* The Speedo3 Rx and Tx buffer descriptors. */
struct RxFD {					/* Receive frame descriptor. */
	s32 status;
	u32 link;					/* struct RxFD * */
	u32 rx_buf_addr;			/* void * */
	u16 count;
	u16 size;
};

/* Selected elements of the Tx/RxFD.status word. */
enum RxFD_bits {
	RxComplete=0x8000, RxOK=0x2000,
	RxErrCRC=0x0800, RxErrAlign=0x0400, RxErrTooBig=0x0200, RxErrSymbol=0x0010,
	RxEth2Type=0x0020, RxNoMatch=0x0004, RxNoIAMatch=0x0002,
	StatusComplete=0x8000,
};

Which bit would that be?

john


On Fri, Feb 26, 1999 at 02:48:41AM -0500, Donald Becker wrote:
> On Thu, 25 Feb 1999, John Plevyak wrote:
> 
> > I am considering studying the interrupt overhead on the receive side.
> > I'll keep you informed.
> 
> That's an excellent thing to do.
> 
> > What do you think about under high load avoiding the interrupts 
> > entirely and running off the timer interrupt?
> 
> It's bad for latency, but that's mitigated if you only do it under high
> load.
> The normal timer interrupts are too coarse for a reasonable polling mode.
> 
> Some cards have internal timers that can be used for this.
> I think the EEPro100 has one as well.
> 
> The idea is that when you are handling too much work, or have taken too many
> interrupts recently (both hard to characterize), you disable all interrupt
> sources except for the card's timer interrupt.  When the timer goes off you
> process the packets and either set the timer again or re-enable interrupts.
> 
> The Rx ring size should be increased from the default 32, to a size that
> a little more than you can receive in a polling tick.  You want the hardware
> rather than the software to discard packets when you are exceptionally busy,
> although that's difficult to get right unless you peek at how full the
> protocol input queue is.
> 
> I implemented a sleazy version of this in the 3c59x driver, but older 3c590
> cards didn't have timers so I didn't do it correctly.  All of my drivers
> have interrupt work limits, which is an ideal place to put such interrupt
> rate mitigation code.
> 
> I've also implemented a polling-mode-only Tulip driver for PowerBooks with
> broken interrupt controllers, but that was a hack to get it working rather
> than an attempt to lower system overhead.
> 
> > Is there a configuration variable to turn off receive interrupts?
> 
> Unlike most chips the EEPro100 has only a global interrupt mask, not
> individual interrupt enables.  You would have to turn off the interrupt bits
> on the receive descriptor list.
> 
> Donald Becker					  becker@cesdis.gsfc.nasa.gov
> USRA-CESDIS, Center of Excellence in Space Data and Information Sciences.
> Code 930.5, Goddard Space Flight Center,  Greenbelt, MD.  20771
> 301-286-0882	     http://cesdis.gsfc.nasa.gov/people/becker/whoiam.html
> 

-- 
John Bradley Plevyak,    PhD,    jplevyak@inktomi.com,     PGP KeyID: 051130BD
Inktomi Corporation,  1900 S. Norfolk Street,  Suite 110,  San Mateo, CA 94403
W:(415)653-2830 F:(415)653-2801 P:(888)491-1332/5103192436.4911332@pagenet.net