* [PATCH net-next v3] documentation: networking: Add NAPI config
@ 2025-02-13 19:15 Joe Damato
2025-02-15 1:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Joe Damato @ 2025-02-13 19:15 UTC (permalink / raw)
To: netdev
Cc: kuba, bagasdotme, pabeni, rdunlap, Joe Damato, David S. Miller,
Eric Dumazet, Simon Horman, Jonathan Corbet,
open list:DOCUMENTATION, open list
Document the existence of persistent per-NAPI configuration space and
the API that drivers can opt into.
Update stale documentation which suggested that NAPI IDs cannot be
queried from userspace.
Signed-off-by: Joe Damato <jdamato@fastly.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
---
v3:
- Add tags from Jakub and Bagas.
v2:
- Reword the Persistent Napi config section using some suggestions
from Jakub.
Documentation/networking/napi.rst | 33 ++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/Documentation/networking/napi.rst b/Documentation/networking/napi.rst
index f970a2be271a..d0e3953cae6a 100644
--- a/Documentation/networking/napi.rst
+++ b/Documentation/networking/napi.rst
@@ -171,12 +171,43 @@ a channel as an IRQ/NAPI which services queues of a given type. For example,
a configuration of 1 ``rx``, 1 ``tx`` and 1 ``combined`` channel is expected
to utilize 3 interrupts, 2 Rx and 2 Tx queues.
+Persistent NAPI config
+----------------------
+
+Drivers often allocate and free NAPI instances dynamically. This leads to loss
+of NAPI-related user configuration each time NAPI instances are reallocated.
+The netif_napi_add_config() API prevents this loss of configuration by
+associating each NAPI instance with a persistent NAPI configuration based on
+a driver defined index value, like a queue number.
+
+Using this API allows for persistent NAPI IDs (among other settings), which can
+be beneficial to userspace programs using ``SO_INCOMING_NAPI_ID``. See the
+sections below for other NAPI configuration settings.
+
+Drivers should try to use netif_napi_add_config() whenever possible.
+
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.
-It's not currently possible to query IDs used by a given device.
+
+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
+the kernel source tree: ``tools/net/ynl/pyynl/cli.py``.
+
+For example, using the script to dump all of the queues for a device (which
+will reveal each queue's NAPI ID):
+
+.. code-block:: bash
+
+ $ kernel-source/tools/net/ynl/pyynl/cli.py \
+ --spec Documentation/netlink/specs/netdev.yaml \
+ --dump queue-get \
+ --json='{"ifindex": 2}'
+
+See ``Documentation/netlink/specs/netdev.yaml`` for more details on
+available operations and attributes.
Software IRQ coalescing
-----------------------
base-commit: 4079918ae720e842ed7dff65fedeb9980b374995
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v3] documentation: networking: Add NAPI config
2025-02-13 19:15 [PATCH net-next v3] documentation: networking: Add NAPI config Joe Damato
@ 2025-02-15 1:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-15 1:20 UTC (permalink / raw)
To: Joe Damato
Cc: netdev, kuba, bagasdotme, pabeni, rdunlap, davem, edumazet,
horms, corbet, linux-doc, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 13 Feb 2025 19:15:34 +0000 you wrote:
> Document the existence of persistent per-NAPI configuration space and
> the API that drivers can opt into.
>
> Update stale documentation which suggested that NAPI IDs cannot be
> queried from userspace.
>
> Signed-off-by: Joe Damato <jdamato@fastly.com>
> Acked-by: Jakub Kicinski <kuba@kernel.org>
> Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
>
> [...]
Here is the summary with links:
- [net-next,v3] documentation: networking: Add NAPI config
https://git.kernel.org/netdev/net-next/c/bf1b8e0abc39
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-15 1:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-13 19:15 [PATCH net-next v3] documentation: networking: Add NAPI config Joe Damato
2025-02-15 1:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®