2009-12-21 24 views

回答

6

我知道這聽起來像一個明顯的答案,但檢查源,以查看是否正在使用NAPI API。
例如

  • 在驅動程序的中斷處理程序,它使用以下任何電話?
  • 請問你的驅動程序實現對NAPI一個poll()方法?如果是這樣,看看它是否使用 netif_receive_skb()的代替netif_rx()

如果這兩個問題都導致「是」,那麼您的驅動程序正在使用NAPI。

注:以下是從here

NAPI API 

netif_rx_schedule(dev) 
    Called by an IRQ handler to schedule a poll for device 
netif_rx_schedule_prep(dev) 
    puts the device in a state ready to be added to the CPU polling list if it is up and running. You can look at this as the first half of netif_rx_schedule(dev). 
__netif_rx_schedule(dev) 
    Add device to the poll list for this CPU; assuming that netif_schedule_prep(dev) has already been called and returned 1 
__netif_rx_schedule_prep(dev) 
    similar to netif_rx_schedule_prep(dev) but no check if device is up, usually not used 
netif_rx_reschedule(dev, undo) 
    Called to reschedule polling for device specifically for some deficient hardware. 
netif_rx_complete(dev) 
    Remove interface from the CPU poll list: it must be in the poll list on current cpu. This primitive is called by dev->poll(), when it completes its work. The device cannot be out of poll list at this call, if it is then clearly it is a BUG(). 
__netif_rx_complete(dev) 
    same as netif_rx_complete but called when local interrupts are already disabled. 

看看這個wikipedia article和它的外部鏈接更詳細的信息複製。

我希望有幫助。