[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [microblaze-uclinux] xenet_FifoSend(struct sk_buff *orig_skb,structnet_device *dev)
Hi,
John Williams wrote:
> That's the primary entry point for the upper network layer to send a
> packet via this device. The alignment requirement is deeply
> ingrained
> into the kernel. The problem comes about because ethernet
> frame headers
> are not a multiple of 4 bytes long, but kernel expects (or at least
> assumes) that IP header fields are word aligned.
I analyzed the TCP stack sources a bit and tried to force the proper alignment by changing the logic.
It seems one simply must do right behind sk_stream_alloc_pskb(...) in tpc.c:tcp_sendmsg() the following:
if (!alignedProperly) {
skb_reserve(skb,2);
}
The effect is that (for instance when a user program calls sendto()) the first data copying from user data to all the single skb's leads to an unefficient call to memcpy() because the destination pointer has offset=2.
But later when it comes to adapter.c:xenet_FifoSend() the skb->data pointer is aligned properly and I could prevent the memcpy() stuff in that function.
Just a little problem remains there: Still the checksum must be calculated here which leads to arch/microblaze/lib/checksum.c:do_csum() which now seems to eat most of the time which is spent in xenet_FifoSend().
That is why I didn't see a speedup although memcpy() is called just rarely in xenet_FifoSend here now.
Hmm... well... sigh...
CU, Falk
P.S.: The above description doesn't contain some other little but necessary tweaks here and there...
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/