Kernel emits "netif_napi_add() called with weight W on device DEV" during network device initialization

Solution Verified - Updated -

Environment

Red Hat Enterprise Linux 6.6 or later

Issue

The kernel emits an error message during the initialization of a network interface using a 3rd party driver:

netif_napi_add() called with weight W on device DEV

where W is a number greater than 64 and DEV is the name of the network interface.

Resolution

Contact the network driver vendor to receive a fixed version of the driver.

Root Cause

NAPI is an interrupt mitigation mechanism used by the Linux kernel. During workloads with high rates of incoming network packets the kernel disables interrupts of the receiving network devices. The kernel then polls the network devices in a round-robin fashion to receive data. The polling "weight" parameter specifies how many packets to receive before moving on to polling the next device.

Network drivers register to NAPI by calling the function netif_napi_add(). They specify the polling weight as one of the parameters. If a driver uses a too big weight, it is a problem, because it would get an unfair share of receive compute resources. It would penalize drivers that actually set the weight reasonably. The kernel in Red Hat Enterprise Linux 6.6 (or later) checks the NAPI polling weights requested by drivers and it prints an error message if a driver requests a weight bigger than 64. The detected error is not fatal. The device is still allowed to function normally. However, for optimal receive performance and fairness among multiple devices drivers should be fixed to use proper NAPI polling weights.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments