The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc
@ 2025-09-13 13:29 Matthieu Baerts (NGI0)
  2025-09-13 13:29 ` [PATCH net-next v3 1/3] " Matthieu Baerts (NGI0)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-09-13 13:29 UTC (permalink / raw)
  To: Jonathan Corbet, Donald Hunter, Jakub Kicinski, David S. Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Jiri Pirko
  Cc: linux-doc, netdev, linux-kernel, Matthieu Baerts (NGI0),
	Chuck Lever, Jacob Keller, Florian Westphal, Ido Schimmel

Some attribute-set have a documentation (doc:), but they are not
displayed in the RST / HTML version. This series adds the missing
parsing of these 'doc' fields.

While at it, it also fixes how the 'doc' fields are declared on multiple
lines.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v3:
- patch 2: avoid warnings reported by the CI (NIPA/Jakub)
- Link to v2: https://lore.kernel.org/r/20250912-net-next-ynl-attr-doc-rst-v2-0-c44d36a99992@kernel.org

Changes in v2:
- patch 2 & 3: new
- Link to v1: https://lore.kernel.org/r/20250910-net-next-ynl-attr-doc-rst-v1-1-0bbc77816174@kernel.org

---
Matthieu Baerts (NGI0) (3):
      tools: ynl: rst: display attribute-set doc
      netlink: specs: team: avoid mangling multilines doc
      netlink: specs: explicitly declare block scalar strings

 Documentation/netlink/specs/conntrack.yaml    |  2 +-
 Documentation/netlink/specs/netdev.yaml       | 22 +++++++++++-----------
 Documentation/netlink/specs/nftables.yaml     |  2 +-
 Documentation/netlink/specs/nl80211.yaml      |  2 +-
 Documentation/netlink/specs/ovs_datapath.yaml |  2 +-
 Documentation/netlink/specs/ovs_flow.yaml     |  2 +-
 Documentation/netlink/specs/ovs_vport.yaml    |  2 +-
 Documentation/netlink/specs/rt-addr.yaml      |  2 +-
 Documentation/netlink/specs/rt-link.yaml      |  2 +-
 Documentation/netlink/specs/rt-neigh.yaml     |  2 +-
 Documentation/netlink/specs/rt-route.yaml     |  2 +-
 Documentation/netlink/specs/rt-rule.yaml      |  2 +-
 Documentation/netlink/specs/tc.yaml           |  2 +-
 Documentation/netlink/specs/team.yaml         |  6 ++++--
 tools/net/ynl/pyynl/lib/doc_generator.py      |  4 ++++
 15 files changed, 31 insertions(+), 25 deletions(-)
---
base-commit: fc006f5478fcf07d79b35e9dcdc51ecd11a6bf82
change-id: 20250910-net-next-ynl-attr-doc-rst-b61532634245

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next v3 1/3] tools: ynl: rst: display attribute-set doc
  2025-09-13 13:29 [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc Matthieu Baerts (NGI0)
@ 2025-09-13 13:29 ` Matthieu Baerts (NGI0)
  2025-09-13 13:29 ` [PATCH net-next v3 2/3] netlink: specs: team: avoid mangling multilines doc Matthieu Baerts (NGI0)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-09-13 13:29 UTC (permalink / raw)
  To: Jonathan Corbet, Donald Hunter, Jakub Kicinski, David S. Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Jiri Pirko
  Cc: linux-doc, netdev, linux-kernel, Matthieu Baerts (NGI0)

Some attribute-set have a documentation (doc:), but it was not displayed
in the RST / HTML version. Such field can be found in ethtool, netdev,
tcp_metrics and team YAML files.

Only the 'name' and 'attributes' fields from an 'attribute-set' section
were parsed. Now the content of the 'doc' field, if available, is added
as a new paragraph before listing each attribute. This is similar to
what is done when parsing the 'operations'.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Note: this patch can be applied without conflicts on top of net-next and
docs-next. To be honest, it is not clear to me who is responsible for
applying it :)
---
 tools/net/ynl/pyynl/lib/doc_generator.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/net/ynl/pyynl/lib/doc_generator.py b/tools/net/ynl/pyynl/lib/doc_generator.py
index 403abf1a2edaac6936d0e9db0623cd3e07aaad8e..3a16b8eb01ca0cf61a5983d3bd6a866e04c75844 100644
--- a/tools/net/ynl/pyynl/lib/doc_generator.py
+++ b/tools/net/ynl/pyynl/lib/doc_generator.py
@@ -289,6 +289,10 @@ class YnlDocGenerator:
         for entry in entries:
             lines.append(self.fmt.rst_section(namespace, 'attribute-set',
                                               entry["name"]))
+
+            if "doc" in entry:
+                lines.append(self.fmt.rst_paragraph(entry["doc"], 0) + "\n")
+
             for attr in entry["attributes"]:
                 if LINE_STR in attr:
                     lines.append(self.fmt.rst_lineno(attr[LINE_STR]))

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next v3 2/3] netlink: specs: team: avoid mangling multilines doc
  2025-09-13 13:29 [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc Matthieu Baerts (NGI0)
  2025-09-13 13:29 ` [PATCH net-next v3 1/3] " Matthieu Baerts (NGI0)
