[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240219172525.71406-6-jiri@resnulli.us>
Date: Mon, 19 Feb 2024 18:25:21 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: kuba@...nel.org,
pabeni@...hat.com,
davem@...emloft.net,
edumazet@...gle.com,
jacob.e.keller@...el.com,
swarupkotikalapudi@...il.com,
donald.hunter@...il.com,
sdf@...gle.com,
lorenzo@...nel.org,
alessandromarcolini99@...il.com
Subject: [patch net-next 05/13] tools: ynl: allow attr in a subset to be of a different type
From: Jiri Pirko <jiri@...dia.com>
Currently, when subset attribute is defined, it inherits the whole
definition of the attribute in original set. To be able to achieve
sub message decoding of the same attribute of different type, allow
spec to define different type for the same attribute.
Signed-off-by: Jiri Pirko <jiri@...dia.com>
---
tools/net/ynl/lib/nlspec.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py
index fbce52395b3b..5e48ee0fb8b4 100644
--- a/tools/net/ynl/lib/nlspec.py
+++ b/tools/net/ynl/lib/nlspec.py
@@ -217,6 +217,8 @@ class SpecAttrSet(SpecElement):
real_set = family.attr_sets[self.subset_of]
for elem in self.yaml['attributes']:
attr = real_set[elem['name']]
+ if 'type' in elem and attr.type != elem['type']:
+ attr = self.new_attr(elem, attr.value)
self.attrs[attr.name] = attr
self.attrs_by_val[attr.value] = attr
--
2.43.2
Powered by blists - more mailing lists