* [PATCH net v1] tools: ynl: render event op docs correctly
@ 2026-01-12 15:34 Donald Hunter
2026-01-14 0:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Donald Hunter @ 2026-01-12 15:34 UTC (permalink / raw)
To: Donald Hunter, Jakub Kicinski, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, netdev, Jonathan Corbet, linux-doc
Cc: Donald Hunter
The docs for YNL event ops currently render raw python structs. For
example in:
https://docs.kernel.org/netlink/specs/ethtool.html#cable-test-ntf
event: {‘attributes’: [‘header’, ‘status’, ‘nest’], ‘__lineno__’: 2385}
Handle event ops correctly and render their op attributes:
event: attributes: [header, status]
Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
---
tools/net/ynl/pyynl/lib/doc_generator.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/net/ynl/pyynl/lib/doc_generator.py b/tools/net/ynl/pyynl/lib/doc_generator.py
index 3a16b8eb01ca..8b922d8f89e8 100644
--- a/tools/net/ynl/pyynl/lib/doc_generator.py
+++ b/tools/net/ynl/pyynl/lib/doc_generator.py
@@ -166,13 +166,13 @@ class YnlDocGenerator:
continue
lines.append(self.fmt.rst_paragraph(self.fmt.bold(key), level + 1))
if key in ['request', 'reply']:
- lines.append(self.parse_do_attributes(do_dict[key], level + 1) + "\n")
+ lines.append(self.parse_op_attributes(do_dict[key], level + 1) + "\n")
else:
lines.append(self.fmt.headroom(level + 2) + do_dict[key] + "\n")
return "\n".join(lines)
- def parse_do_attributes(self, attrs: Dict[str, Any], level: int = 0) -> str:
+ def parse_op_attributes(self, attrs: Dict[str, Any], level: int = 0) -> str:
"""Parse 'attributes' section"""
if "attributes" not in attrs:
return ""
@@ -184,7 +184,7 @@ class YnlDocGenerator:
def parse_operations(self, operations: List[Dict[str, Any]], namespace: str) -> str:
"""Parse operations block"""
- preprocessed = ["name", "doc", "title", "do", "dump", "flags"]
+ preprocessed = ["name", "doc", "title", "do", "dump", "flags", "event"]
linkable = ["fixed-header", "attribute-set"]
lines = []
@@ -217,6 +217,9 @@ class YnlDocGenerator:
if "dump" in operation:
lines.append(self.fmt.rst_paragraph(":dump:", 0))
lines.append(self.parse_do(operation["dump"], 0))
+ if "event" in operation:
+ lines.append(self.fmt.rst_paragraph(":event:", 0))
+ lines.append(self.parse_op_attributes(operation["event"], 0))
# New line after fields
lines.append("\n")
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net v1] tools: ynl: render event op docs correctly
2026-01-12 15:34 [PATCH net v1] tools: ynl: render event op docs correctly Donald Hunter
@ 2026-01-14 0:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-14 0:10 UTC (permalink / raw)
To: Donald Hunter
Cc: donhunte, kuba, davem, edumazet, pabeni, horms, netdev, corbet,
linux-doc
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 12 Jan 2026 15:34:36 +0000 you wrote:
> The docs for YNL event ops currently render raw python structs. For
> example in:
>
> https://docs.kernel.org/netlink/specs/ethtool.html#cable-test-ntf
>
> event: {‘attributes’: [‘header’, ‘status’, ‘nest’], ‘__lineno__’: 2385}
>
> [...]
Here is the summary with links:
- [net,v1] tools: ynl: render event op docs correctly
https://git.kernel.org/netdev/net/c/fa5726692e4c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-14 0:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12 15:34 [PATCH net v1] tools: ynl: render event op docs correctly Donald Hunter
2026-01-14 0:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox