From owner-freebsd-net@FreeBSD.ORG Thu Apr 28 17:01:02 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BA4416A4CE; Thu, 28 Apr 2005 17:01:02 +0000 (GMT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4469843D31; Thu, 28 Apr 2005 17:01:02 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.8) with ESMTP id j3SH0lgH093094; Thu, 28 Apr 2005 10:00:47 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j3SH0l6n093093; Thu, 28 Apr 2005 10:00:47 -0700 (PDT) (envelope-from rizzo) Date: Thu, 28 Apr 2005 10:00:47 -0700 From: Luigi Rizzo To: Bruce M Simpson Message-ID: <20050428100047.B92681@xorpc.icir.org> References: <20050428135120.GB21428@cell.sick.ru> <427111BF.2050607@savvis.net> <20050428165026.GG747@empiric.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050428165026.GG747@empiric.icir.org>; from bms@spc.org on Thu, Apr 28, 2005 at 05:50:26PM +0100 cc: harti@freebsd.org cc: net@freebsd.org cc: jmg@freebsd.org cc: Sten Spans Subject: Re: if_tap unaligned access problem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2005 17:01:02 -0000 On Thu, Apr 28, 2005 at 05:50:26PM +0100, Bruce M Simpson wrote: ... > jmg's suggestion of bringing in the NetBSD patches to allow the entire > network stack to be compiled with unaligned accesses (for those platforms > which support it) is interesting because it can simplify or eliminate > some of the acrobatics needed in network drivers to deal with the mbuf > alignment. very true. If a module has requirement alignments it should solve it by itself and not put the burden on dozens of other modules (i.e. device drivers) upstream. Beside being hard to maintain, the result leads to all sort of inefficiencies. E.g. some time ago when i worked on polling, i removed (only on i386) the aligment-bcopy from the "rl" driver. People complained that further up in the stack the misalgnment would cause a slowdown, but it turns out that the aligmnent-bcopy (which had to operate on unaligned data) was a lot more inefficient than the unaligned accesses in the upper layer, as you would end up paying the overhead for all packets and their entire size, instead of doing that only when strictly necessary. cheers luigi