From nobody Sun Feb 8 01:51:43 2026 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C54E34C99A; Wed, 22 Oct 2025 18:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157644; cv=none; b=A+IJELZde+zs8rheIcJJxi8RA9wenGkcQJsikZ4cCeabwW0IrIVLS7JGLzHWoscBfweoQrEKKGqp8NY3g2ixokKRrXnAbfcidkvW6RHO74gyj8Zg2ZH9z5ALJqanPWaOovvj3vSOe8zBmWNaV67vdzUv4vE2FukW7MZfs1Wrwhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157644; c=relaxed/simple; bh=H4QLUCPTYmum7YJRk09TGBcRUEfaTbbQ/3zKr9PVciw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QcWRQa3p6DsOp7Msm3NpC2eoyJTWMHN1/UDsXHQr5iiUvJ4fIlh6w7SKrYUctL3W3e8RQFsmcMoiZkdrvhlqhrt9bFeRCNw3TJsBBLY+LOPt1+urNxf43c1xtvxf63i8fuh54M3EtjuROVS7DKNF3fMUh+JuGilnIfwP1rnbLcE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=Lj6HV18I; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="Lj6HV18I" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1761157634; bh=H4QLUCPTYmum7YJRk09TGBcRUEfaTbbQ/3zKr9PVciw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lj6HV18Ixlw0m5W36H+5K59f3Ish4H5sx1ZQPupjNlC5k0a7UPrSBXTnpsNDFlZSS 8iR0MDQU35DZOzvw9dYSAX8KWtzjjHMPGWo9y+uhJ9Sn7iCdhTmH24TrgPIYAT5CrG Gt6+OPz1uz+h5FGV0VFsHFn8wMSzjnmUGGVUolZCt1xlAi5iBO95o6QiGjPPIILBdB JRGUQa8YM5HhZFTxjJQ0uiuu+wznaXpOmtPnGLshK63hWjDYfc9x8aZPOqgdsWXCwH 0j6RdPHiv4jl1LH/1u+2zZ0mbilP9niRB6ymkX4jn/EdB8oppXH7CR1zZ5jY5LKl0A OiH//VM6x7Sqg== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 751E36000C; Wed, 22 Oct 2025 18:27:14 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 81B4A200C27; Wed, 22 Oct 2025 18:27:09 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Chia-Yu Chang , Chuck Lever , Donald Hunter , Jonathan Corbet , "Matthieu Baerts (NGI0)" , Simon Horman , 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 Message-ID: <20251022182701.250897-2-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022182701.250897-1-ast@fiberby.net> References: <20251022182701.250897-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=C3=B8rn Sloth T=C3=B8nnesen --- 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/ne= tlink/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/Doc= umentation/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. =20 +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 struct= ure looks like:: --=20 2.51.0 From nobody Sun Feb 8 01:51:43 2026 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 217AE346E4B; Wed, 22 Oct 2025 18:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157641; cv=none; b=O1oCO58CJt31PmoHSJ+4DBowGmvBw7kUgOX2dV5M+oKBmqB/AozbI0s1mW9ck5onmt17hyqzpWvnOgJ8EUC2hX4F4+lOexp7YkycRxrkJqNz5hfh1H5ZQyg1Myv3ogl1eJYuGLBEiD8rQpDOhXpg7wKo7Zmn0RHMpYvHdM4XYvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157641; c=relaxed/simple; bh=to+++l+OT4ObaazQyXHHfgCEH6AA58+yXljgAbpH5pY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NJ93Xx0u/MCu+hvfRMRud1p9uSpcQLEiZO3jhhmnGNiDjgSD2+JgDfwNvvlnpHDz9gGwcZJ59Fv7vrFpov08T8EbCSPT2Nfkekc+NOfRQss7ew3OjbOfuqXMk1xaz2+OwwIJOTmWjS1M5bu1R6O0uQfr0hBA9gX06V4Njcldlfc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=OK0Z9v//; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="OK0Z9v//" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1761157634; bh=to+++l+OT4ObaazQyXHHfgCEH6AA58+yXljgAbpH5pY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OK0Z9v//T6eG/JR8d+3iN9H7k3b0DenTWsup9DvVcFPDWgIHnmjwZuhobaqvLdnuo bCL1hAymbbUfKXfNQYSKVHHtl+8NpV9z+lihES65djoAnV9zSy/toXydfNcViKkBD4 Sy2VOQA4riTggAF5xyOEJcgJU4826bHTWEQsRJUUNE0W3LfosB3tWgqa5RL82Mh/ZD mGdDELSiFplFY2YRECRmHJ3IeJ7+7n4zfLMOS8p0ypsM363zRJMwjx7uKRO1gXGh0M 7ZRz+/28brO4SST68OdHthVcvC9C956jujdKm1Rth9UfGMRcCBwpVkALymqrnjPTTt uc6+ZhWTsmxHw== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 7CB84600FC; Wed, 22 Oct 2025 18:27:14 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 8E409202268; Wed, 22 Oct 2025 18:27:09 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Chia-Yu Chang , Chuck Lever , Donald Hunter , Jonathan Corbet , "Matthieu Baerts (NGI0)" , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next 2/7] tools: ynl: support ignore-index in indexed-array decoding Date: Wed, 22 Oct 2025 18:26:55 +0000 Message-ID: <20251022182701.250897-3-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022182701.250897-1-ast@fiberby.net> References: <20251022182701.250897-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable When decoding indexed-arrays with `ignore-index` set, then elide the index, aka. the nested attribute-type. Previously the index was always preserved for sub-type nest, but was elided for all other sub-types. I have opted to reuse the existing `subattr` variable, as renaming it will render the diff unreadable at least for this version. Output if `rates` does NOT have `ignore-index` set: $ ./tools/net/ynl/pyynl/cli.py --family nl80211 --dump get-wiphy [...] 'rates': [{0: {'rate': 60}}, {1: {'rate': 90}}, {2: {'rate': 120}}, {3: {'rate': 180}}, {4: {'rate': 240}}, [...] Output if `rates` has `ignore-index` set to true: $ ./tools/net/ynl/pyynl/cli.py --family nl80211 --dump get-wiphy [...] 'rates': [{'rate': 60}, {'rate': 90}, {'rate': 120}, {'rate': 180}, {'rate': 240}, [...] If the above example had to be passed back though --json, then it now aligns with the new output format, and would look like this: --json '{"rates":[ {"rate":60}, {"rate":90}, ... ]}' Signed-off-by: Asbj=C3=B8rn Sloth T=C3=B8nnesen --- tools/net/ynl/pyynl/lib/ynl.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py index 62383c70ebb95..14c7e51db6f5c 100644 --- a/tools/net/ynl/pyynl/lib/ynl.py +++ b/tools/net/ynl/pyynl/lib/ynl.py @@ -690,23 +690,26 @@ class YnlFamily(SpecFamily): item =3D NlAttr(attr.raw, offset) offset +=3D item.full_len =20 + subattr =3D None if attr_spec["sub-type"] =3D=3D 'nest': - subattrs =3D self._decode(NlAttrs(item.raw), attr_spec['ne= sted-attributes']) - decoded.append({ item.type: subattrs }) + subattr =3D self._decode(NlAttrs(item.raw), attr_spec['nes= ted-attributes']) elif attr_spec["sub-type"] =3D=3D 'binary': subattr =3D item.as_bin() if attr_spec.display_hint: subattr =3D self._formatted_string(subattr, attr_spec.= display_hint) - decoded.append(subattr) elif attr_spec["sub-type"] in NlAttr.type_formats: subattr =3D item.as_scalar(attr_spec['sub-type'], attr_spe= c.byte_order) if 'enum' in attr_spec: subattr =3D self._decode_enum(subattr, attr_spec) elif attr_spec.display_hint: subattr =3D self._formatted_string(subattr, attr_spec.= display_hint) - decoded.append(subattr) else: raise Exception(f'Unknown {attr_spec["sub-type"]} with nam= e {attr_spec["name"]}') + + if attr_spec.get('ignore-index', False): + decoded.append(subattr) + else: + decoded.append({ item.type: subattr }) return decoded =20 def _decode_nest_type_value(self, attr, attr_spec): --=20 2.51.0 From nobody Sun Feb 8 01:51:43 2026 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B208E2C11D6; Wed, 22 Oct 2025 18:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157641; cv=none; b=bPwpw+NPGHH5XPs0lqH6RwVP4kCrqnxAnW0TibWvzyaJvW7ZLvpbFthrI+Rg49lHG45x1v7Bas6O8KdUWb04GRQAaOa90zMGCYq9O4+aT5ziiWCS9wCbdEAebAgxpUpGG+pD91KiDXC8c6SYDOes/6QznJn4xhiszI9elng5AR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157641; c=relaxed/simple; bh=+ChjTVmw9jhdGA2e1SF3ZyvNwYO2Qd7xy8sXIk2YQnU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Kpbi6NnyT/JTrEpjBOWkseE9kFgVotAMwAVncMgV3lijXlDnfI7kKiq4v7EvC8n3ij/nQKM9HyabewXxXwFV7FUtGMXxtccESv7MUEW5Yo0HIRXqHltVb/cRHzr+YxebdXQU2P8MNM0FXTlXNr7f1wNoHTp8VtVBELBYL7wGcsE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=OwWiHU69; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="OwWiHU69" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1761157634; bh=+ChjTVmw9jhdGA2e1SF3ZyvNwYO2Qd7xy8sXIk2YQnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OwWiHU69h++3qUkwBsBv2HKnAO+dtyx279JrpCgBsmjS3edhF8w+ZSYiteWLx5/x6 4vDseB2NMVnvEq91gLa+NGr1o0mO/2gOMk3lwABbcYHeM81/9sm1b0c/O23S6LZdV2 T+KS6rdT5lTosE8eNUVEqsMtj+SIB4Os1tJ2N7BXKJLMS8KoqrVUVOmpi563C7n8gk PumAIa114AIfDKG3ZXJzzWcb5iapAX6Z8e9YYYRP5oeW5ym7aIXB5ax9TNvdrIRCoJ Y0e2ks8JekBPSZX7qEMDfLpxUTmRAog69MLmF2tiFcgyQwekEMlsMYabExxaP2EEUl 1767/vZd0vkhw== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 7F08E600FF; Wed, 22 Oct 2025 18:27:14 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 99D4F20228C; Wed, 22 Oct 2025 18:27:09 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Chia-Yu Chang , Chuck Lever , Donald Hunter , Jonathan Corbet , "Matthieu Baerts (NGI0)" , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next 3/7] tools: ynl: support ignore-index in indexed-array encoding Date: Wed, 22 Oct 2025 18:26:56 +0000 Message-ID: <20251022182701.250897-4-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022182701.250897-1-ast@fiberby.net> References: <20251022182701.250897-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable When parsing indexed-array attributes to cli.py's --json, then previously the index would always be set incrementally. This patch adds support for setting arbitrary indexes, when `ignore-index` is set to false or is unspecified. When `ignore-index` is set to true, then it retains the current input format, and it's alignment with the output from cli.py. The below examples are fictive as `rates` is not used in requests. The implementation have been tested with a newer version of the previously posted wireguard spec[1]. When `rates` have `ignore-index` set to false (or unspecified): --json '{"rates":[ [0,{"rate":60}], [42,{"rate":90}] ]}' When `rates` have `ignore-index` set to true: --json '{"rates":[ {"rate":60}, {"rate":90} ]}' [1] https://lore.kernel.org/netdev/20250904-wg-ynl-rfc@fiberby.net/ Signed-off-by: Asbj=C3=B8rn Sloth T=C3=B8nnesen --- tools/net/ynl/pyynl/lib/ynl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py index 14c7e51db6f5c..a284bc2ad3440 100644 --- a/tools/net/ynl/pyynl/lib/ynl.py +++ b/tools/net/ynl/pyynl/lib/ynl.py @@ -566,8 +566,9 @@ class YnlFamily(SpecFamily): elif attr['type'] =3D=3D 'indexed-array' and attr['sub-type'] =3D= =3D 'nest': nl_type |=3D Netlink.NLA_F_NESTED sub_space =3D attr['nested-attributes'] + ignore_idx =3D attr.get('ignore-index', False) attr_payload =3D self._encode_indexed_array(value, sub_space, - search_attrs) + search_attrs, ignore= _idx) elif attr["type"] =3D=3D 'flag': if not value: # If value is absent or false then skip attribute creation. @@ -635,9 +636,11 @@ class YnlFamily(SpecFamily): sub_attrs) return attr_payload =20 - def _encode_indexed_array(self, vals, sub_space, search_attrs): + def _encode_indexed_array(self, vals, sub_space, search_attrs, ignore_= idx): attr_payload =3D b'' for i, val in enumerate(vals): + if not ignore_idx: + i, val =3D val[0], val[1] idx =3D i | Netlink.NLA_F_NESTED val_payload =3D self._add_nest_attrs(val, sub_space, search_at= trs) attr_payload +=3D self._add_attr_raw(idx, val_payload) --=20 2.51.0 From nobody Sun Feb 8 01:51:43 2026 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E34934CFAF; Wed, 22 Oct 2025 18:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157644; cv=none; b=td4/wbrRnEkwGH9eO99Kok758uVcJvj5sFI9degQ16ym69mdttTkP1/ftPMXtELavASWHY9fAJ1QKM5Fk1rl6XE/ubuL5Ud/iCfcw9Z702D0LKEggPzIajZ6PwpYdKXfZf4w0jlTVCCutcUH0+2NGIw2k0BDWgSUsLJpu59AHxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157644; c=relaxed/simple; bh=Zf0585jW2MyZklmoRTnvbAPsZ6tICj1K3+6NGweVA7A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hOTbuNW1rQ/J5CcQASbjKmsN+KCGbYofcSdoAz1Zm4YkOakC2jcodAHWZv0XcmyFfTkAN+ZPA7BKsi3hV8vb74fwxizTGGJYvxvcsg4GXs/MZ9KKewqK6Fddc5FqVthW6b3Ut+oFkgdqaNUpCf+YVrMuT5H2Lt7oQ2jo3s8sPrc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=fynjAYfw; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="fynjAYfw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1761157634; bh=Zf0585jW2MyZklmoRTnvbAPsZ6tICj1K3+6NGweVA7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fynjAYfwURZUXSoAG9DLJInORCJz7HXN9f3iIldVdfpmEqia1BRXcBu7eKjLA5vht P17vqc5Lsk3QlcQTL6WIb+1gq1u8kuuskhmA2UR/Frxbk+bsfrVOCFMrvrqLUZWXEs k2H3niK3Sd4xgTz3ZfAEbS5nzuQnbUcPlXqcZJYppM3j5Dksue3KdYZuV2ChJt9gev SVnr4x5hBTTiFrSq3bG/A20CXSG1KPlP6S+B5DlliQ3Jtu60SHp8rMnpSSFs8B4Tnx +fDegMSRQsMReif6mHLp5/F0SzqJ9oWixtvqUcjM3pYu+cs0M2y6UK02qbpQmMP72Z faTyxrRcLgv6A== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id D92ED6010A; Wed, 22 Oct 2025 18:27:14 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id A4E9E2022FD; Wed, 22 Oct 2025 18:27:09 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Chia-Yu Chang , Chuck Lever , Donald Hunter , Jonathan Corbet , "Matthieu Baerts (NGI0)" , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next 4/7] netlink: specs: nl80211: set ignore-index on indexed-arrays Date: Wed, 22 Oct 2025 18:26:57 +0000 Message-ID: <20251022182701.250897-5-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022182701.250897-1-ast@fiberby.net> References: <20251022182701.250897-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The indexes in nl80211 indexed-arrays have no special meaning, they are just written with an iterator index, which refers to the order in which they have been packed into the netlink message. Thus this patch sets ignore-index on these attributes. Most of these are only used for dumping kernel state, and are never parsed by the kernel. =E2=94=8F=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=93 =E2=94=83 =E2=94=83 out/ =E2=94=83 inpu= t/ =E2=94=83 ignore =E2=94=83 =E2=94=83 Attribute =E2=94=83 dump =E2=94=83 pars= ed =E2=94=83 -index =E2=94=83 =E2=94=A1=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=A9 =E2=94=82 NL80211_ATTR_SUPPORTED_COMMANDS =E2=94=82 1++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 NL80211_ATTR_INTERFACE_COMBINATIONS =E2=94=82 1++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 NL80211_BAND_ATTR_FREQS =E2=94=82 0++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 NL80211_BAND_ATTR_RATES =E2=94=82 0++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 NL80211_BAND_ATTR_IFTYPE_DATA =E2=94=82 1++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 NL80211_FREQUENCY_ATTR_WMM =E2=94=82 0++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 NL80211_IFACE_COMB_LIMITS =E2=94=82 1++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 NL80211_SAR_ATTR_SPECS =E2=94=82 1++ =E2=94=82 yes(= 2) =E2=94=82 yes =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 Where: 0++) incrementing index starting from 0 1++) incrementing index starting from 1 2) NL80211_SAR_ATTR_SPECS is parsed in nl80211_set_sar_specs(), which doesn't use the index. Additionally it also has a NLA_POLICY_NESTED_ARRAY() policy, as defined in commit 1501d13596b9 ("netlink: add nested array policy validation"), meaning that the index has no meaning, and can be disregarded. Signed-off-by: Asbj=C3=B8rn Sloth T=C3=B8nnesen --- Documentation/netlink/specs/nl80211.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/netlink/specs/nl80211.yaml b/Documentation/netli= nk/specs/nl80211.yaml index 802097128bdae..b93c612037e26 100644 --- a/Documentation/netlink/specs/nl80211.yaml +++ b/Documentation/netlink/specs/nl80211.yaml @@ -390,6 +390,7 @@ attribute-sets: name: supported-commands type: indexed-array sub-type: u32 + ignore-index: true enum: commands - name: frame @@ -608,6 +609,7 @@ attribute-sets: name: interface-combinations type: indexed-array sub-type: nest + ignore-index: true nested-attributes: if-combination-attributes - name: software-iftypes @@ -1307,11 +1309,13 @@ attribute-sets: name: freqs type: indexed-array sub-type: nest + ignore-index: true nested-attributes: frequency-attrs - name: rates type: indexed-array sub-type: nest + ignore-index: true nested-attributes: bitrate-attrs - name: ht-mcs-set @@ -1335,6 +1339,7 @@ attribute-sets: name: iftype-data type: indexed-array sub-type: nest + ignore-index: true nested-attributes: iftype-data-attrs - name: edmg-channels @@ -1418,6 +1423,7 @@ attribute-sets: name: wmm type: indexed-array sub-type: nest + ignore-index: true nested-attributes: wmm-attrs - name: no-he @@ -1474,6 +1480,7 @@ attribute-sets: name: limits type: indexed-array sub-type: nest + ignore-index: true nested-attributes: iface-limit-attributes - name: maxnum @@ -1613,6 +1620,7 @@ attribute-sets: name: specs type: indexed-array sub-type: nest + ignore-index: true nested-attributes: sar-specs - name: sar-specs --=20 2.51.0 From nobody Sun Feb 8 01:51:43 2026 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C77AF345749; Wed, 22 Oct 2025 18:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157640; cv=none; b=OJYwIuR1wMcp2xtBQ8OEbzFTGm4gK5nunEcsiBtbHjj96mhiN9dsQAO/j1JbYyrUBoc1nXREQGo0DNTLiw4jqM3dwnH2bdLJw0VbUzMg49jWkQe5+PmH0wDfBAXyB6fXloUUhVwp3XsNZmJhR5hfTMnUDH5sQ71Be6RBghQrPZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157640; c=relaxed/simple; bh=6HQ7FnLmTaEfzf3bCO0gsOgjyTTSNfAG8WwaCExdgsc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dY/MI9eryHhA86r6ShvnMcnr5/GWB93NwuBCcBC3w7M9UIIWhf01dEQO93WCwOyrPjEQFMET46Fl0By2kInhCHCXgBTwUqrpzCE+bjC3XLwHrUuYwunCn8vRfp2IC003uqnDsDu44/k5/qmNC8+wHkfENEXPoSCywo9uGf7rxuc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=U5a+i6a5; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="U5a+i6a5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1761157634; bh=6HQ7FnLmTaEfzf3bCO0gsOgjyTTSNfAG8WwaCExdgsc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5a+i6a5/nx2IGH9IG/UcKdHB5lyKpYajqGZmUDxiDAgGUZi3LaAqM8ksHhkTW3To 1uP8EL5yX0aQ6C2m+5Ifqper9HuWryJ93bedNMLyno28DKnp/KbyNA3kGkGalyIFUG 9pqotb9Ni59gM4TdvIONuwTTb9UhDm6wobX0KJERmk1R0+sK40s4FOrnqsGk+zwi/y kIafMwWy3Kb6NhYdEjBAWB9cDO9pjSj/3n/Ql2iwqmh3QXlzvhnzi23bWtWTx0bnjb DQTsup0hoPBalQSfEUYUHTuR3WsVEXDlzSyhu6qyIGftWGhDfmiwWoVaUuV/qvh6Rl SfUUrtEGwqcWw== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 77C09600BF; Wed, 22 Oct 2025 18:27:14 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id B23EB2025C5; Wed, 22 Oct 2025 18:27:09 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Chia-Yu Chang , Chuck Lever , Donald Hunter , Jonathan Corbet , "Matthieu Baerts (NGI0)" , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next 5/7] netlink: specs: nlctrl: set ignore-index on indexed-arrays Date: Wed, 22 Oct 2025 18:26:58 +0000 Message-ID: <20251022182701.250897-6-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022182701.250897-1-ast@fiberby.net> References: <20251022182701.250897-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The indexes in nlctrl indexed-arrays have no special meaning, they are just written with an iterator index, which refers to the order in which they have been packed into the netlink message. Thus this patch sets ignore-index on these attributes. =E2=94=8F=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=93 =E2=94=83 =E2=94=83 out/ =E2=94=83 inpu= t/ =E2=94=83 ignore =E2=94=83 =E2=94=83 Attribute =E2=94=83 dump =E2=94=83 pars= ed =E2=94=83 -index =E2=94=83 =E2=94=A1=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=A9 =E2=94=82 CTRL_ATTR_OPS =E2=94=82 1++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 CTRL_ATTR_MCAST_GROUPS =E2=94=82 1++ =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 Where: 1++) incrementing index starting from 1 Signed-off-by: Asbj=C3=B8rn Sloth T=C3=B8nnesen --- Documentation/netlink/specs/nlctrl.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/netlink/specs/nlctrl.yaml b/Documentation/netlin= k/specs/nlctrl.yaml index 8b4472a6aa36a..753cf1b48c252 100644 --- a/Documentation/netlink/specs/nlctrl.yaml +++ b/Documentation/netlink/specs/nlctrl.yaml @@ -67,11 +67,13 @@ attribute-sets: name: ops type: indexed-array sub-type: nest + ignore-index: true nested-attributes: op-attrs - name: mcast-groups type: indexed-array sub-type: nest + ignore-index: true nested-attributes: mcast-group-attrs - name: policy --=20 2.51.0 From nobody Sun Feb 8 01:51:43 2026 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2171D2EBDEB; Wed, 22 Oct 2025 18:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157642; cv=none; b=G5Fksr+QEDvkwYiMK4OE3AYUm5GSqWt3lJVIDby2nhLlMvfIj1o7GScSEGD9qOXzUQjniNGM+dM6QfJs3ay/Mn3HSgXGL7/1QYtpa/sYuZICzFkI1EfLWYLhVSMWgfY2NSNkzLAN/tXMBu16Sy9nmkjVyqqWEgq27RSIn9VTVTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157642; c=relaxed/simple; bh=NgDePtBbene/8a4nTruU8kuIN+TmkEF5/1EK9+oGnz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LTQoDJio2q+lU+NXbvhvDMmIAdpIwVS2QimxAxJm9CD8cKANLzZQzVd4zv4WpaJI3ENM4QT1Phv72M2ce5uAj+KUkrz+n7agO/nQlBRSm0Uth0q0qrJfukUKrcMso62upaJzHNCSZl+q2Q7Kk9rNCS+oBi470gBrGvjGUuh8aEo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=hOiDqnde; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="hOiDqnde" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1761157634; bh=NgDePtBbene/8a4nTruU8kuIN+TmkEF5/1EK9+oGnz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hOiDqndeK1Ti+NJ48nv/TyxZf3fmxptP1cSP4/EtPl5GeZYfAq9QworgSEtqTrvgv m3mfHLm2GsMHa/2aM34g/g83ArWWkfdys+vtY17bviZE9Tq9wphuZk1yD1tcJEFlSW srEEcXWqZ2dVXYy/X1WNeX2jXIr/UjQngidKx9iUFDPHxPcO7pDxWinUZC3LGSr3JV VHYWCzarVM1vLvzZjga/TPlX6QWHFgjpw1d+CNBzCNIeFkLLmN2dcEfCO50ntA0JgS T59ZrpVQHAuxRv8dOPU5MG14mJVao+gt4OhMlyX9N+cB6G/I2avDQUsu0OcrZHPH79 lrQDpXISYwKow== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 7A56E600C1; Wed, 22 Oct 2025 18:27:14 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id BCBC12026D9; Wed, 22 Oct 2025 18:27:09 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Chia-Yu Chang , Chuck Lever , Donald Hunter , Jonathan Corbet , "Matthieu Baerts (NGI0)" , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next 6/7] netlink: specs: rt-link: set ignore-index on indexed-arrays Date: Wed, 22 Oct 2025 18:26:59 +0000 Message-ID: <20251022182701.250897-7-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022182701.250897-1-ast@fiberby.net> References: <20251022182701.250897-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Most of the indexes in rt-link indexed-arrays have no special meaning, they are just written with an iterator index, which refers to the order in which they have been packed into the netlink message. Thus this patch sets ignore-index on these two attributes. =E2=94=8F=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=93 =E2=94=83 =E2=94=83 out/ =E2=94=83 inpu= t/ =E2=94=83 ignore =E2=94=83 =E2=94=83 Attribute =E2=94=83 dump =E2=94=83 pars= ed =E2=94=83 -index =E2=94=83 =E2=94=A1=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=A9 =E2=94=82 IFLA_BOND_ARP_IP_TARGET =E2=94=82 0++ =E2=94=82 yes(= 1) =E2=94=82 yes =E2=94=82 =E2=94=82 IFLA_BOND_NS_IP6_TARGET =E2=94=82 0++ =E2=94=82 yes(= 1) =E2=94=82 yes =E2=94=82 =E2=94=82 IFLA_OFFLOAD_XSTATS_HW_S_INFO =E2=94=82 (2) =E2=94=82 - = =E2=94=82 no =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 Where: 0++) incrementing index starting from 0 1) When parsed the index is unused. 2) IFLA_OFFLOAD_XSTATS_L3_STATS is used as index in rtnl_offload_xstats_fill_hw_s_info(). Signed-off-by: Asbj=C3=B8rn Sloth T=C3=B8nnesen --- Documentation/netlink/specs/rt-link.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/netlink/specs/rt-link.yaml b/Documentation/netli= nk/specs/rt-link.yaml index 2a23e9699c0b6..d2aaacd29f9f9 100644 --- a/Documentation/netlink/specs/rt-link.yaml +++ b/Documentation/netlink/specs/rt-link.yaml @@ -1256,6 +1256,7 @@ attribute-sets: name: arp-ip-target type: indexed-array sub-type: u32 + ignore-index: true byte-order: big-endian display-hint: ipv4 - @@ -1330,6 +1331,7 @@ attribute-sets: name: ns-ip6-target type: indexed-array sub-type: binary + ignore-index: true display-hint: ipv6 checks: exact-len: 16 --=20 2.51.0 From nobody Sun Feb 8 01:51:43 2026 Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2188B347BBB; Wed, 22 Oct 2025 18:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157641; cv=none; b=BpJYcM2c6fGIbHDHrQC3ufcGotHkDT2i0EA9teK/j3vmBj07jPRfIQCdtMYExsdGyt5CHuacoBSdTTAHiByv431lizdw4efW2rqLhPjGCptHLdTDzSg9L2nBA8duvsDekNnc/u1vp4yrqX6qUYk3IEtrCl5gLknQTR5jGTsG3I4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761157641; c=relaxed/simple; bh=bZEztPyk7BTGQIjoohhhOl7ODQE8PExaiHuzd1d/bXQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mqHq1dJyKb9K3AsGPLIPr4iNQ+keHtzggMp8tENZLrSULM/n5dGID/Dza2IigvaxSJ/gXTMKGpY3ynfyK4F5sEuPR9I3q7s0DGmjzrHhKq57ZuLPkXGE5cDFJjat3XwTKE2VyFO0EwJlnXIo/vjUlBj01h5MD42up/ri8jao2oY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=fVT/R152; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="fVT/R152" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1761157634; bh=bZEztPyk7BTGQIjoohhhOl7ODQE8PExaiHuzd1d/bXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fVT/R152bGhLwMPLdp5Mp3v7fPx0SjpBM7gpmIGiKKIIOnRog7K7VNxXE/alT/bHl BVIog5Jy74X1QxzvmNqWiBV8stqOeC/zn4036cZwixWythFSUavJAlkYdO2W7z7EVH xLn26jXNgxT2PT0L2EpoMHMAAphdEri4ZSQMTw/MFXKnC3mfan9qSgV6MLO6DEKLzn ca/jAsuVBDmm/maNYTlEfkhD0EKsZCVdEXXnQyKWsF++rGiVdfAXV+z9JuI4/pcaTj HpJsm5ea/8KhJyt4wLGPnwwNxeobez3WTw9F5BiE5Ge6PdQwbBJv4Z11+n0sInH+E1 uE54xNcxyuWyA== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id D66E460109; Wed, 22 Oct 2025 18:27:14 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id C73B7202805; Wed, 22 Oct 2025 18:27:09 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , Chia-Yu Chang , Chuck Lever , Donald Hunter , Jonathan Corbet , "Matthieu Baerts (NGI0)" , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next 7/7] netlink: specs: tc: set ignore-index on indexed-arrays Date: Wed, 22 Oct 2025 18:27:00 +0000 Message-ID: <20251022182701.250897-8-ast@fiberby.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022182701.250897-1-ast@fiberby.net> References: <20251022182701.250897-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The indexes in tc indexed-arrays are mostly used for defining the priority winin an array of actions, and when parsed by the kernel they must be unique, and not exceed TCA_ACT_MAX_PRIO (32). Therefore this patch only sets ignore-index on a single attribute TCA_CAKE_STATS_TIN_STATS, which is only used for dumping statistics, and never ingested by the kernel. =E2=94=8F=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=B3=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=93 =E2=94=83 =E2=94=83 out/ =E2=94=83 inpu= t/ =E2=94=83 ignore =E2=94=83 =E2=94=83 Attribute =E2=94=83 dump =E2=94=83 pars= ed =E2=94=83 -index =E2=94=83 =E2=94=A1=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=95=87=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=A9 =E2=94=82 TCA_BASIC_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=82 TCA_BPF_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=82 TCA_CAKE_STATS_TIN_STATS =E2=94=82 1++ (4) =E2=94=82 - = =E2=94=82 yes =E2=94=82 =E2=94=82 TCA_CGROUP_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=82 TCA_FLOWER_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=82 TCA_FW_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=82 TCA_MATCHALL_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=82 TCA_ROUTE4_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=82 TCA_U32_ACT =E2=94=82 1++ (2) =E2=94=82 yes(= 3) =E2=94=82 no =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 Where: 1++) incrementing index starting from 1 2) All _ACT are dumped with tcf_exts_dump() calling tcf_action_dump(). 3) Parsed in tcf_action_init(). 4) Dumped in cake_dump_stats(). Signed-off-by: Asbj=C3=B8rn Sloth T=C3=B8nnesen --- Documentation/netlink/specs/tc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/sp= ecs/tc.yaml index b398f7a46dae1..24866fccb7d15 100644 --- a/Documentation/netlink/specs/tc.yaml +++ b/Documentation/netlink/specs/tc.yaml @@ -2188,6 +2188,7 @@ attribute-sets: name: tin-stats type: indexed-array sub-type: nest + ignore-index: true nested-attributes: cake-tin-stats-attrs - name: deficit --=20 2.51.0