From owner-freebsd-net Thu Feb 8 18:10:14 2001 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 443B237B699 for ; Thu, 8 Feb 2001 18:09:57 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id VAA60712; Thu, 8 Feb 2001 21:09:53 -0500 (EST) (envelope-from wollman) Date: Thu, 8 Feb 2001 21:09:53 -0500 (EST) From: Garrett Wollman Message-Id: <200102090209.VAA60712@khavrinen.lcs.mit.edu> To: Luigi Rizzo Cc: net@FreeBSD.ORG Subject: potential infinite loop in network device drivers In-Reply-To: <200102090102.f19125x06386@iguana.aciri.org> References: <200102090102.f19125x06386@iguana.aciri.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org < 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). Both techniques were described in a paper by Jeff Mogul (then at DEC in Palo Alto) about five years ago; I have a physical copy of the paper buried somewhere in my office. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message