Re: [PATCH] bcm63xx_enet: fix poll callback.

From: Eric Dumazet
Date: Tue Mar 03 2015 - 08:30:13 EST


On Tue, 2015-03-03 at 12:45 +0100, Nicolas Schichan wrote:
> 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@xxxxxxxxxx>
> ---

This looks better, thanks.

Acked-by: Eric Dumazet <edumazet@xxxxxxxxxx>

Note that the way bcm_enet_tx_reclaim() is written, it can livelock on
SMP hosts :

CPU 1,2,3,... keep queuing packets via ndo_start_xmit()

CPU 0 is looping forever in bcm_enet_tx_reclaim() draining queue and
freeing skbs.

To avoid that, I would take priv->tx_lock only once, or add a limit on
the number of skbs that can be drained per round.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/