diff mbox series

[net-next,v2,01/13] netlink: specs: rename rtnetlink specs in accordance with family name

Message ID 20250410014658.782120-2-kuba@kernel.org (mailing list archive)
State Accepted
Commit cd5e64fb959a98e2d3122c7e944f17ffa6d0448e
Delegated to: Netdev Maintainers
Headers show
Series tools: ynl: c: basic netlink-raw support | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; GEN HAS DIFF 12 files changed, 2722 insertions(+), 152 deletions(-);
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success Errors and warnings before: 26 (+4) this patch: 26 (+4)
netdev/cc_maintainers warning 5 maintainers not CCed: linux-doc@vger.kernel.org linux-kselftest@vger.kernel.org corbet@lwn.net idosch@nvidia.com shuah@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-04-11--03-00 (tests: 900)

Commit Message

Jakub Kicinski April 10, 2025, 1:46 a.m. UTC
The rtnetlink family names are set to rt-$name within the YAML
but the files are called rt_$name. C codegen assumes that the
generated file name will match the family. The use of dashes
is in line with our general expectation that name properties
in the spec use dashes not underscores (even tho, as Donald
points out most genl families use underscores in the name).

We have 3 un-ideal options to choose from:

 - accept the slight inconsistency with old families using _, or
 - accept the slight annoyance with all languages having to do s/-/_/
   when looking up family ID, or
 - accept the inconsistency with all name properties in new YAML spec
   being separated with - and just the family name always using _.

Pick option 1 and rename the rtnl spec files.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
v2: extend commit msg
---
 Documentation/netlink/specs/{rt_addr.yaml => rt-addr.yaml}   | 0
 Documentation/netlink/specs/{rt_link.yaml => rt-link.yaml}   | 0
 Documentation/netlink/specs/{rt_neigh.yaml => rt-neigh.yaml} | 0
 Documentation/netlink/specs/{rt_route.yaml => rt-route.yaml} | 0
 Documentation/netlink/specs/{rt_rule.yaml => rt-rule.yaml}   | 0
 Documentation/userspace-api/netlink/netlink-raw.rst          | 2 +-
 tools/testing/selftests/net/lib/py/ynl.py                    | 4 ++--
 7 files changed, 3 insertions(+), 3 deletions(-)
 rename Documentation/netlink/specs/{rt_addr.yaml => rt-addr.yaml} (100%)
 rename Documentation/netlink/specs/{rt_link.yaml => rt-link.yaml} (100%)
 rename Documentation/netlink/specs/{rt_neigh.yaml => rt-neigh.yaml} (100%)
 rename Documentation/netlink/specs/{rt_route.yaml => rt-route.yaml} (100%)
 rename Documentation/netlink/specs/{rt_rule.yaml => rt-rule.yaml} (100%)

Comments

Paolo Abeni April 10, 2025, 8:52 a.m. UTC | #1
On 4/10/25 3:46 AM, Jakub Kicinski wrote:
> The rtnetlink family names are set to rt-$name within the YAML
> but the files are called rt_$name. C codegen assumes that the
> generated file name will match the family. The use of dashes
> is in line with our general expectation that name properties
> in the spec use dashes not underscores (even tho, as Donald
> points out most genl families use underscores in the name).
> 
> We have 3 un-ideal options to choose from:
> 
>  - accept the slight inconsistency with old families using _, or
>  - accept the slight annoyance with all languages having to do s/-/_/
>    when looking up family ID, or
>  - accept the inconsistency with all name properties in new YAML spec
>    being separated with - and just the family name always using _.
> 
> Pick option 1 and rename the rtnl spec files.
> 
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> v2: extend commit msg
> ---
>  Documentation/netlink/specs/{rt_addr.yaml => rt-addr.yaml}   | 0
>  Documentation/netlink/specs/{rt_link.yaml => rt-link.yaml}   | 0
>  Documentation/netlink/specs/{rt_neigh.yaml => rt-neigh.yaml} | 0
>  Documentation/netlink/specs/{rt_route.yaml => rt-route.yaml} | 0
>  Documentation/netlink/specs/{rt_rule.yaml => rt-rule.yaml}   | 0
>  Documentation/userspace-api/netlink/netlink-raw.rst          | 2 +-
>  tools/testing/selftests/net/lib/py/ynl.py                    | 4 ++--
>  7 files changed, 3 insertions(+), 3 deletions(-)
>  rename Documentation/netlink/specs/{rt_addr.yaml => rt-addr.yaml} (100%)
>  rename Documentation/netlink/specs/{rt_link.yaml => rt-link.yaml} (100%)

My understanding is that this rename triggers rebuild of the related
doc, which in turns leads to quite a large number of htmldoc warning,
but it's really unharmful/pre-existing issue.

/P
Donald Hunter April 10, 2025, 12:39 p.m. UTC | #2
Yes, Documentation/Makefile goes the extra mile to only try deleting a
list of .rst files generated from the list of source .yaml files. It
would be easier to just delete
Documentation/networking/netlink_spec/*.rst which would be able to
clean up old generated files in situations like this.

On Thu, 10 Apr 2025 at 09:52, Paolo Abeni <pabeni@redhat.com> wrote:
>
>
>
> On 4/10/25 3:46 AM, Jakub Kicinski wrote:
> > The rtnetlink family names are set to rt-$name within the YAML
> > but the files are called rt_$name. C codegen assumes that the
> > generated file name will match the family. The use of dashes
> > is in line with our general expectation that name properties
> > in the spec use dashes not underscores (even tho, as Donald
> > points out most genl families use underscores in the name).
> >
> > We have 3 un-ideal options to choose from:
> >
> >  - accept the slight inconsistency with old families using _, or
> >  - accept the slight annoyance with all languages having to do s/-/_/
> >    when looking up family ID, or
> >  - accept the inconsistency with all name properties in new YAML spec
> >    being separated with - and just the family name always using _.
> >
> > Pick option 1 and rename the rtnl spec files.
> >
> > Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> > Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > ---
> > v2: extend commit msg
> > ---
> >  Documentation/netlink/specs/{rt_addr.yaml => rt-addr.yaml}   | 0
> >  Documentation/netlink/specs/{rt_link.yaml => rt-link.yaml}   | 0
> >  Documentation/netlink/specs/{rt_neigh.yaml => rt-neigh.yaml} | 0
> >  Documentation/netlink/specs/{rt_route.yaml => rt-route.yaml} | 0
> >  Documentation/netlink/specs/{rt_rule.yaml => rt-rule.yaml}   | 0
> >  Documentation/userspace-api/netlink/netlink-raw.rst          | 2 +-
> >  tools/testing/selftests/net/lib/py/ynl.py                    | 4 ++--
> >  7 files changed, 3 insertions(+), 3 deletions(-)
> >  rename Documentation/netlink/specs/{rt_addr.yaml => rt-addr.yaml} (100%)
> >  rename Documentation/netlink/specs/{rt_link.yaml => rt-link.yaml} (100%)
>
> My understanding is that this rename triggers rebuild of the related
> doc, which in turns leads to quite a large number of htmldoc warning,
> but it's really unharmful/pre-existing issue.
>
> /P
>
Jakub Kicinski April 11, 2025, 1:28 a.m. UTC | #3
On Thu, 10 Apr 2025 13:39:17 +0100 Donald Hunter wrote:
> Yes, Documentation/Makefile goes the extra mile to only try deleting a
> list of .rst files generated from the list of source .yaml files. It
> would be easier to just delete
> Documentation/networking/netlink_spec/*.rst which would be able to
> clean up old generated files in situations like this.

Hm, that would work. I think it's only the second time we hit this
problem, tho, so I'm just going to apply and clean up manually.
If it happens again I can change the build script..
diff mbox series

Patch

diff --git a/Documentation/netlink/specs/rt_addr.yaml b/Documentation/netlink/specs/rt-addr.yaml
similarity index 100%
rename from Documentation/netlink/specs/rt_addr.yaml
rename to Documentation/netlink/specs/rt-addr.yaml
diff --git a/Documentation/netlink/specs/rt_link.yaml b/Documentation/netlink/specs/rt-link.yaml
similarity index 100%
rename from Documentation/netlink/specs/rt_link.yaml
rename to Documentation/netlink/specs/rt-link.yaml
diff --git a/Documentation/netlink/specs/rt_neigh.yaml b/Documentation/netlink/specs/rt-neigh.yaml
similarity index 100%
rename from Documentation/netlink/specs/rt_neigh.yaml
rename to Documentation/netlink/specs/rt-neigh.yaml
diff --git a/Documentation/netlink/specs/rt_route.yaml b/Documentation/netlink/specs/rt-route.yaml
similarity index 100%
rename from Documentation/netlink/specs/rt_route.yaml
rename to Documentation/netlink/specs/rt-route.yaml
diff --git a/Documentation/netlink/specs/rt_rule.yaml b/Documentation/netlink/specs/rt-rule.yaml
similarity index 100%
rename from Documentation/netlink/specs/rt_rule.yaml
rename to Documentation/netlink/specs/rt-rule.yaml
diff --git a/Documentation/userspace-api/netlink/netlink-raw.rst b/Documentation/userspace-api/netlink/netlink-raw.rst
index 1990eea772d0..31fc91020eb3 100644
--- a/Documentation/userspace-api/netlink/netlink-raw.rst
+++ b/Documentation/userspace-api/netlink/netlink-raw.rst
@@ -62,7 +62,7 @@  Sub-messages
 ------------
 
 Several raw netlink families such as
-:doc:`rt_link<../../networking/netlink_spec/rt_link>` and
+:doc:`rt-link<../../networking/netlink_spec/rt-link>` and
 :doc:`tc<../../networking/netlink_spec/tc>` use attribute nesting as an
 abstraction to carry module specific information.
 
diff --git a/tools/testing/selftests/net/lib/py/ynl.py b/tools/testing/selftests/net/lib/py/ynl.py
index 8986c584cb37..6329ae805abf 100644
--- a/tools/testing/selftests/net/lib/py/ynl.py
+++ b/tools/testing/selftests/net/lib/py/ynl.py
@@ -39,12 +39,12 @@  from .ksft import ksft_pr, ktap_result
 
 class RtnlFamily(YnlFamily):
     def __init__(self, recv_size=0):
-        super().__init__((SPEC_PATH / Path('rt_link.yaml')).as_posix(),
+        super().__init__((SPEC_PATH / Path('rt-link.yaml')).as_posix(),
                          schema='', recv_size=recv_size)
 
 class RtnlAddrFamily(YnlFamily):
     def __init__(self, recv_size=0):
-        super().__init__((SPEC_PATH / Path('rt_addr.yaml')).as_posix(),
+        super().__init__((SPEC_PATH / Path('rt-addr.yaml')).as_posix(),
                          schema='', recv_size=recv_size)
 
 class NetdevFamily(YnlFamily):