From owner-freebsd-net Sat Oct 27 7:52:14 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id C1A1C37B401 for ; Sat, 27 Oct 2001 07:52:11 -0700 (PDT) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id f9REmjT78232; Sat, 27 Oct 2001 07:48:45 -0700 (PDT) (envelope-from rizzo) Date: Sat, 27 Oct 2001 07:48:45 -0700 From: Luigi Rizzo To: Soren Kristensen Cc: net@FreeBSD.ORG Subject: Re: NEW CODE: polling support for device drivers. Message-ID: <20011027074845.D77729@iguana.aciri.org> References: <20011027005905.A72758@iguana.aciri.org> <3BDA73C0.73DBCAE9@soekris.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3BDA73C0.73DBCAE9@soekris.com> User-Agent: Mutt/1.3.23i 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 Sat, Oct 27, 2001 at 01:43:44AM -0700, Soren Kristensen wrote: > Luigi and all, > > That looks very interesting to me.... I would like to follow up with a > question, just because of my interest in getting maximum packet > forwarding performance out of FreeBSD.... > > As I see it, the advantage of the polling code is to avoid interrupts > and context switches. There is in fat more than that. I will post later another (longish) message to explain things in more detail. > Is it possible to implement all the basic packet forwarding to run to > completion at interrupt, ie, when a packet comes in, the interrupt code > would run until the packet has been sent out on another interface, and > then loop back to see if there's more incomming packets, in a polling > fashion. This seems to be a common question :) If you have fastforwarding enabled (sysctl net.inet.ip.fastforwarding=1) this is actually how network drivers already work now -- they loop around the interrupt status register, and each incoming packet is processed up to the call to XX_start() on the output interface. Without fastforwarding, processing stops much earlier, i.e. when the packet is queued into the ipintrq, and then a software interrupt is scheduled to process ip_input(). cheers luigi ----------------------------------+----------------------------------------- Luigi RIZZO, luigi@iet.unipi.it . ACIRI/ICSI (on leave from Univ. di Pisa) http://www.iet.unipi.it/~luigi/ . 1947 Center St, Berkeley CA 94704 Phone: (510) 666 2927 ----------------------------------+----------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message