Skip to content

Commit f7c595c

Browse files
committed
tools: ynl: decode enums in auto-ints
Use enum decoding on auto-ints. Looks like we only had enum auto-ints for input values until now. Upcoming RSS work will need this to declare an attribute with flags as a uint. Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250708220640.2738464-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 400244e commit f7c595c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/net/ynl/pyynl/lib/ynl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ def _decode(self, attrs, space, outer_attrs = None):
762762
decoded = True
763763
elif attr_spec.is_auto_scalar:
764764
decoded = attr.as_auto_scalar(attr_spec['type'], attr_spec.byte_order)
765+
if 'enum' in attr_spec:
766+
decoded = self._decode_enum(decoded, attr_spec)
765767
elif attr_spec["type"] in NlAttr.type_formats:
766768
decoded = attr.as_scalar(attr_spec['type'], attr_spec.byte_order)
767769
if 'enum' in attr_spec:

0 commit comments

Comments
 (0)