Re: [PATCH net v2] net: napi: Avoid gro timer misfiring at end of busypoll
From: Joe Damato
Date: Wed May 06 2026 - 16:49:19 EST
On Wed, May 06, 2026 at 09:08:08AM +0000, Dragos Tatulea wrote:
> When in irq deferral mode (defer-hard-irqs > 0), a short enough
> gro-flush timeout can trigger before NAPI_STATE_SCHED is cleared if the
> last poll in busy_poll_stop() takes too long. This can have the effect
> of leaving the queue stuck with interrupts disabled and no timer armed
> which results in a tx timeout if there is no subsequent busypoll cycle.
>
> To prevent this, defer the gro-flush timer arm after the last poll.
>
> Fixes: 7fd3253a7de6 ("net: Introduce preferred busy-polling")
> Co-developed-by: Martin Karsten <mkarsten@xxxxxxxxxxxx>
> Signed-off-by: Martin Karsten <mkarsten@xxxxxxxxxxxx>
> Signed-off-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
> Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxx>
> Reviewed-by: Cosmin Ratiu <cratiu@xxxxxxxxxx>
> ---
> Changes since RFC [1]:
> - Sending only fix to net.
> - Made commit message clearer and more succint.
> - Fixed timer arming to happen after clearing the NAPI_STATE_SCHED bit
> - Arm timer after clearing NAPI_STATE_SCHED and drop IRQ disable.
>
> [1] https://lore.kernel.org/all/20260428175134.1197036-3-dtatulea@xxxxxxxxxx/
> ---
> net/core/dev.c | 21 ++++++++++++---------
> 1 file changed, 12 insertions(+), 9 deletions(-)
Good catch on this bug. This fix looks right to me.
Reviewed-by: Joe Damato <joe@xxxxxxx>