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

Re:



Ankit Jain wrote:
> Packet life is detailed nicely in the following doc :
> 
> http://www.kernelnewbies.org/documents/ipnetworking/linuxipnetworking.html
> 
> If you need more details then write back.

Thank you!

This article is very helpful. Also I found the doc on the gnumonks 
site is helpful too. But I yet have some questions.

 From memory (cause my Linux box was shutdown, and I'm going 
asleep), from a hard irq context, NIC drivers posted a skb to the 
per cpu softnet_data, then raised NET_RX_SOFTIRQ, the softirq 
defined in net_rx_action then call dev->poll for that skb, the 
dev->poll function, besides doing other works, will call a handle 
function in accordance with the pkt_type of that skb, then, in case 
of IPv4, the handle which is ip_rcv() got called, then after awhile, 
the skb rests in a (struct sock *sk) waiting for a syscall to grab 
it to the user-space. Is the above scenario I got it right?

My question is that, why NET_RX_SOFTIRQ does not kick the skb in 
softnet_data right away to ip_rcv() or othre corresponding handling 
functions? Why does the irq have to call back to the NIC driver for 
a dev->poll? Why left the task for NIC driver to decide which 
up-layer protocol shall be sent the skb?

Guess that I should read a NIC driver source code to get the answer 
myself. But, you know, NIC driver code is not very easy to grasp, 
full of hardware details which I don't understand.

Yours,
zw

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/