Re: [PATCH net-next v3] net: napi: Skip last poll when arming gro timer in busy poll
From: Joe Damato
Date: Mon May 18 2026 - 18:45:51 EST
On Mon, May 18, 2026 at 02:13:32PM -0400, Martin Karsten wrote:
> Skip the extra call to napi->poll(), if the gro timer is armed at the
> end of busy polling. This removes the need for having a separate
> __busy_poll_stop() routine and its code is moved directly into the
> relevant places in busy_poll_stop(). Remove obsolete comment about
> ndo_busy_poll_stop().
>
> This is a follow-up to commit 58e2330bd455 ("net: napi: Avoid gro timer
> misfiring at end of busypoll"), which has deferred arming the gro timer
> to the end of __busy_poll_stop() to eliminate a race condition between
> a short timer and long poll that could leave the queue stuck with
> interrupts disabled and no timer armed.
>
> Co-developed-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
> Signed-off-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
> Signed-off-by: Martin Karsten <mkarsten@xxxxxxxxxxxx>
> ---
> Changes since v2 [1]:
> - Fix patch formatting problems.
> - Leave STATE_PREFER_BUSY_POLL bit set when timer is armed.
> Don't want interrupts anyway until timer clears STATE_PREFER_BUSY_POLL.
>
> Changes since RFC [2]:
> - Sending only the cleanup/improvement patch to net-next.
> - Expand commit message to summarize original issue.
> - Streamline control flow.
> - Improve comments.
>
> [1] https://lore.kernel.org/all/f0ecdde3-de16-47ba-b795-fe0042114e96@uwaterloo.c/
> [2] https://lore.kernel.org/all/20260428175134.1197036-4-dtatulea@xxxxxxxxxx/
> ---
> net/core/dev.c | 63 ++++++++++++++++++++++----------------------------
> 1 file changed, 28 insertions(+), 35 deletions(-)
Reviewed-by: Joe Damato <joe@xxxxxxx>