linux - What are the advantages NAPI before the IRQ Coalesce? -
There are two aspects to avoiding some overheads of hardware interrupt in the Highlide network, because when too many hardware interrupts, it takes a lot of time to switch to them. It is very important for performance and to choose the style of the program style.
- - Do not use hardware interrupts , and for every fixed period The Linux kernel uses interrupt-driven mode by default and only switches to voting mode when incoming packets flow over a certain threshold.
The kernel can check periodically without interrupting for incoming incoming network packets, which Ends the overhead of interrupt processing.
- - uses hardware interrupts , but if in the meantime, for some time the interval and startup After which the voting ends and becomes active in the middle.
A technique that contains events that usually hardware intercept are retained , either a certain job To sum up , or timeout timer is triggered
There is no significant cost of interruption in both approaches - this benefit is for default interrupt-d Iven mode < / P>
Low latency - Second
Once the package arrives, immediately stop it immediately Of to have tried or when the middle recently happened. The opposite NAPI will not take action immediately on the frame, but will wait for some time for the next election.
Low CPU usage - only the election starts if at least one packet has already arrived but is not voting in vain, Even if the frames are not received, as it has done the NPI.
What are the benefits of NAPI before the IRQ coal?
I see NAPI as interrupt collessing. I think your question may be with misunderstanding about NAPI. First of all, interactions with NAPI are included. Apart from this, NAPI polling is not really "in vain"; Remember, for NAPI, this idea is that high flow traffic is Barfee, after NAPI "packet interrupt" "Starts".
Here's a quick overview of how to use NAPI:
Kernel "packet receiving" hurdle, which detects a network device driver NAPI. The network device driver then disables the interrupt related packet receipt and tells the Linux networking subsystem to vote the device driver using NAPI. The voting function is implemented by the device driver, and the networking subsystem is passed, and it contains the device driver's packet handler. After getting enough packets or reaching the conclusion, interrupts receiving packets are re-enabled, and everything starts again.
Therefore, NAPI has basically given a clean framework for the device driver developers to be in the middle of collessing, reducing the Linux Networking subsystem to receive subsistence conditions for support of interrupt collation. NAPI does not run all the time, but only when traffic is actually received, it is essentially planning an interval coloncing scheme ... at least in my book.
Note : This was all in reference to a network device driver using NAPI, but in reality NAPI can be used for any type of interrupt. This is also one of the benefits of NAPI.
If there is a mistake in my understanding, please feel free to tell them!