LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-20-2010, 01:59 AM   #1
sarvesh
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Rep: Reputation: 0
How interrupts and polling works for napi ethernet driver?


How interrupts and polling works for napi ethernet driver?
And what about the role of top and bottom half for these two?
 
Old 04-21-2010, 02:15 PM   #2
johnu
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Rep: Reputation: 0
Hmmm.. Thought I replied, but it's not showing up... Ok, I'll try again:

When an ethernet interrupt occurs, the interrupt is disabled, and bottom half is woken up. When the bottom half wakes up, it processes the incoming packets. It will attempt to service all packets on the queue, but will stop if it hits a certain limit. If the bottom half thinks reaches the end of the queue, it will reenable the interrupt. Otherwise, the bottom half will allow bottom halves of other interfaces to have a turn, and will then resume when they are done.

This gives you a performance boost by reducing the number of interrupts the processor has to process. There's several web sites which describe NAPI in more detail, or you can peruse the code for more details.

John
 
Old 04-21-2010, 11:12 PM   #3
sarvesh
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by johnu View Post
Hmmm.. Thought I replied, but it's not showing up... Ok, I'll try again:

When an ethernet interrupt occurs, the interrupt is disabled, and bottom half is woken up. When the bottom half wakes up, it processes the incoming packets. It will attempt to service all packets on the queue, but will stop if it hits a certain limit. If the bottom half thinks reaches the end of the queue, it will reenable the interrupt. Otherwise, the bottom half will allow bottom halves of other interfaces to have a turn, and will then resume when they are done.

This gives you a performance boost by reducing the number of interrupts the processor has to process. There's several web sites which describe NAPI in more detail, or you can peruse the code for more details.

John
But what happens to packets coming on NIC, when interrupts are disabled ??
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
query ..napi and non-napi compatibilty in tg3 ethernet driver for kernel 2.6.28 sarvesh Linux - Kernel 1 04-14-2010 07:19 PM
query ..napi and non-napi compatibilty in tg3 ethernet driver for kernel 2.6.28 sarvesh Linux - Networking 0 04-08-2010 11:32 PM
Interrupts and precedence in an Ethernet driver TX/RX? Tasklets? 2 drivers 1 device? AustinMarton Linux - Kernel 2 12-09-2008 04:11 PM
NAPI changing frequeny for polling Packet_Crazy Linux - Networking 1 08-16-2006 03:05 PM
NAPI in linux with kernel 2.6 for device polling wangjinyi Linux - Networking 0 09-22-2005 02:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration