From owner-freebsd-net@FreeBSD.ORG Thu Apr 17 13:59:53 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B00101065670 for ; Thu, 17 Apr 2008 13:59:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 850DC8FC17 for ; Thu, 17 Apr 2008 13:59:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 1C88746B37; Thu, 17 Apr 2008 09:59:53 -0400 (EDT) Date: Thu, 17 Apr 2008 14:59:53 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Sack In-Reply-To: <3c0b01820804170643w6b771ce9jdfc2dc5b240922b@mail.gmail.com> Message-ID: <20080417145652.J71628@fledge.watson.org> References: <3c0b01820804160929i76cc04fdy975929e2a04c0368@mail.gmail.com> <200804161456.20823.jkim@FreeBSD.org> <3c0b01820804161328m77704ca0g43077a9718d446d4@mail.gmail.com> <200804161654.22452.jkim@FreeBSD.org> <3c0b01820804161402u3aac4425n41172294ad33a667@mail.gmail.com> <20080417112329.G47027@delplex.bde.org> <3c0b01820804170643w6b771ce9jdfc2dc5b240922b@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org, Dieter , Jung-uk Kim Subject: Re: bge dropping packets issue X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 13:59:53 -0000 On Thu, 17 Apr 2008, Alexander Sack wrote: > First off thanks for the detailed reply Bruce. I have some follow-up > questions in my quest to learn more about BGE/networking etc. > > On Wed, Apr 16, 2008 at 10:53 PM, Bruce Evans wrote: >> On Wed, 16 Apr 2008, Alexander Sack wrote: >>> On Wed, Apr 16, 2008 at 4:54 PM, Jung-uk Kim wrote: >> >> First stop using the DEVICE_POLLING packet lossage service... > > For my own edification, when do you want use DEVICE_POLLING versus interrupt > driven network I/O? With all question like these I suppose the answer > depends on the workload and the interrupt bandwidth of the machine (which > depends on the type of hardware)... > > But why was it added to begin with if standard interrupt driven I/O is > faster? (was it the fact that historically hardware didn't do interrupt > coalescing initially) There are serious functional limitations to the current DEVICE_POLLING code in the new world order of device drivers, ithread, SMP, etc. Leaving this aside, here are two reasons why it exists: (1) Historically, devices did not support interrupt moderation. (2) Even with interrupt moderation, livelock can occur because there is no facility to limit the CPU use assigned to sources of network load. Something interrupt moderation does *not* provide is the ability to schedule network stack processing at idle priority, or limit CPU use to a percentage of total CPU in order to leave CPU resources for other activity (such as fixing the load problem, getting work done, etc). Our device polling infrastructure needs serious work, and I think quite a bit of it could usefully move to the interrupt infrastructure layer, but we should be careful to consider some of the functional aspects to DEVICE_POLLING that do differentiate it (load management, not just interrupt moderation). Robert N M Watson Computer Laboratory University of Cambridge