]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: Extend NAPI threaded polling to allow kthread based busy polling
authorSamiullah Khawaja <skhawaja@google.com>
Tue, 28 Oct 2025 20:30:05 +0000 (20:30 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 4 Nov 2025 02:11:40 +0000 (18:11 -0800)
commitc18d4b190a46651726c9a952667c74d2deb33c28
tree88278c4fa0da716f62ba60ba66d4c9d95835803a
parent998b5d9683d9c415bd3ad0dcc9e8f2d0d34afaa4
net: Extend NAPI threaded polling to allow kthread based busy polling

Add a new state NAPI_STATE_THREADED_BUSY_POLL to the NAPI state enum to
enable and disable threaded busy polling.

When threaded busy polling is enabled for a NAPI, enable
NAPI_STATE_THREADED also.

When the threaded NAPI is scheduled, set NAPI_STATE_IN_BUSY_POLL to
signal napi_complete_done not to rearm interrupts.

Whenever NAPI_STATE_THREADED_BUSY_POLL is unset, the
NAPI_STATE_IN_BUSY_POLL will be unset, napi_complete_done unsets the
NAPI_STATE_SCHED_THREADED bit also, which in turn will make the kthread
go to sleep.

Signed-off-by: Samiullah Khawaja <skhawaja@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Acked-by: Martin Karsten <mkarsten@uwaterloo.ca>
Tested-by: Martin Karsten <mkarsten@uwaterloo.ca>
Link: https://patch.msgid.link/20251028203007.575686-2-skhawaja@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/specs/netdev.yaml
Documentation/networking/napi.rst
include/linux/netdevice.h
include/uapi/linux/netdev.h
net/core/dev.c
net/core/dev.h
net/core/netdev-genl-gen.c
tools/include/uapi/linux/netdev.h