Subject: Re: Data alignment
To: Matt Thomas <matt@lkg.dec.com>
From: Craig Metz <cmetz@sundance.itd.nrl.navy.mil>
List: tech-net
Date: 05/21/1996 18:53:32
In message <199605211835.SAA09295@whydos.lkg.dec.com>, you write:
>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.

	I'd have to look, but I'm not sure this is the case. Especially
if you have more complex header manipulation to do (more load/stores in
those headers) than the optimized TCP over IPv4 case.

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

	Why not simply waste two bytes prepadding the mbuf before filling
it in with Ethernet data? My impression was that 4.4 does something
similar to this. The result is that the Ethernet MAC header is unaligned
(yippie -- it's mostly ignoed), but the IP header is four-byte aligned.
This means no need to do an extra copy and you get the alignment.

	I guess it's not clear to me why NetBSD is doing this differently
than 4.4.

								-Craig