From owner-freebsd-net  Fri Feb  9  8:23:30 2001
Delivered-To: freebsd-net@freebsd.org
Received: from timesync.vci.com (timesink.vci.com [205.230.105.115])
	by hub.freebsd.org (Postfix) with SMTP id 7CF2437BB7A
	for <net@freebsd.org>; Fri,  9 Feb 2001 07:24:42 -0800 (PST)
Received: from gateway.vci.com by timesync.vci.com
          via smtpd (for hub.freebsd.org [216.136.204.18]) with SMTP; 9 Feb 2001 15:24:34 UT
Received: from mail.vci.com (unverified) by gateway.vci.com
 (Content Technologies SMTPRS 4.1.5) with ESMTP id <Tc0a87ba989519f24ee06@gateway.vci.com> for <net@freebsd.org>;
 Fri, 9 Feb 2001 10:25:48 -0500
Received: by exchange.vci.com with Internet Mail Service (5.5.2653.19)
	id <CRXYFMZ4>; Fri, 9 Feb 2001 10:24:54 -0500
Message-ID: <76AE66BFB2FBD211A30B0008C7DF6C2D01718451@exchange.vci.com>
From: Clark Jarvis <cjarvis@VCI.com>
To: net@freebsd.org
Subject: RE: potential infinite loop in network device drivers
Date: Fri, 9 Feb 2001 10:24:50 -0500 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
	charset="iso-8859-1"
Sender: owner-freebsd-net@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.org

> 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.
> 
> If the body of the loop takes approx the same as
> the packet interarrival time, you might end up stuck in
> the loop forever (and typically holding locks or with most
> interrupts masked off).
> 
> I would suggest that we slightly redesign such loops so that
> we limit the amt of time spent in them. This probably
> affects only 100M/1G interfaces these days, but still...

I remember thinking about this at one point, and deciding that it wasn't
worth working around.  The problem was that if you leave before cleaning up
all the interrupt conditions, you'll just get another interrupt and be right
back almost immediately anyway.  Yeah, you get a little window for other
things to happen, but not much, and you add overhead, slowing down what is
obviously a busy device.

It'll still be interesting to read the papers Garrett mentioned...
-- 
Clark


**********************************************************************
This email, and any files transmitted with it, are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this email
in error please advise ismail@vci.com.
**********************************************************************


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message