[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] xenet_FifoSend(struct sk_buff *orig_skb, struct net_device *dev)



Hi Falk,

Brettschneider Falk wrote:

I had a look at xenet_FifoSend(), noticed the necessary memcpy() of the TCP data to a DWORD-aligned address, but was wondering if we can do the
 new_skb = alloc_skb(...)
only once on the first call to xenet_FifoSend() and with a package maximum size, and then reuse new_skb for each call to xenet_FifoSend().
This would reduce the permanent alloc and free for each socket buffer copy.

It might save some time, yes.  One way to find out :)

We measured the spent time of xenet_FifoSend() with 600us and just 50us were used in XEmac_FifoSend().

If you can measure the time taken in other parts of FifoSend, my guess is a large part is the unavoidable memcpy / skb_copy_and_csum_dev() calls.

Though I don't know how long the spin_lock_irqsave/spin_lock_irqrestore pair takes.
The only thing would be that the copy buffer would never be freed, but maybe we can live with it.

If you alloc the skb in the driver init function, and free it in driver shutdown, then it will not live forever (if e.g. loaded as a module).

You will need to make sure you update the length setting and maybe a few other details, but it sholdn't be a difficult hack to try. But, I'm not sure how much you'll save - every bit counts I suppose!

Cheers,

John

___________________________
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/