mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
bcm63xx_enet: fix poll callback.
In case there was some tx buffer reclaimed and not enough rx packets to consume the whole budget, napi_complete would not be called and interrupts would be kept disabled, effectively resulting in the network core never to call the poll callback again and no rx/tx interrupts to be fired either. Fix that by only accounting the rx work done in the poll callback. Signed-off-by: Nicolas Schichan <nschichan@freebox.fr> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8f02d8da96
commit
cd33ccf5fd
1 changed files with 4 additions and 4 deletions
|
@ -486,7 +486,7 @@ static int bcm_enet_poll(struct napi_struct *napi, int budget)
|
||||||
{
|
{
|
||||||
struct bcm_enet_priv *priv;
|
struct bcm_enet_priv *priv;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
int tx_work_done, rx_work_done;
|
int rx_work_done;
|
||||||
|
|
||||||
priv = container_of(napi, struct bcm_enet_priv, napi);
|
priv = container_of(napi, struct bcm_enet_priv, napi);
|
||||||
dev = priv->net_dev;
|
dev = priv->net_dev;
|
||||||
|
@ -498,14 +498,14 @@ static int bcm_enet_poll(struct napi_struct *napi, int budget)
|
||||||
ENETDMAC_IR, priv->tx_chan);
|
ENETDMAC_IR, priv->tx_chan);
|
||||||
|
|
||||||
/* reclaim sent skb */
|
/* reclaim sent skb */
|
||||||
tx_work_done = bcm_enet_tx_reclaim(dev, 0);
|
bcm_enet_tx_reclaim(dev, 0);
|
||||||
|
|
||||||
spin_lock(&priv->rx_lock);
|
spin_lock(&priv->rx_lock);
|
||||||
rx_work_done = bcm_enet_receive_queue(dev, budget);
|
rx_work_done = bcm_enet_receive_queue(dev, budget);
|
||||||
spin_unlock(&priv->rx_lock);
|
spin_unlock(&priv->rx_lock);
|
||||||
|
|
||||||
if (rx_work_done >= budget || tx_work_done > 0) {
|
if (rx_work_done >= budget) {
|
||||||
/* rx/tx queue is not yet empty/clean */
|
/* rx queue is not yet empty/clean */
|
||||||
return rx_work_done;
|
return rx_work_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue