[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] Questions about the Ethernet interface
Peter Ryser wrote:
> Are MB caches on or off? Did you try to turn caches off (I know it's
> slow but maybe it's a cache related problem)?
ok i'm pretty saure i've nailed it now - here's the problem:
1. the xemac driver allocates an sk_buff, makes sure it is word aligned,
then copies the data from the packet_fifo into the sk_buff.
2. it strips off the ethernet header (22 bytes). for performance
reasons, the kernel simply shuffles pointers in the sk_buff, rather than
actually moving data around.
3. now, the start of the actual IP packet (ie the header) is at a non
word-aligned address.
Here's the problem - the assembly code generated by mb-gcc to access the
4-bit packed bitfields (iph->version and iph->ihl) assumes word
alignment of the structure, and so returns bad data.
The reason it works with the internal loopback device is that loopback
packets never actually get an ethernet header put on them, so always
retain the word alignment. However, any real network packets will have
this alignment problem.
so, looks like a compiler issue - i'll talk to sid about it.
regards,
John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/