Cogent 637 board
jtm at smoothsmoothie.com
Thu Nov 10 15:56:46 UTC 2005
Joel Sherrill <joel at OARcorp.com> wrote:
> More than likely ARM memcpy changed from the 4.6 newlib to the current
> 1.13. So this alignment issue is now a factor. I haven't looked at
> newlib yet but if the newlib ARM memcpy does not properly deal with
> misaligned memory, I would consider it a bug in that code and not
> something the driver shoudl deal with except as a potential performance
It's not in the memcpy. That works fine.
Here's what was happening:
Network driver allocates an mbuf and cluster, cluster data is 4-byte
Driver copies received ethernet packet into cluster at offset 0.
This puts the IP header at offset 14, which is not aligned
Sometime later, udp_input() tries to access a 4-byte field in the IP
header, and BOOM - data abort.
My fix was to offset the ethernet header 2 bytes into the cluster. That causes
the IP header to be 4 byte aligned. The ethernet head doesn't need to be 4 byte
aligned, since the only multibyte element in it is 2 bytes long.
More information about the users