From owner-freebsd-net@FreeBSD.ORG Wed Oct 29 10:36:47 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 755B61065673 for ; Wed, 29 Oct 2008 10:36:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id F21E98FC08 for ; Wed, 29 Oct 2008 10:36:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 226412545; Wed, 29 Oct 2008 12:36:45 +0200 Message-ID: <49083CBD.1000701@FreeBSD.org> Date: Wed, 29 Oct 2008 12:36:45 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Bartosz Giza References: <1225203780.00029971.1225190402@10.7.7.3> <200810281613.13719.gizmen@blurp.pl> <490755A3.4050903@FreeBSD.org> <200810290953.28237.gizmen@blurp.pl> In-Reply-To: <200810290953.28237.gizmen@blurp.pl> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-net@freebsd.org Subject: Re: two NIC on 2 core system (scheduling problem) 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: Wed, 29 Oct 2008 10:36:47 -0000 Bartosz Giza wrote: > Tuesday 28 of October 2008 19:10:43 Alexander Motin napisaƂ(a): >> Bartosz Giza wrote: >>>> The CPU time you see there includes much more then just a card >>>> handling itself. It also includes CPU time of the most parts of >>>> network stack used to process received packet. So if you have NAT, big >>>> firewall, netgraph or any other CPU-hungry actions done with packets >>>> incoming via em0 you will see such results. >>>> Even more interesting is that if bge0 or fxp0 cards will require much >>>> CPU time to send packet, this time will also be accounted to em0 >>>> process. > > I have checked this and you are right. When i turned off ipfw; taskq process > started to use less cpu. But still what is strange why processing from > other cards are counted in em0 taskq ? What you mean by "processing from other cards"? em0 taskq counts all processing caused by packets incoming via em0 up to and including processing of their transmission by bge/fxp drivers. Same is about bge/fxp. If bge/fxp/em drivers would have separate transmission processes - you would see them, but they don't, so their CPU time accounted to the caller. > This is quite strange and in that > way em0 taskq process is using more cpu on one of the cores. So what i > think the best would be to have only em NICs because processing of the > packets would be splitted to those taskq processes is that right ? em0 processes packets in separate process named taskq, bge does it directly in interrupt handler process. There is no principal difference for you I think. > Ok, good to know. But how is counted firewall overhead when i would have > only bge cards. They don't use taskq so i assume i would see this as system > usage correct ? You would see a lot of interrupt time in this case. -- Alexander Motin