Related to Network packet in kernel

Tarun Batra tbatra18 at gmail.com
Thu Apr 4 07:59:43 EDT 2013


Hi All,


I was reading "Understanding linux networking Internal" book and the pdf
"Network packet capture in Linux kernelspace" on the link
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDQQFjAA&url=http%3A%2F%2Fberaldoleal.com%2Ftalks%2Fnetworkkernel.pdf&ei=-GldUdeUMNHhrAe8tYDoDg&usg=AFQjCNFe8_oYRoolrVi1o9d8sOT2EV5Dbg&sig2=7D4GBkYZDKWiVTZiNBgzag&bvm=bv.44770516,d.bmk&cad=rja

In the "Understanding linux networking Internal" under topic 9.2.2 it is
given that
The code that takes care of an input frame is split into two parts: first
the driver copies the frame into an input queue accessible by the kernel,
and then the kernel processes it (usually passing it to a handler dedicated
to the associated protocol such as IP). The first part is executed in
interrupt context and can preempt the execution of the second part.

Now the query is when the 2nd part is scheduled and

in "Network packet capture in Linux kernel space" the  packet input flow is
described as:-
When working in interrupt driven model, the nic registers an
interrupt handler;
• This interrupt handler will be called when a frame is received;
• Typically in the handler, we allocate sk buff by calling
dev alloc skb();
• Copies data from nic’s buffer to this struct just created;
• nic call generic reception routine netif rx();
• netif rx() put frame in per cpu queue;
• if queue is full, drop!
• net rx action() decision based on skb->protocol;
• This function basically dequeues the frame and delivery a copy
for every protocol handler;
• ptype all and ptype base queues


I want to know when  netif rx(); and net rx action() are called?
Who call them i mean who schedule them.


Please guide.


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130404/f01634fe/attachment.html 


More information about the Kernelnewbies mailing list