[En-Nut-Discussion] Next Nut/OS 5 release candidate

Harald Kipp harald.kipp at egnite.de
Wed Oct 10 11:59:48 CEST 2012


Hi Ole,

On 10.10.2012 11:40, Ole Reinhardt wrote:

> Hmmm... I darkly remember the discussion about your latest network
> buffer alignment changes, which had been applied so far only for AVR and
> AT91, right? 

You are right.


> Could you please outline again the idea of the changes? AFAIK I still
> need to adapt them to LPC and STM perhaps as well.

Actually the change is transparent.

The Ethernet header is 14 bytes and following headers are misaligned on
32-bit platforms. On transmit, each layer is separately allocated by
each layer, so all is well aligned. But incoming packets are allocated
in a single buffer, which is done in the Ethernet driver.

To solve this with minimal code change, the netbuf allocation had been
extended by an optional offset, which is set to 2 in the AT91 EMAC
driver. This way, the Ethernet header is misaligned by 2, but all
following headers are well aligned again.


> (sorry I did not follow this discussion very intensive)

Well, I think I applied this change quietly. :-) Fortunately, this
didn't prevent Uwe from detecting a bug in the initial commit. This had
been fixed in the meantime.

Once again, there is no real need to add this feature to all Ethernet
drivers. It works well with the existing code. So please, do not blindly
change everything without testing it on a real target.

Regards,

Harald





More information about the En-Nut-Discussion mailing list