From owner-freebsd-net@FreeBSD.ORG Fri Mar 18 09:24:31 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 5CF3B16A4CE for ; Fri, 18 Mar 2005 09:24:31 +0000 (GMT) Received: from mail27.sea5.speakeasy.net (mail27.sea5.speakeasy.net [69.17.117.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB0F643D58 for ; Fri, 18 Mar 2005 09:24:30 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 30862 invoked from network); 18 Mar 2005 09:24:30 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail27.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 18 Mar 2005 09:24:30 -0000 Received: from hydrogen.funkthat.com (jajcho@localhost.funkthat.com [127.0.0.1])j2I9OTGH054630; Fri, 18 Mar 2005 01:24:30 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id j2I9OT33054629; Fri, 18 Mar 2005 01:24:29 -0800 (PST) Date: Fri, 18 Mar 2005 01:24:29 -0800 From: John-Mark Gurney To: Mike Silbersack Message-ID: <20050318092429.GD37984@funkthat.com> Mail-Followup-To: Mike Silbersack , freebsd-net@FreeBSD.org References: <20050317221359.GN89312@funkthat.com> <20050318021907.H844@odysseus.silby.com> <20050318082810.GC37984@funkthat.com> <20050318024418.D844@odysseus.silby.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050318024418.D844@odysseus.silby.com> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: freebsd-net@FreeBSD.org Subject: Re: changes to make ethernet packets able to be unaligned... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2005 09:24:31 -0000 Mike Silbersack wrote this message on Fri, Mar 18, 2005 at 02:48 -0600: > > On Fri, 18 Mar 2005, John-Mark Gurney wrote: > > >>I'm confused - don't sparc64 and alpha have similar alignment > >>requirements? Why does arm require code changes? > > > >yes, the alignment constraints for arm are the same.. the reason I > >said the above is only for arm is the epe driver (which is only on > >an ARM core) has been made to use the new feature... > > > >The changes to ip_input.c will work with other drivers as well... it > >just needs to make sure that the proper defines are in amd64 and i386 > >so that we don't do the fix up when we don't need to... > > > >-- > > John-Mark Gurney Voice: +1 415 225 5579 > > Ok, I see what you're saying now, I had forgotten the #ifdef i386 sections > we have scattered throughout the network drivers. When I read your > original commit, I was thinking about the transmit paths in drivers, which > is why m_copyup made no sense to me. > > Moving the alignment out of the drivers and into a common place seems like > a good idea, but I wonder if it should be done in the ethernet code > instead of in the ip code; won't other protocols have unaligned access > problems if the change is made exactly as is? Why force it on the protocols that might not need it? We don't know how much of the ip or foo header to bring in at the ethernet layer, so the ip or foo layer might have to bring in more data... IMO, it's the protocol's job to ensure that it has correct alignment to access the data... what happens when a protocol comes along that requires the packet to be 8byte aligned? and the ethernet layer only aligned it on a 4byte boundary? should we add a third mbuf to it? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."