Skip to contentSkip to conversation

is eth header is not transmitted

DISCUSSION Sourav Sen 2 participants 2 messages Jan 4, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Sourav Sen

author
#1 lore raw

Ya, I also noticed if it is skb_push() it may work, but where is skb_push() called?? ... the following
is part of the fn. call trace for udp send :

in ip_build_xmit()

sock_alloc_send_skb() -- allocates the sk_buff
skb_reserve() -- advances the data pointer to by
sizeof(hard_hdr) amt.
skb_put() -- puts the ip_hdr
>> getfrag() --> udp_getfrag_nosum()(assuming chksum off) --
sets udp_hdr.
memcpy_fromiovecend() -- puts the data after that.

r->u.dst.output() -- > dev_queue_xmit() -- queues the pkt.

still the data ptr is after hh_hdr, ie. as follows :

+------------------------------------------------------+
| hh_hdr | ip_hdr | udp_hdr | payload |
+------------------------------------------------------+
^ ^ ^
| | |
sk->head sk->data sk->end

On a hadr_start_xmit(), ie say for rtl8129_start_xmit(), the
data sending takes place from skb->data and not from head. So is hh_hdr not transmitted??

Another question is why in sock_alloc_send_skb() , 15 is added to
length field?

Sorry to disturb u like this :)

sourav

Quoted 37 lines · Andi Kleen
Quoted 3 lines · Sourav Sen

Hi,
How can it be skb_put(), it only increments the tail/len ptr ??

Oops typo, it's skb_push() for the header.

-Andi

Quoted 25 lines

sourav

Quoted 20 lines · Andi Kleen
Quoted 7 lines · Sourav Sen

Hi,
In the function ip_build_xmit(), immediately after
sk_alloc_send_skb(), skb_reserve(skb, hh_len) is called. Now skb_reserve(skb,len) only increment the data pointer and tail pointer by len amt.

Quoted 6 lines

Now in a particular hard_start_xmit() say for rtl8139, the data
transfer is taking place from skb->data :

	outl(virt_to_bus(skb->data), ioaddr + TxAddr0 + entry*4)

So, I cannot understand, if transfer starts from data and not head, is ethrnet header not transmitted? what I am missing?

An skb_put()

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
In reply to a message not in the archive
Quoted 15 lines · Sourav Sen

Ya, I also noticed if it is skb_push() it may work, but where is skb_push() called?? ... the following
is part of the fn. call trace for udp send :

in ip_build_xmit()

sock_alloc_send_skb() -- allocates the sk_buff
skb_reserve() -- advances the data pointer to by
sizeof(hard_hdr) amt.
skb_put() -- puts the ip_hdr
>> getfrag() --> udp_getfrag_nosum()(assuming chksum off) --
sets udp_hdr.
memcpy_fromiovecend() -- puts the data after that.

Quoted 1 line

r->u.dst.output() -- > dev_queue_xmit() -- queues the pkt.

dst.output() normally points to ip_output(), which fills the hh in (using appropiate other neighbour callbacks or the hh cache)

Quoted 2 lines

Another question is why in sock_alloc_send_skb() , 15 is added to
length field?

So that you can use long word accesses and it doesn't fault when the packet happens to be at the end of memory. Actually it is not required anymore with the current memory allocator.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/