文章归档

NAPI: the new device driver packet processing framework

在napi方式还没有出现之前,网络数据包的接收过程大概是这样的:

  1. 数据包达到网卡,硬中断,中断处理程序处理数据包,调用netif_rx()将数据包放到cpu队列
  2. 然后出发软中断去调用net_rx_action()函数,内核将cpu队列中的数据包送到网络层

napi要解决的问题是:

  • Interrupt mitigation: High-speed networking can create thousands of interrupts per second, all of which tell the system something it already knew: it has lots of packets to process. NAPI allows drivers to run with (some) interrupts disabled during times of high traffic, with a corresponding decrease in system load.
  • Packet throttling :When the system is overwhelmed and must drop packets, it's better if those packets are disposed of before much effort goes into processing them. NAPI-compliant drivers can often cause packets to be dropped in the network adaptor itself, before

    »» 继续阅读全文

第 2 页,共 2 页12