Subject: Re: Data alignment
To: Craig Metz <cmetz@inner.net>
From: Matt Thomas <matt@lkg.dec.com>
List: tech-net
Date: 05/21/1996 18:35:20
In  <9605211436.aa19118@sundance.itd.nrl.navy.mil> , you wrote:

> 
> 	I noticed that NetBSD (-current May 11) doesn't seem to be as careful
> as 4.4 about aligning header data.
> 
> 	For loopback, with no MAC header, everything's word aligned and happy.
> 
> 	But on Ethernet, NetBSD passes ipintr() a mbuf where mt_data is
> aligned to a two-byte boundary but NOT to a four-byte boundary as it is in
> straight 4.4. Is this a known and/or fixed problem? Unless I'm missing
> something huge, on x86 it would give better total performance to copy the
> headers to an aligned buffer, and, on several RISCy systems, it'll panic.

On the x86, coping the data such that it would be aligned actually causes
worse performance that just accessing the data unaligned.  So just leave
the unaligned if that's the way it came in.

On those architecures that require the alignment, you are forced to do
the data copy.



> 									-Craig

-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt.html
Westford, MA              Disclaimer: I disavow all knowledge of this message