@ 2025-09-13 13:29 ` Matthieu Baerts (NGI0)
  2025-09-13 13:29 ` [PATCH net-next v3 3/3] netlink: specs: explicitly declare block scalar strings Matthieu Baerts (NGI0)
  2025-09-16  1:40 ` [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-09-13 13:29 UTC (permalink / raw)
  To: Jonathan Corbet, Donald Hunter, Jakub Kicinski, David S. Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Jiri Pirko
  Cc: linux-doc, netdev, linux-kernel, Matthieu Baerts (NGI0)

By default, strings defined in YAML at the next line are folded:
newlines are replaced by spaces. Here, the newlines are there for a
reason, and should be kept in the output.

This can be fixed by adding the '|' symbol to use the "literal" style.
This issue was introduced by commit 387724cbf415 ("Documentation:
netlink: add a YAML spec for team"), but visible in the doc only since
the parent commit.

To avoid warnings when generating the HTML output, and to look better,
the code layout is now in a dedicated code block, which requires '::'
and a new blank line. Just for a question of uniformity, a new blank
line is also added after the code block.

Suggested-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
v3: code block and new blank lines (NIPA / Jakub)
---
 Documentation/netlink/specs/team.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/netlink/specs/team.yaml b/Documentation/netlink/specs/team.yaml
index cf02d47d12a458aaa7d45875a0a54af0093d80a8..83a275b44c825f9ba6f6660813d25b8efc20267b 100644
--- a/Documentation/netlink/specs/team.yaml
+++ b/Documentation/netlink/specs/team.yaml
@@ -25,8 +25,9 @@ definitions:
 attribute-sets:
   -
     name: team
-    doc:
-      The team nested layout of get/set msg looks like
+    doc: |
+      The team nested layout of get/set msg looks like::
+
           [TEAM_ATTR_LIST_OPTION]
               [TEAM_ATTR_ITEM_OPTION]
                   [TEAM_ATTR_OPTION_*], ...
@@ -39,6 +40,7 @@ attribute-sets:
               [TEAM_ATTR_ITEM_PORT]
                   [TEAM_ATTR_PORT_*], ...
               ...
+
     name-prefix: team-attr-
     attributes:
       -

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next v3 3/3] netlink: specs: explicitly declare block scalar strings
  2025-09-13 13:29 [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc Matthieu Baerts (NGI0)
  2025-09-13 13:29 ` [PATCH net-next v3 1/3] " Matthieu Baerts (NGI0)
  2025-09-13 13:29 ` [PATCH net-next v3 2/3] netlink: specs: team: avoid mangling multilines doc Matthieu Baerts (NGI0)
@ 2025-09-13 13:29 ` Matthieu Baerts (NGI0)
  2025-09-16  1:40 ` [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-09-13 13:29 UTC (permalink / raw)
  To: Jonathan Corbet, Donald Hunter, Jakub Kicinski, David S. Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Jiri Pirko
  Cc: linux-doc, netdev, linux-kernel, Matthieu Baerts (NGI0),
	Chuck Lever, Jacob Keller, Florian Westphal, Ido Schimmel

In YAML, it is allowed to declare a scalar strings at the next lines
without explicitly declaring them as a block. Yet, they looks weird, and
can cause issues when ':' or '#' are present.

The modified lines didn't have issues with the special characters, but
it seems better to explicitly declare such blocks as scalar strings to
encourage people to "properly" declare future scalar strings.

The right angle bracket is used with a minus sign to indicate that the
folded style should be used without adding extra newlines. By doing
that, the output is not changed compared to what was done before this
patch.

Suggested-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Jacob Keller <jacob.e.keller@intel.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Ido Schimmel <idosch@nvidia.com>
---
 Documentation/netlink/specs/conntrack.yaml    |  2 +-
 Documentation/netlink/specs/netdev.yaml       | 22 +++++++++++-----------
 Documentation/netlink/specs/nftables.yaml     |  2 +-
 Documentation/netlink/specs/nl80211.yaml      |  2 +-
 Documentation/netlink/specs/ovs_datapath.yaml |  2 +-
 Documentation/netlink/specs/ovs_flow.yaml     |  2 +-
 Documentation/netlink/specs/ovs_vport.yaml    |  2 +-
 Documentation/netlink/specs/rt-addr.yaml      |  2 +-
 Documentation/netlink/specs/rt-link.yaml      |  2 +-
 Documentation/netlink/specs/rt-neigh.yaml     |  2 +-
 Documentation/netlink/specs/rt-route.yaml     |  2 +-
 Documentation/netlink/specs/rt-rule.yaml      |  2 +-
 Documentation/netlink/specs/tc.yaml           |  2 +-
 13 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Documentation/netlink/specs/conntrack.yaml b/Documentation/netlink/specs/conntrack.yaml
index c6832633ab7bf9517194da3e2227ace0fa03b013..642ac859cb7ade772e5a7674509475ab32ea3319 100644
--- a/Documentation/netlink/specs/conntrack.yaml
+++ b/Documentation/netlink/specs/conntrack.yaml
@@ -4,7 +4,7 @@ name: conntrack
 protocol: netlink-raw
 protonum: 12
 
-doc:
+doc: >-
   Netfilter connection tracking subsystem over nfnetlink
 
 definitions:
diff --git a/Documentation/netlink/specs/netdev.yaml b/Documentation/netlink/specs/netdev.yaml
index c035dc0f64fd6245669c9df82a208c7afddcc3cf..e00d3fa1c152d7165e9485d6d383a2cc9cef7cfd 100644
--- a/Documentation/netlink/specs/netdev.yaml
+++ b/Documentation/netlink/specs/netdev.yaml
@@ -2,7 +2,7 @@
 ---
 name: netdev
 
-doc:
+doc: >-
   netdev configuration over generic netlink.
 
 definitions:
@@ -13,33 +13,33 @@ definitions:
     entries:
       -
         name: basic
-        doc:
+        doc: >-
           XDP features set supported by all drivers
           (XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX)
       -
         name: redirect
-        doc:
+        doc: >-
           The netdev supports XDP_REDIRECT
       -
         name: ndo-xmit
-        doc:
+        doc: >-
           This feature informs if netdev implements ndo_xdp_xmit callback.
       -
         name: xsk-zerocopy
-        doc:
+        doc: >-
           This feature informs if netdev supports AF_XDP in zero copy mode.
       -
         name: hw-offload
-        doc:
+        doc: >-
           This feature informs if netdev supports XDP hw offloading.
       -
         name: rx-sg
-        doc:
+        doc: >-
           This feature informs if netdev implements non-linear XDP buffer
           support in the driver napi callback.
       -
         name: ndo-xmit-sg
-        doc:
+        doc: >-
           This feature informs if netdev implements non-linear XDP buffer
           support in ndo_xdp_xmit callback.
   -
@@ -67,15 +67,15 @@ definitions:
     entries:
       -
         name: tx-timestamp
-        doc:
+        doc: >-
           HW timestamping egress packets is supported by the driver.
       -
         name: tx-checksum
-        doc:
+        doc: >-
           L3 checksum HW offload is supported by the driver.
       -
         name: tx-launch-time-fifo
-        doc:
+        doc: >-
           Launch time HW offload is supported by the driver.
   -
     name: queue-type
diff --git a/Documentation/netlink/specs/nftables.yaml b/Documentation/netlink/specs/nftables.yaml
index 2ee10d92d644a6e25e746f4981457e0dc28181ad..cce88819ba71650cbdcf1f04a728d799d7aaa196 100644
--- a/Documentation/netlink/specs/nftables.yaml
+++ b/Documentation/netlink/specs/nftables.yaml
@@ -4,7 +4,7 @@ name: nftables
 protocol: netlink-raw
 protonum: 12
 
-doc:
+doc: >-
   Netfilter nftables configuration over netlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/nl80211.yaml b/Documentation/netlink/specs/nl80211.yaml
index 610fdd5e000ebfdfbc882a0b7929ed9cf1b206ae..802097128bdaede58d67a862298ccd752261761d 100644
--- a/Documentation/netlink/specs/nl80211.yaml
+++ b/Documentation/netlink/specs/nl80211.yaml
@@ -3,7 +3,7 @@
 name: nl80211
 protocol: genetlink-legacy
 
-doc:
+doc: >-
   Netlink API for 802.11 wireless devices
 
 definitions:
diff --git a/Documentation/netlink/specs/ovs_datapath.yaml b/Documentation/netlink/specs/ovs_datapath.yaml
index 0c0abf3f9f050f37ac3905dedb2270af1a6594ca..f7b3671991e6cb5d0e868977b83cad43327cb98b 100644
--- a/Documentation/netlink/specs/ovs_datapath.yaml
+++ b/Documentation/netlink/specs/ovs_datapath.yaml
@@ -5,7 +5,7 @@ version: 2
 protocol: genetlink-legacy
 uapi-header: linux/openvswitch.h
 
-doc:
+doc: >-
   OVS datapath configuration over generic netlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/ovs_flow.yaml b/Documentation/netlink/specs/ovs_flow.yaml
index 2dac9c8add57bb87a707b4c62d8e4794dc970a43..951837b72e1d280468272a85747a08db2d16170f 100644
--- a/Documentation/netlink/specs/ovs_flow.yaml
+++ b/Documentation/netlink/specs/ovs_flow.yaml
@@ -5,7 +5,7 @@ version: 1
 protocol: genetlink-legacy
 uapi-header: linux/openvswitch.h
 
-doc:
+doc: >-
   OVS flow configuration over generic netlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/ovs_vport.yaml b/Documentation/netlink/specs/ovs_vport.yaml
index da47e65fd574203f5ead79d6d470923e0440a1be..fa975f8821b6c9283a9c4a8a2dc51452b14c89e5 100644
--- a/Documentation/netlink/specs/ovs_vport.yaml
+++ b/Documentation/netlink/specs/ovs_vport.yaml
@@ -5,7 +5,7 @@ version: 2
 protocol: genetlink-legacy
 uapi-header: linux/openvswitch.h
 
-doc:
+doc: >-
   OVS vport configuration over generic netlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/rt-addr.yaml b/Documentation/netlink/specs/rt-addr.yaml
index bafe3bfeabfb572167a746279edb1a2cac52cbb2..3a582eac1629ee50bd6257dcdfc54ca27a03c03a 100644
--- a/Documentation/netlink/specs/rt-addr.yaml
+++ b/Documentation/netlink/specs/rt-addr.yaml
@@ -5,7 +5,7 @@ protocol: netlink-raw
 uapi-header: linux/rtnetlink.h
 protonum: 0
 
-doc:
+doc: >-
   Address configuration over rtnetlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/rt-link.yaml b/Documentation/netlink/specs/rt-link.yaml
index 210394c188a3bc0ed2e248717cce414a20a19089..6ab31f86854db3894ba7c05b398ad6f087facd19 100644
--- a/Documentation/netlink/specs/rt-link.yaml
+++ b/Documentation/netlink/specs/rt-link.yaml
@@ -5,7 +5,7 @@ protocol: netlink-raw
 uapi-header: linux/rtnetlink.h
 protonum: 0
 
-doc:
+doc: >-
   Link configuration over rtnetlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/rt-neigh.yaml b/Documentation/netlink/specs/rt-neigh.yaml
index 30a9ee16f128eac9b9f2f0cf1b8aea1940f1e62d..2f568a6231c9309aa8aec00907ea10a4e3359c1a 100644
--- a/Documentation/netlink/specs/rt-neigh.yaml
+++ b/Documentation/netlink/specs/rt-neigh.yaml
@@ -5,7 +5,7 @@ protocol: netlink-raw
 uapi-header: linux/rtnetlink.h
 protonum: 0
 
-doc:
+doc: >-
   IP neighbour management over rtnetlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/rt-route.yaml b/Documentation/netlink/specs/rt-route.yaml
index 5b514ddeff1db01784e4398a0092490616ca51a2..1ecb3fadc0679fb577d73717ddda4e9c5d61d624 100644
--- a/Documentation/netlink/specs/rt-route.yaml
+++ b/Documentation/netlink/specs/rt-route.yaml
@@ -5,7 +5,7 @@ protocol: netlink-raw
 uapi-header: linux/rtnetlink.h
 protonum: 0
 
-doc:
+doc: >-
   Route configuration over rtnetlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/rt-rule.yaml b/Documentation/netlink/specs/rt-rule.yaml
index 46b1d426e7e863a3ee90199b0c3adeb1e34c1465..bebee452a95073332e7b0681ddd97560ce873f20 100644
--- a/Documentation/netlink/specs/rt-rule.yaml
+++ b/Documentation/netlink/specs/rt-rule.yaml
@@ -5,7 +5,7 @@ protocol: netlink-raw
 uapi-header: linux/fib_rules.h
 protonum: 0
 
-doc:
+doc: >-
   FIB rule management over rtnetlink.
 
 definitions:
diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml
index b1afc7ab353951d5eeab20323db9dd91966789a2..b398f7a46dae19ba82669404e85665e56139c22e 100644
--- a/Documentation/netlink/specs/tc.yaml
+++ b/Documentation/netlink/specs/tc.yaml
@@ -5,7 +5,7 @@ protocol: netlink-raw
 uapi-header: linux/pkt_cls.h
 protonum: 0
 
-doc:
+doc: >-
   Netlink raw family for tc qdisc, chain, class and filter configuration
   over rtnetlink.
 

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc
  2025-09-13 13:29 [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc Matthieu Baerts (NGI0)
                   ` (2 preceding siblings ...)
  2025-09-13 13:29 ` [PATCH net-next v3 3/3] netlink: specs: explicitly declare block scalar strings Matthieu Baerts (NGI0)
@ 2025-09-16  1:40 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-16  1:40 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: corbet, donald.hunter, kuba, davem, edumazet, pabeni, horms, jiri,
	linux-doc, netdev, linux-kernel, chuck.lever, jacob.e.keller, fw,
	idosch

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 13 Sep 2025 15:29:50 +0200 you wrote:
> Some attribute-set have a documentation (doc:), but they are not
> displayed in the RST / HTML version. This series adds the missing
> parsing of these 'doc' fields.
> 
> While at it, it also fixes how the 'doc' fields are declared on multiple
> lines.
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/3] tools: ynl: rst: display attribute-set doc
    https://git.kernel.org/netdev/net-next/c/a51126424f75
  - [net-next,v3,2/3] netlink: specs: team: avoid mangling multilines doc
    https://git.kernel.org/netdev/net-next/c/515c0ead788f
  - [net-next,v3,3/3] netlink: specs: explicitly declare block scalar strings
    https://git.kernel.org/netdev/net-next/c/12e74931ee97

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] 5+ messages in thread

end of thread, other threads:[~2025-09-16  1:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-13 13:29 [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc Matthieu Baerts (NGI0)
2025-09-13 13:29 ` [PATCH net-next v3 1/3] " Matthieu Baerts (NGI0)
2025-09-13 13:29 ` [PATCH net-next v3 2/3] netlink: specs: team: avoid mangling multilines doc Matthieu Baerts (NGI0)
2025-09-13 13:29 ` [PATCH net-next v3 3/3] netlink: specs: explicitly declare block scalar strings Matthieu Baerts (NGI0)
2025-09-16  1:40 ` [PATCH net-next v3 0/3] tools: ynl: rst: display attribute-set doc 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