[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,

Jim Law wrote:
> I could also 
> write a much faster "move_halfword_higher()" specific 
> function for use in 
> adapter.c, particularly if the following constraints are ok:
Cool.

> I'm not fully understanding the relative position of 
> skb->head and skb-> 
> data -- can you clarify please?
1.) FifoRecvHandler() calls alloc_skb().
  Look in net/core/skbuff.c:__alloc_skb():
    ...
    data = kmalloc_node_track_caller();
    ...
    skb->head = data;
    skb->data = data;
    ...
    So firstly they are equal.
2.) XEmac_FifoRecv() gets a properly aligned skb->data.
3.) Then the received data is moved 2 bytes behind.
4.) skb->data is set to be skb->head+2.
    The reason is the higher TCP stack layers will skip the TCP header
    and access the user data in the TCP packet. The header is 12+20+20=54
    bytes which is not a multiple of 4. So they skip 54 bytes plus
    our 2 bytes memmove offset and again we are at a 4byte-aligned
    address. That's the only reason.
    But skb->head is still stored for kfree().
    If the TCP header hadn't such bad size, there would be a problem at all.

Cheers, Falk

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