Re: [PATCH] bcm63xx_enet: fix poll callback.

Eric Dumazet
2015-03-03T13:30:06Z

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@freebox.fr>
> ---

This looks better, thanks.

Acked-by: Eric Dumazet <edumazet@google.com>

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.