Subject: Re: [PATCH net-next 2/2 v2] tools: ynl-gen: fix parse multi-attr enum attribute

From: Jakub Kicinski <[email-masked]>
Date: Thu, 13 Jul 2023 09:08:36 -0700

On Thu, 13 Jul 2023 11:05:50 +0200 Arkadiusz Kubalewski wrote:
> @@ -436,7 +435,7 @@ class YnlFamily(SpecFamily):
>              decoded = attr.as_struct(members)
>              for m in members:
>                  if m.enum:
> -                    self._decode_enum(decoded, m)
> +                    decoded[m] = self._decode_enum(decoded[m], m)

Yeah, not sure this is right.

Adding Donald, dropping Chuck and LMKL (please use this CC list for v3).

Given the code before the change we can assume that m is a complex type
describing the member so decoded[m] is likely going to explode.

I think you should move the enum decoding into as_struct(), transforming
the code into similar fashion as you did for responses (changing the
@decoded value before "value[m.name] = decoded").