Skip to contentSkip to conversation

docs: netlink: link to family documentations from spec info

PATCH Superseded Jakub Kicinski 5 participants 7 messages Nov 27, 2023 – Nov 30, 2023

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 docs: netlink: link to family documentations from spec info

To increase the chances of people finding the rendered docs add a link to specs.rst. Add a label in the generated index.rst and while at it adjust the title a little bit.

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

---
 Documentation/userspace-api/netlink/specs.rst | 2 +-
 tools/net/ynl/ynl-gen-rst.py                  | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
Documentation/userspace-api/netlink/specs.rst +1 -1
index c1b951649113..1b50d97d8d7c 100644
@@ -15,7 +15,7 @@ kernel headers directly.
 Internally kernel uses the YAML specs to generate:
 
  - the C uAPI header
- - documentation of the protocol as a ReST file
+ - documentation of the protocol as a ReST file - see :ref:`Documentation/networking/netlink_spec/index.rst <specs>`
  - policy tables for input attribute validation
  - operation tables
 
tools/net/ynl/ynl-gen-rst.py +7 -1
index b6292109e236..2c0b80071bcd 100755
@@ -122,6 +122,11 @@ SPACE_PER_LEVEL = 4
     return "\n".join(lines)
 
 
+def rst_label(title) -> str:
+    """Return a formatted label"""
+    return f".. _{title}:\n\n"
+
+
 # Parsers
 # =======
 
@@ -349,7 +354,8 @@ SPACE_PER_LEVEL = 4
     lines = []
 
     lines.append(rst_header())
-    lines.append(rst_title("Netlink Specification"))
+    lines.append(rst_label("specs"))
+    lines.append(rst_title("Netlink Family Specifications"))
     lines.append(rst_toctree(1))
 
     index_dir = os.path.dirname(output)
Signature · 1 line
2.42.0
#1 lore raw
kernel test robot noticed the following build warnings:

Hi Jakub,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/docs-netlink-link-to-family-documentations-from-spec-info/20231128-050136
base:   net-next/main
patch link:    https://lore.kernel.org/r/20231127205642.2293153-1-kuba%40kernel.org
patch subject: [PATCH net-next] docs: netlink: link to family documentations from spec info
reproduce: (https://download.01.org/0day-ci/archive/20231128/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> Warning: Documentation/userspace-api/netlink/specs.rst references a file that doesn't exist: Documentation/networking/netlink_spec/index.rst
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#2 lore raw
Quoted 12 lines · On Tue, 28 Nov 2023 11:01:55 +0800 kernel test robot wrote:

Hi Jakub,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/docs-netlink-link-to-family-documentations-from-spec-info/20231128-050136
base:   net-next/main
patch link:    https://lore.kernel.org/r/20231127205642.2293153-1-kuba%40kernel.org
patch subject: [PATCH net-next] docs: netlink: link to family documentations from spec info
reproduce: (https://download.01.org/0day-ci/archive/20231128/[email protected]/reproduce)
Quoted 8 lines

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

Warning: Documentation/userspace-api/netlink/specs.rst references a file that doesn't exist: Documentation/networking/netlink_spec/index.rst

Is it possible that the build bot is missing python-yaml support and the generation of Documentation/networking/netlink_spec/index.rst fails?

Or is this an ordering issue?

#3 lore raw
Quoted 18 lines · Jakub Kicinski
Quoted 17 lines · On Tue, 28 Nov 2023 11:01:55 +0800 kernel test robot wrote:

Hi Jakub,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/docs-netlink-link-to-family-documentations-from-spec-info/20231128-050136
base:   net-next/main
patch link:    https://lore.kernel.org/r/20231127205642.2293153-1-kuba%40kernel.org
patch subject: [PATCH net-next] docs: netlink: link to family documentations from spec info
reproduce: (https://download.01.org/0day-ci/archive/20231128/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 7 lines
Quoted 3 lines

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

Warning: Documentation/userspace-api/netlink/specs.rst references a file that doesn't exist: Documentation/networking/netlink_spec/index.rst

Is it possible that the build bot is missing python-yaml support and the generation of Documentation/networking/netlink_spec/index.rst fails?

Hi Jakub, this is indeed due to missing pyyaml module in the bot so the doc file is not generated. We've installed it now and the warning is gone. Sorry for the noise and please ignore this report.

Quoted 3 lines

Or is this an ordering issue?

author maintainer
#4 lore raw
Quoted 7 lines · On Thu, 30 Nov 2023 16:52:10 +0800 Yujie Liu wrote:
Quoted 3 lines

Is it possible that the build bot is missing python-yaml support and the generation of Documentation/networking/netlink_spec/index.rst fails?

Hi Jakub, this is indeed due to missing pyyaml module in the bot so the doc file is not generated. We've installed it now and the warning is gone. Sorry for the noise and please ignore this report.

No worries at all, thanks for confirming!

Reviewed-by on v1 1/1
#5 lore raw
In reply to Jakub Kicinski

tools/net/ynl/ynl-gen-rst.py SPACE_PER_LEVEL = 4 · line 125

Quoted 9 lines · Jakub Kicinski
tools/net/ynl/ynl-gen-rst.py +1 -0
index b6292109e236..2c0b80071bcd 100755
@@ -122,6 +122,11 @@ SPACE_PER_LEVEL = 4
     return "\n".join(lines)
 
 
+def rst_label(title) -> str:

Please add the type hinting to the "title" argument. Something as:

def rst_label(title: str) -> str:

Other than that I am good, and feel free to add:

maintainer Reviewed-by on v1 1/1
#6 lore raw
In reply to Jakub Kicinski
Quoted 3 lines · Jakub Kicinski

To increase the chances of people finding the rendered docs add a link to specs.rst. Add a label in the generated index.rst and while at it adjust the title a little bit.

It might be useful to also link to the rendered docs directly from the "Netlink Handbook" at Documentation/userspace-api/netlink/index.rst?

Quoted 49 lines

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

---
 Documentation/userspace-api/netlink/specs.rst | 2 +-
 tools/net/ynl/ynl-gen-rst.py                  | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
Documentation/userspace-api/netlink/specs.rst +1 -1
index c1b951649113..1b50d97d8d7c 100644
@@ -15,7 +15,7 @@ kernel headers directly.
 Internally kernel uses the YAML specs to generate:
 
  - the C uAPI header
- - documentation of the protocol as a ReST file
+ - documentation of the protocol as a ReST file - see :ref:`Documentation/networking/netlink_spec/index.rst <specs>`
  - policy tables for input attribute validation
  - operation tables
 
tools/net/ynl/ynl-gen-rst.py +7 -1
index b6292109e236..2c0b80071bcd 100755
@@ -122,6 +122,11 @@ SPACE_PER_LEVEL = 4
     return "\n".join(lines)
 
 
+def rst_label(title) -> str:
+    """Return a formatted label"""
+    return f".. _{title}:\n\n"
+
+
 # Parsers
 # =======
 
@@ -349,7 +354,8 @@ SPACE_PER_LEVEL = 4
     lines = []
 
     lines.append(rst_header())
-    lines.append(rst_title("Netlink Specification"))
+    lines.append(rst_label("specs"))
+    lines.append(rst_title("Netlink Family Specifications"))
     lines.append(rst_toctree(1))
 
     index_dir = os.path.dirname(output)