Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nicolas Schichan and committed by
David S. Miller
cd33ccf5 8f02d8da

+4 -4
+4 -4
drivers/net/ethernet/broadcom/bcm63xx_enet.c
··· 486 486 { 487 487 struct bcm_enet_priv *priv; 488 488 struct net_device *dev; 489 - int tx_work_done, rx_work_done; 489 + int rx_work_done; 490 490 491 491 priv = container_of(napi, struct bcm_enet_priv, napi); 492 492 dev = priv->net_dev; ··· 498 498 ENETDMAC_IR, priv->tx_chan); 499 499 500 500 /* reclaim sent skb */ 501 - tx_work_done = bcm_enet_tx_reclaim(dev, 0); 501 + bcm_enet_tx_reclaim(dev, 0); 502 502 503 503 spin_lock(&priv->rx_lock); 504 504 rx_work_done = bcm_enet_receive_queue(dev, budget); 505 505 spin_unlock(&priv->rx_lock); 506 506 507 - if (rx_work_done >= budget || tx_work_done > 0) { 508 - /* rx/tx queue is not yet empty/clean */ 507 + if (rx_work_done >= budget) { 508 + /* rx queue is not yet empty/clean */ 509 509 return rx_work_done; 510 510 } 511 511