From owner-freebsd-net@FreeBSD.ORG Tue May 1 14:27:41 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4979106566C; Tue, 1 May 2012 14:27:41 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 960968FC0A; Tue, 1 May 2012 14:27:41 +0000 (UTC) Received: from [209.249.190.124] (port=56103 helo=[10.2.212.229]) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1SPE3I-0007HC-O8; Tue, 01 May 2012 10:27:40 -0400 Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: <20120420190309.GA5617@onelab2.iet.unipi.it> Date: Tue, 1 May 2012 10:27:42 -0400 Content-Transfer-Encoding: 7bit Message-Id: References: <20120419133018.GA91364@onelab2.iet.unipi.it> <20120420190309.GA5617@onelab2.iet.unipi.it> To: Luigi Rizzo X-Mailer: Apple Mail (2.1257) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: current@freebsd.org, net@freebsd.org Subject: Re: more network performance info: ether_output() 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: Tue, 01 May 2012 14:27:41 -0000 On Apr 20, 2012, at 15:03 , Luigi Rizzo wrote: > Continuing my profiling on network performance, another place > were we waste a lot of time is if_ethersubr.c::ether_output() > > In particular, from the beginning of ether_output() to the > final call to ether_output_frame() the code takes slightly > more than 210ns on my i7-870 CPU running at 2.93 GHz + TurboBoost. > In particular: > > - the route does not have a MAC address (lle) attached, which causes > arpresolve() to be called all the times. This consumes about 100ns. > It happens also with locally sourced TCP. > Using the flowtable cuts this time down to about 30-40ns > > - another 100ns is spend to copy the MAC header into the mbuf, > and then check whether a local copy should be looped back. > Unfortunately the code here is a bit convoluted so the > header fields are copied twice, and using memcpy on the > individual pieces. > > Note that all the above happens not just with my udp flooding > tests, but also with regular TCP traffic. Hi Luigi, I'm really glad you're working on this. I may have missed this in a thread but are you tracking these somewhere so we can pick them up and fix them? Also, how are you doing the measurements. Sorry, if these have been answered before. Best, George