Commit 718cff1e authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller
Browse files

sfc: Match calls to netif_napi_add() and netif_napi_del()

sfc could call netif_napi_add() multiple times for the same
napi_struct, corrupting the list of napi_structs for the associated
device and leading to a busy-loop on device removal.  Move the call to
netif_napi_add() and add a call to netif_napi_del() in the obvious

Signed-off-by: default avatarBen Hutchings <>
Signed-off-by: default avatarDavid S. Miller <>
parent 2690f8d6
......@@ -448,9 +448,6 @@ static void efx_init_channels(struct efx_nic *efx)
WARN_ON(channel->rx_pkt != NULL);
netif_napi_add(channel->napi_dev, &channel->napi_str,
efx_poll, napi_weight);
......@@ -1321,6 +1318,8 @@ static int efx_init_napi(struct efx_nic *efx)
efx_for_each_channel(channel, efx) {
channel->napi_dev = efx->net_dev;
netif_napi_add(channel->napi_dev, &channel->napi_str,
efx_poll, napi_weight);
return 0;
......@@ -1330,6 +1329,8 @@ static void efx_fini_napi(struct efx_nic *efx)
struct efx_channel *channel;
efx_for_each_channel(channel, efx) {
if (channel->napi_dev)
channel->napi_dev = NULL;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment