[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DM6PR11MB4657185674862C8771D984759B38A@DM6PR11MB4657.namprd11.prod.outlook.com>
Date: Tue, 18 Jul 2023 16:56:28 +0000
From: "Kubalewski, Arkadiusz" <arkadiusz.kubalewski@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, Donald Hunter <donald.hunter@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "davem@...emloft.net"
<davem@...emloft.net>, "pabeni@...hat.com" <pabeni@...hat.com>,
"edumazet@...gle.com" <edumazet@...gle.com>
Subject: RE: [PATCH net-next 2/2 v2] tools: ynl-gen: fix parse multi-attr enum
attribute
>From: Jakub Kicinski <kuba@...nel.org>
>Sent: Thursday, July 13, 2023 6:09 PM
>
>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").
Tried to improve in v3, please take a look, although not sure if passing
attr_spec from _decode_binary() further to as_struct() and _decode_enum()
is sufficient for us..
Thank you!
Arkadiusz
Powered by blists - more mailing lists