[Top][All Lists]

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

Re: [lwip-users] pbuf related question

From: EVS Hardware Dpt
Subject: Re: [lwip-users] pbuf related question
Date: Tue, 29 Nov 2005 10:15:00 +0100

Dear Sathya,

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
sufficent space.

Hope this helps.

Frederic Lefranc.

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?
>  Thanks,
>  Sathya
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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