Commit 37487f93 authored by Jakub Kicinski's avatar Jakub Kicinski

tools: ynl-gen: inherit struct use info

We only render parse and netlink generation helpers as needed,
to avoid generating dead code. Propagate the information from
first- and second-layer attribute sets onto all children.
Otherwise devlink won't work, it has a lot more levels of nesting.
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6afaa0ef
...@@ -896,6 +896,14 @@ class Family(SpecFamily): ...@@ -896,6 +896,14 @@ class Family(SpecFamily):
pns_key_seen.add(name) pns_key_seen.add(name)
else: else:
pns_key_list.append(name) pns_key_list.append(name)
# Propagate the request / reply
for attr_set, struct in reversed(self.pure_nested_structs.items()):
for _, spec in self.attr_sets[attr_set].items():
if 'nested-attributes' in spec:
child = self.pure_nested_structs.get(spec['nested-attributes'])
if child:
child.request |= struct.request
child.reply |= struct.reply
def _load_all_notify(self): def _load_all_notify(self):
for op_name, op in self.ops.items(): for op_name, op in self.ops.items():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment