Re: IP Header

From: Andi Kleen (ak@suse.de)
Date: Sat Jun 03 2000 - 14:59:06 EST


On Sat, Jun 03, 2000 at 08:06:52PM +0530, Manish Kumar C wrote:
> Hi,
>
> Could you please tell me any way by which, I need not ensure that the IP
> header
> begins on a 16 byte aligned boundary, when I pass an sk_buff up from my
> driver on the receive side. Is it necessary that the IP header should be 16
> byte aligned?

It is not required, but it is recommended for good performance. On some
architectures (e.g. Alpha,ARM) unaligned accesses are slow enough that it
is faster to copy the whole packet to an -2 aligned address first (so that
the ip header ends up aligned). Even on x86 it hurts.

The obvious fix (only copying the header instead of the whole packet)
is not supported in the stack yet. I plan to fix that in 2.5.

You should probably add the code to copy the whole packet, but comment
it out and decide on benchmarks.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:32 EST