Skip to contentSkip to conversation

tools: ynl-gen: support uint in multi-attr

PATCH Applied Jakub Kicinski 4 participants 4 messages Sep 16, 2025 – Sep 17, 2025

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 tools: ynl-gen: support uint in multi-attr

The ethtool FEC histogram series run into a build issue with
type: uint + multi-attr: True. Auto scalars use 64b types, we need to convert them explicitly when rendering the types.

No current spec needs this, and the ethtool FEC histogram doesn't need this either any more, so not posting as a fix.

---
CC: [email protected]
CC: [email protected]

---
 tools/net/ynl/pyynl/ynl_gen_c.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/net/ynl/pyynl/ynl_gen_c.py +5 -1
index 56c63022d702..58086b101057 100755
@@ -720,7 +720,11 @@ from lib import SpecSubMessage
             return 'struct ynl_string *'
         elif self.attr['type'] in scalars:
             scalar_pfx = '__' if ri.ku_space == 'user' else ''
-            return scalar_pfx + self.attr['type']
+            if self.is_auto_scalar:
+                name = self.type[0] + '64'
+            else:
+                name = self.attr['type']
+            return scalar_pfx + name
         else:
             raise Exception(f"Sub-type {self.attr['type']} not supported yet")
 
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Jakub Kicinski

The ethtool FEC histogram series run into a build issue with
type: uint + multi-attr: True. Auto scalars use 64b types, we need to convert them explicitly when rendering the types.

No current spec needs this, and the ethtool FEC histogram doesn't need this either any more, so not posting as a fix.

---
CC: [email protected]
CC: [email protected]

---
  tools/net/ynl/pyynl/ynl_gen_c.py | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
tools/net/ynl/pyynl/ynl_gen_c.py +0 -0
index 56c63022d702..58086b101057 100755
@@ -720,7 +720,11 @@ from lib import SpecSubMessage
              return 'struct ynl_string *'
          elif self.attr['type'] in scalars:

tools/net/ynl/pyynl/ynl_gen_c.py from lib import SpecSubMessage · line 730

Quoted 10 lines
tools/net/ynl/pyynl/ynl_gen_c.py +5 -1
              scalar_pfx = '__' if ri.ku_space == 'user' else ''
-            return scalar_pfx + self.attr['type']
+            if self.is_auto_scalar:
+                name = self.type[0] + '64'
+            else:
+                name = self.attr['type']
+            return scalar_pfx + name
          else:
              raise Exception(f"Sub-type {self.attr['type']} not supported yet")
 
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Jakub Kicinski
Quoted 4 lines · Jakub Kicinski

The ethtool FEC histogram series run into a build issue with
type: uint + multi-attr: True. Auto scalars use 64b types, we need to convert them explicitly when rendering the types.

Quoted 8 lines

No current spec needs this, and the ethtool FEC histogram doesn't need this either any more, so not posting as a fix.

---
CC: [email protected]
CC: [email protected]

#3 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 16 Sep 2025 10:04:31 -0700 you wrote:

The ethtool FEC histogram series run into a build issue with
type: uint + multi-attr: True. Auto scalars use 64b types, we need to convert them explicitly when rendering the types.

No current spec needs this, and the ethtool FEC histogram doesn't need this either any more, so not posting as a fix.

[...]

Here is the summary with links:
- [net-next] tools: ynl-gen: support uint in multi-attr

    https://git.kernel.org/netdev/net-next/c/4436b2b324ce

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html