From owner-freebsd-net Mon Nov 18 17:31:58 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8036637B401; Mon, 18 Nov 2002 17:31:56 -0800 (PST) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2E6F43E8A; Mon, 18 Nov 2002 17:31:55 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.3/8.12.3) with ESMTP id gAJ1VtAh037083; Mon, 18 Nov 2002 17:31:55 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.3/8.12.3/Submit) id gAJ1Vtnu037082; Mon, 18 Nov 2002 17:31:55 -0800 (PST) (envelope-from rizzo) Date: Mon, 18 Nov 2002 17:31:55 -0800 From: Luigi Rizzo To: Terry Lambert Cc: David Gilbert , dolemite@wuli.nu, freebsd-hackers@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: Small initial LRP processing patch vs. -current Message-ID: <20021118173155.C29018@xorpc.icir.org> References: <20021109180321.GA559@unknown.nycap.rr.com> <3DCD8761.5763AAB2@mindspring.com> <15823.51640.68022.555852@canoe.velocet.net> <3DD1865E.B9C72DF5@mindspring.com> <15826.24074.605709.966155@canoe.velocet.net> <3DD2F33E.BE136568@mindspring.com> <3DD96FC0.B77331A1@mindspring.com> <20021118151109.B19767@xorpc.icir.org> <3DD99018.73B703A@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3DD99018.73B703A@mindspring.com>; from tlambert2@mindspring.com on Mon, Nov 18, 2002 at 05:12:56PM -0800 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Nov 18, 2002 at 05:12:56PM -0800, Terry Lambert wrote: > Luigi Rizzo wrote: ... > > This patch will not make any difference if you have device_polling > > enabled, because polling already does this -- queues a small number > > of packets (default is max 5 per card) and calls ip_input on them > > right away. > > The problem with this is that it introduces a livelock point at no it doesn't because new packets are not grabbed off the card until the queue is empty. > > I do not understand this claim: > > > > > The basic theory here is that ipintr processing can be delayed > > > indefinitely, if interrupt load is high enough, and there will > > > be a maximum latency of 10ms for IP processing after ether_input(), > > > in the normal stack case, without the patches. > > > > because netisr are not timer driven to the best of my knowledge -- > > they just fire right after the cards' interrupts are complete. > > That's almost right. The soft interrupt handlers run when you > splx() out of a raised priority level. In fact, this happens at > the end of clockintr, so NETISR *is* timer driven, until you hit i think it happens at the end of the device interrupt! > .... > Polling changes this somewhat. The top end is reduced, in exchange > for not dropping off as badly actually, this is not true in general, and not in the case of FreeBSD's DEVICE_POLLING. Polling-enabled drivers fetch the cards' state from in-memory descriptors, not from the interrupt status register across the PCI bus. Also, they to look for exceptions (which require going through the PCI bus) only every so often. So the claim that the top end is reduced is not true in general -- it depends on how the interrupt vs. polling code are written and optimised. > | > | ... <- Receiver livelock point > | * +++* > | * .++ ++++ ++++ ++++ ++++ +++ > | * . + + + + + > | * . > | * . > |* . > |* . > |* ......................... > +-------------------------------------------- > > The reason the top end is depressed is that the polling is not load > adaptive. Instead, it is fixed overhead relative (e.g. the use of > the hardclock to effect calls to ether_poll(), which then calls into > all drivers, whether they have data available or not, to fetch state > across the PCI bus to ask the cards if there is data available. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message