From owner-freebsd-net@FreeBSD.ORG Fri Mar 27 11:05:01 2009 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 AA4021065674 for ; Fri, 27 Mar 2009 11:05:01 +0000 (UTC) (envelope-from brampton@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 3660D8FC23 for ; Fri, 27 Mar 2009 11:05:00 +0000 (UTC) (envelope-from brampton@gmail.com) Received: by ey-out-2122.google.com with SMTP id 4so196403eyf.7 for ; Fri, 27 Mar 2009 04:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=8O+RIjVmH6oMjjea3ZXkd/09S/U7QsSgEX4BjV+fxwg=; b=ibjqalLpK7xlFefsAD5zVhx/VbOUvv22TuOgVccY90DZd5RP4ycn4Gja1MYIG1WO1/ p+7h/vWp07gECCV2LmgxhIBYwSEp0EiULY+n+FrKmgjp50rTkS65II8OxyAXBN9dbHFv cCnzpCdcd2sIrgBjY2vbo13AYyqOMmdsL7Q90= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=YhZb8/RRrrzfTkaaMbV0egktGx7nthNTkDzJiKDHJKBWfJ7r+57ZoMUlBzeUp7Eeay b77YQfM26hK9AbqR7Ep8SfeQV4l8poKJ3PEmoEft8ZcCAH2ZnUtycg/Xayc6Gq5KRdLj oaaDUqqfWwHBdf4YUwWcc0S3zQ/qCA/ZJ1QJw= MIME-Version: 1.0 Sender: brampton@gmail.com Received: by 10.210.54.15 with SMTP id c15mr48291eba.16.1238151900178; Fri, 27 Mar 2009 04:05:00 -0700 (PDT) In-Reply-To: <20090327071742.GA87385@onelab2.iet.unipi.it> References: <20090327071742.GA87385@onelab2.iet.unipi.it> Date: Fri, 27 Mar 2009 11:05:00 +0000 X-Google-Sender-Auth: 295cf5f2e8dfc2a1 Message-ID: From: Andrew Brampton To: Luigi Rizzo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org Subject: Re: Interrupts + Polling mode (similar to Linux's NAPI) 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: Fri, 27 Mar 2009 11:05:02 -0000 2009/3/27 Luigi Rizzo : > The load of polling is pretty low (within 1% or so) even with > polling. The advantage of having interrupts is faster response > to incoming traffic, not CPU load. oh, I was under the impression that polling spun in a tight loop, thus using 100% of the processor. After a quick test I see this is not the case. I assume it will get to 100% CPU load if I saturate my network. > > There is nothing difficult in having both active, except figuring > out a good logic for when to disable polling on an interface > that has been quiet for a while. Looking at Linux's logic, it appears to poll until there are no more packets, and thus re-enables interrupts. > > I don't know what is the status of polling these days -- when i > wrote it, the architecture was designed for UP kernels, and I > don't know if/how it has been revised to deal efficiently with > the SMP kernels we have now (in other words: one or multiple > polling loops, interaction with interrupt threads, etc.) So, do you think the interrupt+polling has a place in FreeBSD? Now that I know that Polling doesn't consume 100% of the processor, it might be best to "keep it simple stupid". > > =C2=A0 =C2=A0 =C2=A0 =C2=A0cheers > =C2=A0 =C2=A0 =C2=A0 =C2=A0luigi > Thanks for answer my questions, and thanks for writing polling support in the beginning! Andrew