PDA

View Full Version : NAPI support NIC card


rpdumps
7th June 2008, 05:42 AM
Hello All,
How to know whether kernel and NIC card supports NAPI or not ? if yes, how to verify whether it is enabled or disabled ?

I am using Broadcom 5754 Gig NIC card with tg3 driver and kernel 2.6.13-137.fc8.

Thanks
Padmanabhan

rpdumps
9th June 2008, 06:30 PM
Any suggestions or pointers to document on NAPI support/config would be great.

jcliburn
10th June 2008, 02:43 AM

tg3 supports NAPI unconditionally these days. It may have been optional back in 2.6.13, though. (But you probably meant 2.6.23 anyway.) You can grep for TIGON3 in your kernel config (look in /boot) to see if there's an option for NAPI. If you see only

CONFIG_TIGON3=m

then that means NAPI is active by default.

rpdumps
12th June 2008, 05:23 AM
thanks jcliburn,,, yes it was 2.6.23.15-137.fc8 kernel

From this info kernel supports NAPI

[user@localhost boot]$ grep TIGON config-2.6.23.15-137.fc8
# CONFIG_ACENIC_OMIT_TIGON_I is not set
CONFIG_TIGON3=m

but how to know whether NIC card supports it or not ? if it supports , how to disable/enable it ?

[user@localhost boot]$ ethtool -i eth0
driver: tg3
version: 3.81.1
firmware-version: 5754-v3.15
bus-info: 0000:03:00.0

I looked source code of tg3 driver, it seems NAPI is supported

[user@localhost ~]$ grep -i napi tg3.c
napi_disable(&tp->napi);
napi_enable(&tp->napi);
/* run RX thread, within the bounds set by NAPI.
* code synchronizes with tg3->napi.poll()
static int tg3_poll(struct napi_struct *napi, int budget)
struct tg3 *tp = container_of(napi, struct tg3, napi);
netif_rx_complete(tp->dev, napi);
netif_rx_complete(tp->dev, napi);
netif_rx_schedule(dev, &tp->napi);
netif_rx_schedule(dev, &tp->napi);
netif_rx_schedule(dev, &tp->napi);
if (netif_rx_schedule_prep(dev, &tp->napi)) {
__netif_rx_schedule(dev, &tp->napi);
napi_enable(&tp->napi);
* and TX reclaim runs via tp->napi.poll inside of a software
* and TX reclaim runs via tp->napi.poll inside of a software
napi_enable(&tp->napi);
napi_disable(&tp->napi);
napi_disable(&tp->napi);
napi_disable(&tp->napi);
netif_napi_add(dev, &tp->napi, tg3_poll, 64);

Thanks again

jcliburn
12th June 2008, 04:20 PM
You cannot disable NAPI in the tg3 driver; it isn't optional.

I'm not sure what you mean when you ask if the NIC supports NAPI. The kernel network stack provides NAPI support, and it's the driver's task to make use of it. The underlying NIC hardware is unaware of it.

rpdumps
13th June 2008, 05:34 AM
My intention was to know whether NIC driver is capable of utilizing the available support in kernel or not. And also, whether any configuration options available from the driver software to enable/disable it.

from your posts, I understand where to look in kernel for NAPI support and there are no options for NAPI configuration on the driver.

Thanks