From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 2 23:27:49 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1850616A403 for ; Thu, 2 Nov 2006 23:27:49 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78CB843D67 for ; Thu, 2 Nov 2006 23:27:48 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.80] ([10.0.0.80]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id kA2NRlIu056547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Nov 2006 15:27:48 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <454A7EF2.5090201@errno.com> Date: Thu, 02 Nov 2006 15:27:46 -0800 From: Sam Leffler Organization: Errno Consulting User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: "Devon H. O'Dell" References: <9ab217670611021511l3120d58bhd0b61bf44f8ecc87@mail.gmail.com> In-Reply-To: <9ab217670611021511l3120d58bhd0b61bf44f8ecc87@mail.gmail.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: vr(4) performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Nov 2006 23:27:49 -0000 Devon H. O'Dell wrote: > Hey all, > > So, vr(4) kind of sucks, and it seems like this is mostly due to the > fact that we call m_defrag() on every mbuf that we send through it. > This seems to really screw performance on outgoing packets (something > like 33% the output efficiency of fxp(4), if I'm understanding this > all correctly). > > I'm sort of wondering if anybody has attempted to address this before > and if there's a way to possibly mitigate this behavior. I know Bill > Paul's comments say ``Unfortunately, FreeBSD FreeBSD doesn't guarantee > that mbufs will be filled in starting at longword boundaries, so we > have to do a buffer copy before transmission.'' -- since it's been a > long day, and I'm about to go home to grab a pizza and stop thinking > about code, would anybody mind offering suggestions as to either: > > a) Pros and cons of guaranteeing that they're filled in aligned (and > possibly hints on doing it), or > b) Possible workarounds / hacks to do this faster for vr(4) > > Any input is appreciated! (Except ``vr(4) is lol'') m_defrag is ~10x slower than it needs to be. I proposed changes to address this a while back but eventually gave up and put driver-specific code in ath. You can look there or I can send you some patches to m_defrag to try out in vr. Sam