public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Joe Damato <jdamato@fastly.com>, netdev@vger.kernel.org
Cc: kuba@kernel.org, rdunlap@infradead.org, ahmed.zaki@intel.com,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Linux Documentation <linux-doc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2] documentation: networking: Add NAPI config
Date: Wed, 12 Feb 2025 16:31:54 +0700	[thread overview]
Message-ID: <Z6xqipobYH_Ood7A@archie.me> (raw)
In-Reply-To: <CALALjgz_jtONSFLAhOTYFcfL2-UwDct9AxhaT4BFGOnnt2UF8A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2425 bytes --]

On Tue, Feb 11, 2025 at 08:06:03PM +0000, Joe Damato wrote:
> 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
>  -----------------------
> 

Looks good, thanks!

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2025-02-12  9:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 20:06 [PATCH net-next v2] documentation: networking: Add NAPI config Joe Damato
2025-02-11 23:15 ` Jakub Kicinski
2025-02-12  9:31 ` Bagas Sanjaya [this message]
2025-02-13 11:45 ` Paolo Abeni
2025-02-13 13:45   ` Joe Damato
2025-02-13 16:14     ` Jakub Kicinski
2025-02-13 17:38       ` Joe Damato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z6xqipobYH_Ood7A@archie.me \
    --to=bagasdotme@gmail.com \
    --cc=ahmed.zaki@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox