[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2a5c4nkbu.fsf@gmail.com>
Date: Mon, 06 Jan 2025 13:27:49 +0000
From: Donald Hunter <donald.hunter@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com
Subject: Re: [PATCH net-next 1/3] tools: ynl: correctly handle overrides of
fields in subset
Jakub Kicinski <kuba@...nel.org> writes:
> We stated in documentation [1] and previous discussions [2]
> that the need for overriding fields in members of subsets
> is anticipated. Implement it.
>
> [1] https://docs.kernel.org/next/userspace-api/netlink/specs.html#subset-of
> [2] https://lore.kernel.org/netdev/20231004171350.1f59cd1d@kernel.org/
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
I guess we're okay with requiring Python >= 3.9 for combining
dicts with |
Reviewed-by: Donald Hunter <donald.hunter@...il.com>
> ---
> tools/net/ynl/lib/nlspec.py | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py
> index a745739655ad..314ec8007496 100644
> --- a/tools/net/ynl/lib/nlspec.py
> +++ b/tools/net/ynl/lib/nlspec.py
> @@ -219,7 +219,10 @@ jsonschema = None
> else:
> real_set = family.attr_sets[self.subset_of]
> for elem in self.yaml['attributes']:
> - attr = real_set[elem['name']]
> + real_attr = real_set[elem['name']]
> + combined_elem = real_attr.yaml | elem
> + attr = self.new_attr(combined_elem, real_attr.value)
> +
> self.attrs[attr.name] = attr
> self.attrs_by_val[attr.value] = attr
Powered by blists - more mailing lists