|
From: | Tyrel Newton |
Subject: | [lwip-users] byte alignment |
Date: | Mon, 03 May 2010 23:18:38 -0700 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 |
For my case, it would seem that un-aligning the contained IP/TCP frames would be better so that the final copy to the mac is aligned at the start of the Ethernet frame. I'm wondering about the validity of this statement and if it has any merit performances wise. If the Ethernet frame being sent is not 32-bit aligned, I basically have to do byte reads to a temporary buffer which is then written to the mac.
My other question is about actually getting the pbuf->payload to be 32-bit aligned at the start of the generated Ethernet frame. I would think that setting ETH_PAD_SIZE=0 and MEM_ALIGNMENT=4 would produce 32-bit aligned Ethernet frames in the resulting PBUF_RAM-type pbufs. However, this doesn't seem to be the case in my testing as the p->payload in PBUF_RAM-type pbufs appear to always be 16-bit aligned with the aforementioned settings. What settings do I need to create 32-bit aligned Ethernet frames for output? Btw, I'm using malloc/free as provided by my libc build.
Thanks, Tyrel
[Prev in Thread] | Current Thread | [Next in Thread] |