[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.
Here are 2 patches, applying both of them makes xenet_FifoSend() much faster. Patch skbuff.c.diff makes the data aligned for xenet_FifoSend(), patch adapter.c.diff checks the alignment and avoids memcpy() in case of that it's aligned.
Patch skbuff.c.diff slows down tpc.c:tcp_sendmsg() because the memcpy() there has offset=2 now, but the second memcpy() which had offset=2 anyway is completely prevented now. So after all it's better now.

What do you think about these 2 patches?

My user program was permanently sending data. Time measuring with an oscilloscop showed that most of the time the spent time in xenet_FifoSend() is reduced from about 600us to about 200us. The 200us consists of 100us checksum calculation plus 100us spent in XEmac_FifoSend().

Though I noticed that the call of xenet_FifoSend() is just every millisecond. That is why the data throughput (Megabytes per second) to my PC keeps the same. Is xenet_FifoSend() called by a timer with such frequency of 1/ms? If yes, can it be reduced?

CU, F@lk

Attachment: skbuff.c.diff
Description: skbuff.c.diff

Attachment: adapter.c.diff
Description: adapter.c.diff