[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231016213937.1820386-1-kuba@kernel.org>
Date: Mon, 16 Oct 2023 14:39:37 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
Jakub Kicinski <kuba@...nel.org>,
Willem de Bruijn <willemb@...gle.com>,
Stanislav Fomichev <sdf@...gle.com>,
donald.hunter@...il.com
Subject: [PATCH net-next] tools: ynl: fix converting flags to names after recent cleanup
I recently cleaned up specs to not specify enum-as-flags
when target enum is already defined as flags.
YNL Python library did not convert flags, unfortunately,
so this caused breakage for Stan and Willem.
Note that the nlspec.py abstraction already hides the differences
between flags and enums (value vs user_value), so the changes
are pretty trivial.
Fixes: 0629f22ec130 ("ynl: netdev: drop unnecessary enum-as-flags")
Reported-and-tested-by: Willem de Bruijn <willemb@...gle.com>
Reported-and-tested-by: Stanislav Fomichev <sdf@...gle.com>
Link: https://lore.kernel.org/all/ZS10NtQgd_BJZ3RU@google.com/
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
CC: donald.hunter@...il.com
CC: sdf@...gle.com
---
tools/net/ynl/lib/ynl.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
index cc2930633f98..be479bd9dfc8 100644
--- a/tools/net/ynl/lib/ynl.py
+++ b/tools/net/ynl/lib/ynl.py
@@ -486,7 +486,7 @@ genl_family_name_to_id = None
def _decode_enum(self, raw, attr_spec):
enum = self.consts[attr_spec['enum']]
- if 'enum-as-flags' in attr_spec and attr_spec['enum-as-flags']:
+ if enum.type == 'flags' or attr_spec.get('enum-as-flags', False):
i = 0
value = set()
while raw:
--
2.41.0
Powered by blists - more mailing lists