|Subject:||Re: [lwip-users] pbuf related question|
|Date:||Tue, 29 Nov 2005 10:20:04 -0800|
If you look at the coldfire sample, you'll see that for the RX part,
it's necessary to align data on 32 bytes boundaries (or 64, I don't
remember exactly). To do it, the author simply adjust payload field of
the newly created pbuf. It's also what we do in our design (MPC8347).
The problem could be that if it's the stack that allocate a buffer of
size x, then the payload alignement could lead to a buffer overflow
(if base address is not aligned, and you must increment base by y,
then you buffer size is now x+y). So it's up to you to allocate
Hope this helps.
2005/11/29, Sathya Thammanur < address@hidden>:
> Hi all,
> Is it possible to align the "payload" of a pbuf? I am aware of the
> MEM_ALIGNMENT configuration in lwipopts.h that is used to set the alignment.
> Whenever I do allocate a pbuf on the Rx path (PBUF_RAW) in my low level
> adapter, I do see the alignment working in place. However, on the Tx path,
> when the stack allocates a pbuf to send out replies, at the ethernetif
> adapter level the alignment is not present. I havent looked closedly at
> pbuf.c to see how the allocation happens.
> Is there any other option that I need to set so that I can ensure that the
> payload of pbuf (and hence the ethernet frame) is aligned appropriately?
> lwip-users mailing list
lwip-users mailing list
|[Prev in Thread]||Current Thread||[Next in Thread]|