Garrett Wollman wrote:
>
> <<On Thu, 8 Feb 2001 17:02:05 -0800 (PST), Luigi Rizzo <[EMAIL PROTECTED]> said:
>
> > it occurs to me that there is a potential infinite loop in
> > most if not all ethernet drivers. Basically, on a
> > receive interrupt, such drivers loop around the status word
> > until the receive queue is drained.
>
> One possible right way to deal with this is to get rid of the
> two-level interrupt scheme (for fast interfaces at least) and push the
> packets all the way through the network stack. This will ensure that
> if packets are arriving faster than we can handle them, they will be
> dropped by the network interface with an ``insufficient resources''
> error.
>
> Another possible right way to deal with this is to move all network
> processing into the lower level, and poll round-robin for packets
> (with network interrupts disabled) until all network interfaces are
> finished (or we need to give the user a time slice).
This is similar to the way most VxWorks network drivers operate: the
"packet available" interrupt handler simply schedules tNetTask to
retrieve the packet using a driver-specific callback function. If
the buffer on the network card gets filled up before tNetTask can get
around to it, packets are dropped until the system becomes less busy.
The programmer can tune the behavior by juggling the priorities of
tNetTask and other busy parts of the system. This helps to avoid the
problems of too many receive interrupts driving the system into
interrupt livelock, as long as the card is smart enough to discard
packets without interrupting when its own buffers are full.
--
"Where am I, and what am I doing in this handbasket?"
Wes Peters Softweyr LLC
[EMAIL PROTECTED] http://softweyr.com/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message