Re: [PATCH net-next 02/11] tools: ynl-gen: generate nested array policies

Jacob Keller <[email protected]>
Newsgroups com.zx2c4.lists.wireguard,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>

On 9/6/2025 7:13 AM, Asbjørn Sloth Tønnesen wrote:
> CC: Johannes
> 
> On 9/6/25 12:19 AM, Jacob Keller wrote:
>> On 9/4/2025 3:01 PM, Asbjørn Sloth Tønnesen wrote:
>>> This patch adds support for NLA_POLICY_NESTED_ARRAY() policies.
>>>
>>> Example spec (from future wireguard.yaml):
>>> -
>>>    name: wgpeer
>>>    attributes:
>>>      -
>>>        name: allowedips
>>>        type: indexed-array
>>>        sub-type: nest
>>>        nested-attributes: wgallowedip
>>>
>>> yields NLA_POLICY_NESTED_ARRAY(wireguard_wgallowedip_nl_policy).
>>>
>>> This doesn't change any currently generated code, as it isn't
>>> used in any specs currently used for generating code.
>>>
>>> Signed-off-by: Asbjørn Sloth Tønnesen <[email protected]>
>>> ---
>>
>> Is this keyed of off the sub-type? Does you mean that all the existing
>> uses of 'sub-type: nest' don't generate code today? Or that this
>> _attr_policy implementation is not called yet?
> 
> Thanks for the reviews. Yeah, it is a careful wording, because we have
> specs matching it, but there aren't any source files that triggers
> ynl-gen to generate code based on those specs.
> 
Ok. That's what I thought and just wanted to be certain, since I saw
several uses in the code. Thanks for explaining!
OpenPGP_signature.asc (application/pgp-signature, 236 B)
-----BEGIN PGP SIGNATURE-----

wnsEABYIACMWIQQgQFSp1zOQVirsQx5qll0+bw8o6AUCaMCyIgUDAAAAAAAKCRBqll0+bw8o6Iet
AQDzcq0a8p6UP2ZCl0MGc9qoa0it+y3Ci4JBTrGj2vq4eQD9GmqeklzhKl+EoOIlA6tHm/qW5wNC
rcUCIu1r3o0AQQQ=
=ptUN
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.