All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net, donald.hunter@gmail.com
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 01/12] netlink: specs: allow header properties for attribute sets
Date: Thu, 17 Apr 2025 19:16:55 -0700	[thread overview]
Message-ID: <20250418021706.1967583-2-kuba@kernel.org> (raw)
In-Reply-To: <20250418021706.1967583-1-kuba@kernel.org>

rt-link has a number of disjoint headers, plus it uses attributes
of other families (e.g. DPLL). Allow declaring a attribute set
as "foreign" by specifying which header its definition is coming
from.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 Documentation/netlink/genetlink-c.yaml      | 3 +++
 Documentation/netlink/genetlink-legacy.yaml | 3 +++
 Documentation/netlink/netlink-raw.yaml      | 3 +++
 tools/net/ynl/pyynl/ynl_gen_c.py            | 2 +-
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml
index 96fa1f1522ed..5a234e9b5fa2 100644
--- a/Documentation/netlink/genetlink-c.yaml
+++ b/Documentation/netlink/genetlink-c.yaml
@@ -148,6 +148,9 @@ additionalProperties: False
         attr-max-name:
           description: The explicit name for last member of attribute enum.
           type: string
+        header:
+          description: For C-compatible languages, header which already defines this attribute set.
+          type: string
         # End genetlink-c
         attributes:
           description: List of attributes in the space.
diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml
index a8c5b521937d..4cbfe666e6f5 100644
--- a/Documentation/netlink/genetlink-legacy.yaml
+++ b/Documentation/netlink/genetlink-legacy.yaml
@@ -193,6 +193,9 @@ additionalProperties: False
         attr-max-name:
           description: The explicit name for last member of attribute enum.
           type: string
+        header:
+          description: For C-compatible languages, header which already defines this attribute set.
+          type: string
         # End genetlink-c
         attributes:
           description: List of attributes in the space.
diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml
index 1b0772c8e333..e34bf23897fa 100644
--- a/Documentation/netlink/netlink-raw.yaml
+++ b/Documentation/netlink/netlink-raw.yaml
@@ -207,6 +207,9 @@ additionalProperties: False
         attr-max-name:
           description: The explicit name for last member of attribute enum.
           type: string
+        header:
+          description: For C-compatible languages, header which already defines this attribute set.
+          type: string
         # End genetlink-c
         attributes:
           description: List of attributes in the space.
diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
index 0d930c17f963..9613a6135003 100755
--- a/tools/net/ynl/pyynl/ynl_gen_c.py
+++ b/tools/net/ynl/pyynl/ynl_gen_c.py
@@ -2909,7 +2909,7 @@ _C_KW = {
             cw.p(f'#include "{hdr_file}"')
             cw.p('#include "ynl.h"')
         headers = []
-    for definition in parsed['definitions']:
+    for definition in parsed['definitions'] + parsed['attribute-sets']:
         if 'header' in definition:
             headers.append(definition['header'])
     if args.mode == 'user':
-- 
2.49.0


  reply	other threads:[~2025-04-18  2:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18  2:16 [PATCH net-next 00/12] netlink: specs: rtnetlink: adjust specs for C codegen Jakub Kicinski
2025-04-18  2:16 ` Jakub Kicinski [this message]
2025-04-18 10:20   ` [PATCH net-next 01/12] netlink: specs: allow header properties for attribute sets Donald Hunter
2025-04-18  2:16 ` [PATCH net-next 02/12] netlink: specs: rt-link: remove the fixed members from attrs Jakub Kicinski
2025-04-18 10:27   ` Donald Hunter
2025-04-18  2:16 ` [PATCH net-next 03/12] netlink: specs: rt-link: remove if-netnsid from attr list Jakub Kicinski
2025-04-18 10:31   ` Donald Hunter
2025-04-18  2:16 ` [PATCH net-next 04/12] netlink: specs: rt-link: remove duplicated group in " Jakub Kicinski
2025-04-18 10:32   ` Donald Hunter
2025-04-18  2:16 ` [PATCH net-next 05/12] netlink: specs: rt-link: add C naming info Jakub Kicinski
2025-04-18 10:36   ` Donald Hunter
2025-04-18  2:17 ` [PATCH net-next 06/12] netlink: specs: rt-link: adjust AF_ nest for C codegen Jakub Kicinski
2025-04-18 10:39   ` Donald Hunter
2025-04-18  2:17 ` [PATCH net-next 07/12] netlink: specs: rt-link: make bond's ipv6 address attribute fixed size Jakub Kicinski
2025-04-18 10:39   ` Donald Hunter
2025-04-18  2:17 ` [PATCH net-next 08/12] netlink: specs: rt-link: add notification for newlink Jakub Kicinski
2025-04-18 10:41   ` Donald Hunter
2025-04-18  2:17 ` [PATCH net-next 09/12] netlink: specs: rt-neigh: add C naming info Jakub Kicinski
2025-04-18 10:42   ` Donald Hunter
2025-04-18  2:17 ` [PATCH net-next 10/12] netlink: specs: rt-neigh: make sure getneigh is consistent Jakub Kicinski
2025-04-18 10:45   ` Donald Hunter
2025-04-18  2:17 ` [PATCH net-next 11/12] netlink: specs: rtnetlink: correct notify properties Jakub Kicinski
2025-04-18 10:46   ` Donald Hunter
2025-04-18  2:17 ` [PATCH net-next 12/12] netlink: specs: rt-rule: add C naming info Jakub Kicinski
2025-04-18 10:46   ` Donald Hunter
2025-04-23 23:20 ` [PATCH net-next 00/12] netlink: specs: rtnetlink: adjust specs for C codegen patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250418021706.1967583-2-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.