netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>,
	"Chia-Yu Chang" <chia-yu.chang@nokia-bell-labs.com>,
	"Chuck Lever" <chuck.lever@oracle.com>,
	"Donald Hunter" <donald.hunter@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	"Simon Horman" <horms@kernel.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: [PATCH net-next 1/7] netlink: specs: add ignore-index flag for indexed-array
Date: Wed, 22 Oct 2025 18:26:54 +0000	[thread overview]
Message-ID: <20251022182701.250897-2-ast@fiberby.net> (raw)
In-Reply-To: <20251022182701.250897-1-ast@fiberby.net>

Add a new YNL attribute `ignore-index` as a way to indicate that a
given indexed-array attribute is really just used as an array, and
hence the nested attribute-type aka. the index is unimportant.

This means that the kernel never uses the index when processing
received netlink messages, and that it doesn't add any additional
information when sent by the kernel.

For backward compatibility reasons the kernel can continue to set
the index to a non-zero value in netlink messages, but it can safely
be disregarded by clients when `ignore-index` is set to true.

When the index is non-zero, it is often just an incremental iterator
value, which provides no additional value, as the order of the array
elements is already known based on the order in the netlink message.

`ignore-index` is not added for the genetlink protocol, as any new
families should use multi-attributes, unless they need the index.

Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---
 Documentation/netlink/genetlink-c.yaml                   | 6 ++++++
 Documentation/netlink/genetlink-legacy.yaml              | 6 ++++++
 Documentation/netlink/netlink-raw.yaml                   | 6 ++++++
 Documentation/userspace-api/netlink/genetlink-legacy.rst | 3 +++
 4 files changed, 21 insertions(+)

diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml
index 5a234e9b5fa2e..5d022772cdb61 100644
--- a/Documentation/netlink/genetlink-c.yaml
+++ b/Documentation/netlink/genetlink-c.yaml
@@ -184,6 +184,12 @@ properties:
               nested-attributes:
                 description: Name of the space (sub-space) used inside the attribute.
                 type: string
+              ignore-index:
+                description: |
+                  The indexed-array is just an array. The index, aka. the
+                  nested attribute-type, can be disregarded, as it doesn't
+                  contain anything interesting.
+                type: boolean
               enum:
                 description: Name of the enum type used for the attribute.
                 type: string
diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml
index 66fb8653a3442..f7991a3c5e2a3 100644
--- a/Documentation/netlink/genetlink-legacy.yaml
+++ b/Documentation/netlink/genetlink-legacy.yaml
@@ -233,6 +233,12 @@ properties:
               nested-attributes:
                 description: Name of the space (sub-space) used inside the attribute.
                 type: string
+              ignore-index:
+                description: |
+                  The indexed-array is just an array. The index, aka. the
+                  nested attribute-type, can be disregarded, as it doesn't
+                  contain anything interesting.
+                type: boolean
               enum:
                 description: Name of the enum type used for the attribute.
                 type: string
diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml
index 246fa07bccf68..1d2ff5f79cada 100644
--- a/Documentation/netlink/netlink-raw.yaml
+++ b/Documentation/netlink/netlink-raw.yaml
@@ -251,6 +251,12 @@ properties:
               nested-attributes:
                 description: Name of the space (sub-space) used inside the attribute.
                 type: string
+              ignore-index:
+                description: |
+                  The indexed-array is just an array. The index, aka. the
+                  nested attribute-type, can be disregarded, as it doesn't
+                  contain anything interesting.
+                type: boolean
               enum:
                 description: Name of the enum type used for the attribute.
                 type: string
diff --git a/Documentation/userspace-api/netlink/genetlink-legacy.rst b/Documentation/userspace-api/netlink/genetlink-legacy.rst
index fa005989193a1..839b0095c9a80 100644
--- a/Documentation/userspace-api/netlink/genetlink-legacy.rst
+++ b/Documentation/userspace-api/netlink/genetlink-legacy.rst
@@ -53,6 +53,9 @@ indexed-array
 limiting its size to 64kB). The ``ENTRY`` nests are special and have the
 index of the entry as their type instead of normal attribute type.
 
+When ``ignore-index`` is set to ``true``, then the ``indexed-array`` is
+just an array, and the index can be disregarded.
+
 A ``sub-type`` is needed to describe what type in the ``ENTRY``. A ``nest``
 ``sub-type`` means there are nest arrays in the ``ENTRY``, with the structure
 looks like::
-- 
2.51.0


  reply	other threads:[~2025-10-22 18:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 18:26 [PATCH net-next 0/7] ynl: add ignore-index flag for indexed-array Asbjørn Sloth Tønnesen
2025-10-22 18:26 ` Asbjørn Sloth Tønnesen [this message]
2025-10-22 18:26 ` [PATCH net-next 2/7] tools: ynl: support ignore-index in indexed-array decoding Asbjørn Sloth Tønnesen
2025-10-22 18:26 ` [PATCH net-next 3/7] tools: ynl: support ignore-index in indexed-array encoding Asbjørn Sloth Tønnesen
2025-10-22 18:26 ` [PATCH net-next 4/7] netlink: specs: nl80211: set ignore-index on indexed-arrays Asbjørn Sloth Tønnesen
2025-10-22 18:26 ` [PATCH net-next 5/7] netlink: specs: nlctrl: " Asbjørn Sloth Tønnesen
2025-10-22 18:26 ` [PATCH net-next 6/7] netlink: specs: rt-link: " Asbjørn Sloth Tønnesen
2025-10-22 18:27 ` [PATCH net-next 7/7] netlink: specs: tc: " Asbjørn Sloth Tønnesen
2025-10-23  1:45 ` [PATCH net-next 0/7] ynl: add ignore-index flag for indexed-array Jakub Kicinski
2025-10-23 18:37   ` Asbjørn Sloth Tønnesen
2025-10-24  0:03     ` Jakub Kicinski
2025-10-24 19:19       ` Asbjørn Sloth Tønnesen
2025-10-24 23:52         ` Jakub Kicinski

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=20251022182701.250897-2-ast@fiberby.net \
    --to=ast@fiberby.net \
    --cc=chia-yu.chang@nokia-bell-labs.com \
    --cc=chuck.lever@oracle.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matttbe@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).