Skip to content

Commit

Permalink
amd-xgbe: Call netif_napi_del on ndo_stop operation
Browse files Browse the repository at this point in the history
Currently the napi context is added using netif_napi_add each time
the ndo_open operation is called.  However, there is not a
corresponding netif_napi_del call during the ndo_stop operation. If
the device ndo_open operation was called more than once an infinite
loop occurs during module unload.  Add a call to netif_napi_del during
the ndo_stop operation.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lendacky, Thomas authored and David S. Miller committed Jul 8, 2014
1 parent 91f8734 commit ff42606
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/ethernet/amd/xgbe/xgbe-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,12 @@ static void xgbe_napi_enable(struct xgbe_prv_data *pdata, unsigned int add)
napi_enable(&pdata->napi);
}

static void xgbe_napi_disable(struct xgbe_prv_data *pdata)
static void xgbe_napi_disable(struct xgbe_prv_data *pdata, unsigned int del)
{
napi_disable(&pdata->napi);

if (del)
netif_napi_del(&pdata->napi);
}

void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
Expand Down Expand Up @@ -518,7 +521,7 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
netif_device_detach(netdev);

netif_tx_stop_all_queues(netdev);
xgbe_napi_disable(pdata);
xgbe_napi_disable(pdata, 0);

/* Powerdown Tx/Rx */
hw_if->powerdown_tx(pdata);
Expand Down Expand Up @@ -607,7 +610,7 @@ static void xgbe_stop(struct xgbe_prv_data *pdata)
phy_stop(pdata->phydev);

netif_tx_stop_all_queues(netdev);
xgbe_napi_disable(pdata);
xgbe_napi_disable(pdata, 1);

xgbe_stop_tx_timers(pdata);

Expand Down

0 comments on commit ff42606

Please sign in to comment.