tools: ynl-gen: support uint in multi-attr
Subsystems (3)
Jakub Kicinski
maintainerPATCH 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
@@ -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
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.
Signed-off-by Jakub Kicinski <[email protected]>---
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@@ -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
-1scalar_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")
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.
Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
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