aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
authorJakub Kicinski <kuba@kernel.org>2026-05-26 09:01:46 -0700
committerJakub Kicinski <kuba@kernel.org>2026-05-28 14:37:46 -0700
commit33cd2d395cb49f13f28810198b1eb1243d8f9177 (patch)
tree31fdf80f645c9ca87a06558a1bac6dc868d97af3 /Documentation
parent427837e5fd85f49ca7cde8ff32544e1c9864ec84 (diff)
downloadlinux-next-history-33cd2d395cb49f13f28810198b1eb1243d8f9177.tar.gz
docs: net: fix minor issues with the NAPI guide
Update the NAPI documentation to match current API behavior: - repeated napi_disable() calls hang waiting for ownership, rather than deadlock - NAPI IDs are exposed through SO_INCOMING_NAPI_ID and netdev Netlink - epoll uses the maxevents parameter spelling - add that drivers holding the netdev instance lock may need _locked() variants Link: https://patch.msgid.link/20260526160151.2793354-6-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/networking/napi.rst11
1 files changed, 8 insertions, 3 deletions
diff --git a/Documentation/networking/napi.rst b/Documentation/networking/napi.rst
index 4e008efebb352..c719924f36ce9 100644
--- a/Documentation/networking/napi.rst
+++ b/Documentation/networking/napi.rst
@@ -49,7 +49,11 @@ instance to be released.
The control APIs are not idempotent. Control API calls are safe against
concurrent use of datapath APIs but an incorrect sequence of control API
calls may result in crashes, deadlocks, or race conditions. For example,
-calling napi_disable() multiple times in a row will deadlock.
+calling napi_disable() multiple times in a row will hang waiting for
+ownership of the NAPI instance to be released.
+
+Drivers using the netdev instance lock may need to use the ``_locked()``
+variants of the control APIs when that lock is already held.
Datapath API
------------
@@ -190,7 +194,8 @@ User API
========
User interactions with NAPI depend on NAPI instance ID. The instance IDs
-are only visible to the user thru the ``SO_INCOMING_NAPI_ID`` socket option.
+are visible to the user through the ``SO_INCOMING_NAPI_ID`` socket option
+and the netdev Netlink API.
Users can query NAPI IDs for a device or device queue using netlink. This can
be done programmatically in a user application or by using a script included in
@@ -371,7 +376,7 @@ To use this mechanism:
the application has stalled. This value should be chosen so that it covers
the amount of time the user application needs to process data from its
call to epoll_wait, noting that applications can control how much data
- they retrieve by setting ``max_events`` when calling epoll_wait.
+ they retrieve by setting ``maxevents`` when calling epoll_wait.
2. The sysfs parameter or per-NAPI config parameters ``gro_flush_timeout``
and ``napi_defer_hard_irqs`` can be set to low values. They will be used