lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Ang: Re: Bare Metal / Memory Alignment


From: Bill Auerbach
Subject: Re: [lwip-users] Ang: Re: Bare Metal / Memory Alignment
Date: Wed, 7 Sep 2011 17:10:50 -0400

Maybe it clears things up to say ETH_PAD_SIZE (which is usually 0 or 2) adds
bytes to eth_hdr so that everything *after* the header is 32-bit aligned.
But this must be used with Ethernet controllers that support either packet
offsets of 2 (meaning they skip the ETH_PAD_BYTES), or ones that store 16
bytes at the start (filling in the ETH_PAD_SIZE bytes).

Bill

>-----Original Message-----
>Most protocol headers happen to be aligned correctly for 32-bit
>processors if you insert 2 bytes before the Ethernet header. However,
>that's not supported by us, currently. So if it works, it does so by
>chance... If you get it to work without packing, you're lucky enough,
>but I doubt that it has too big of an influence on throughput, as many
>header members are only read once.
>
>Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]