Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Hangbin Liu
Tue, 17 Nov 2026 03:16
[PATCH net-next v2] tools: ynl: render operations-level fixed-header in docs
Author: Hangbin Liu
Date: Tue, 17 Nov 2026 03:16
Date: Tue, 17 Nov 2026 03:16
83 lines
12024 bytes
12024 bytes
From: Hangbin Liu <liuhangbin@kylinos.cn>
The doc generator only rendered keys on each operations list entry, so
operations-level fixed-header (the family default) never showed up in the
generated HTML. Add a fallback to emit the default_fixed_header on ops
that do not set their own.
After update, rt-route, rt-addr, rt-rule, rt-nexthop and ovs_* all
shows the fixed header correctly in generated html doc.
Reported-by: Wessel Jacobi <wessel@jacobi.pw>
Closes: https://patch.msgid.link/8610ee11-e1dc-481a-9654-11188a06786a@jacobi.pw
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
I rebuilt the HTML documentation, the `fixed-header` shows up correctly
for rt-addr.yaml, rt-route.yaml, rt-rule.yaml, rt-nexthop.yaml, ovs_*.yaml
---
Changes in v2:
- Fix the issue in doc_generator instead of specific yaml file
- Link to v1: https://patch.msgid.link/20261112-ynl_fixed_header-v1-1-8475ea19e409@kylinos.cn
---
tools/net/ynl/pyynl/lib/doc_generator.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/net/ynl/pyynl/lib/doc_generator.py b/tools/net/ynl/pyynl/lib/doc_generator.py
index 74f5d408e048..0bd83da9a654 100644
--- a/tools/net/ynl/pyynl/lib/doc_generator.py
+++ b/tools/net/ynl/pyynl/lib/doc_generator.py
@@ -17,7 +17,7 @@
2) YAML Netlink (YNL) doc generator: Generate docs from YAML data
"""
-from typing import Any, Dict, List
+from typing import Any, Dict, List, Optional
import yaml
LINE_STR = '__lineno__'
@@ -181,7 +181,8 @@ class YnlDocGenerator:
return "\n".join(lines)
- def parse_operations(self, operations: List[Dict[str, Any]], namespace: str) -> str:
+ def parse_operations(self, operations: List[Dict[str, Any]], namespace: str,
+ default_fixed_header: Optional[str] = None) -> str:
"""Parse operations block"""
preprocessed = ["name", "doc", "title", "do", "dump", "flags", "event"]
linkable = ["fixed-header", "attribute-set"]
@@ -206,6 +207,13 @@ class YnlDocGenerator:
if key in linkable:
value = self.fmt.rst_ref(namespace, key, value)
lines.append(self.fmt.rst_fields(key, value, 0))
+
+ # Show the family-wide default when the op does not set its own
+ if default_fixed_header and "fixed-header" not in operation:
+ value = self.fmt.rst_ref(namespace, "fixed-header",
+ default_fixed_header)
+ lines.append(self.fmt.rst_fields("fixed-header", value, 0))
+
if 'flags' in operation:
lines.append(self.fmt.rst_fields('flags',
self.fmt.rst_list_inline(operation['flags'])))
@@ -367,8 +375,10 @@ class YnlDocGenerator:
# Operations
if "operations" in obj:
lines.append(self.fmt.rst_subtitle("Operations"))
- lines.append(self.parse_operations(obj["operations"]["list"],
- family))
+ lines.append(self.parse_operations(
+ obj["operations"]["list"],
+ family,
+ obj["operations"].get("fixed-header")))
# Multicast groups
if "mcast-groups" in obj:
---
base-commit: c88fd6989aea9237a60a4859139a265bfb7ddc0b
change-id: 20261112-ynl_fixed_header-2d7acfcb54f8
Best regards,
--
Hangbin Liu <liuhangbin@kylinos.cn>
Re: [PATCH net-next v2] tools: ynl: render operations-level fixed-header in docs
Author: patchwork-bot+netdevbpf
Date: Sat, 21 Nov 2026 01:20
Date: Sat, 21 Nov 2026 01:20
24 lines
8605 bytes
8605 bytes
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 17 Nov 2026 11:16:40 +0800 you wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
>
> The doc generator only rendered keys on each operations list entry, so
> operations-level fixed-header (the family default) never showed up in the
> generated HTML. Add a fallback to emit the default_fixed_header on ops
> that do not set their own.
>
> [...]
Here is the summary with links:
- [net-next,v2] tools: ynl: render operations-level fixed-header in docs
https://git.kernel.org/netdev/net-next/c/95efd17739e0
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads