[En-Nut-Discussion] r4691: More fixes to problem r4558/r4028
harald.kipp at egnite.de
Mon Oct 1 19:59:36 CEST 2012
On 01.10.2012 16:45, Uwe Bonnes wrote:
> r4458 introduced a problem that stopped the http demo on Olimex
> SAM7-EX256. I traced it down that the size argument (NBAF_DATALINK + 2) in
> NutNetBufAllocData was compared against NBAF_DATALINK.
You're right, the type is masked for NUTASSERT only, but still used
below unmasked. The fix looks OK to me. Just the if() statement isn't
type &= NBAF_ALL;
should work too. No idea, why I didn't recognize this bug. I'm sorry for
having it introduced.
> I think the change has to be applied on other EMAC too.
The change is not really required, but increases Ethernet throughput on
32-bit targets, specifically if they are linked with newlib.
However, I'm only able to test dev\dm9000.c, dev\lan91.c
I tested r4458 mainly with dev/dm9000.c, which uses automatically the
right offset for the current target
NBAF_DATALINK + (2 & (NUTMEM_ALIGNMENT - 1))
while arch\arm\dev\atmel\at91_emac.c uses
NBAF_DATALINK + 2
which I think is OK, because it will only run on ARMs.
More information about the En-Nut-Discussion