views:

315

answers:

1

Is there a way to confirm if a Linux Ethernet driver is using the NAPI interface?

+3  A: 

I know this sounds like an obvious answer, but check the source to see if the NAPI API is being used.
For example:

  • In your driver's interrupt handler, does it use any of the calls below?
  • Does your driver implement a poll() method for the NAPI? If so, see if it uses netif_receive_skb() instead of netif_rx().

If both of those questions lead to 'YES', the your driver is using NAPI.

Note: The following was copied from 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.

Check out this wikipedia article and the external links in it for more detailed information.

I hope that helps.

Steve Lazaridis