Skip to contentSkip to conversation

tools: ynl: generate code for the devlink family

PATCH Applied Jakub Kicinski 3 participants 16 messages Jun 7, 2023 – Jun 9, 2023

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover tools: ynl: generate code for the devlink family

Another chunk of changes to support more capabilities in the YNL code gen. Devlink brings in deep nesting and directional messages (requests and responses have different IDs). We need a healthy dose of codegen changes to support those (I wasn't planning to support code gen for "directional" families initially, but the importance of devlink and ethtool is undeniable).

I have 1 more series like this (ethtool support).

Jakub Kicinski (11):
netlink: specs: devlink: fill in some details important for C
tools: ynl-gen: use enum names in op strmap more carefully
tools: ynl-gen: refactor strmap helper generation
tools: ynl-gen: enable code gen for directional specs
tools: ynl-gen: try to sort the types more intelligently
tools: ynl-gen: inherit struct use info
tools: ynl-gen: walk nested types in depth
tools: ynl-gen: don't generate forward declarations for policies
tools: ynl-gen: don't generate forward declarations for policies -
regen
tools: ynl: generate code for the devlink family
tools: ynl: add sample for devlink

 Documentation/netlink/specs/devlink.yaml |   8 +
 tools/net/ynl/generated/Makefile         |   2 +-
 tools/net/ynl/generated/devlink-user.c   | 721 +++++++++++++++++++++++
 tools/net/ynl/generated/devlink-user.h   | 210 +++++++
 tools/net/ynl/generated/fou-user.c       |   3 -
 tools/net/ynl/generated/handshake-user.c |   4 -
 tools/net/ynl/generated/netdev-user.c    |   2 -
 tools/net/ynl/lib/nlspec.py              |  11 +-
 tools/net/ynl/samples/.gitignore         |   1 +
 tools/net/ynl/samples/devlink.c          |  60 ++
 tools/net/ynl/ynl-gen-c.py               | 137 +++--
 11 files changed, 1101 insertions(+), 58 deletions(-)
 create mode 100644 tools/net/ynl/generated/devlink-user.c
 create mode 100644 tools/net/ynl/generated/devlink-user.h
 create mode 100644 tools/net/ynl/samples/devlink.c
Signature · 1 line
2.40.1
author maintainer
#1 lore raw

PATCH 1/11 netlink: specs: devlink: fill in some details important for C

Python YNL is much more forgiving than the C code gen in terms of the spec completeness. Fill in a handful of devlink details to make the spec usable in C.

---
 Documentation/netlink/specs/devlink.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)
Documentation/netlink/specs/devlink.yaml +8 -0
index 90641668232e..5d46ca966979 100644
@@ -9,6 +9,7 @@ doc: Partial family for Devlink.
 attribute-sets:
   -
     name: devlink
+    name-prefix: devlink-attr-
     attributes:
       -
         name: bus-name
@@ -95,10 +96,12 @@ doc: Partial family for Devlink.
       -
         name: reload-action-info
         type: nest
+        multi-attr: true
         nested-attributes: dl-reload-act-info
       -
         name: reload-action-stats
         type: nest
+        multi-attr: true
         nested-attributes: dl-reload-act-stats
   -
     name: dl-dev-stats
@@ -196,3 +199,8 @@ doc: Partial family for Devlink.
           attributes:
             - bus-name
             - dev-name
+            - info-driver-name
+            - info-serial-number
+            - info-version-fixed
+            - info-version-running
+            - info-version-stored
Signature · 1 line
2.40.1
author maintainer
#2 lore raw

PATCH 2/11 tools: ynl-gen: use enum names in op strmap more carefully

In reply to Jakub Kicinski

In preparation for supporting families which use different msg ids to and from the kernel - make sure the ids in op strmap are correct. The map is expected to be used mostly for notifications, don't generate a separate map for the "to kernel" direction.

---
 tools/net/ynl/generated/fou-user.c | 1 -
 tools/net/ynl/lib/nlspec.py        | 4 ++++
 tools/net/ynl/ynl-gen-c.py         | 6 +++++-
 3 files changed, 9 insertions(+), 2 deletions(-)
tools/net/ynl/generated/fou-user.c +0 -1
index c99b5d438021..a0f33bb882e4 100644
@@ -16,7 +16,6 @@
 
 /* Enums */
 static const char * const fou_op_strmap[] = {
-	[FOU_CMD_UNSPEC] = "unspec",
 	[FOU_CMD_ADD] = "add",
 	[FOU_CMD_DEL] = "del",
 	[FOU_CMD_GET] = "get",
tools/net/ynl/lib/nlspec.py +4 -0
index ada22b073aa2..bd5da8aaeac7 100644
@@ -442,6 +442,10 @@ jsonschema = None
             else:
                 raise Exception("Can't parse directional ops")
 
+            if req_val == req_val_next:
+                req_val = None
+            if rsp_val == rsp_val_next:
+                rsp_val = None
             op = self.new_operation(elem, req_val, rsp_val)
             req_val = req_val_next
             rsp_val = rsp_val_next
tools/net/ynl/ynl-gen-c.py +5 -1
index c07340715601..8a0abf9048db 100755
@@ -1220,7 +1220,11 @@ _C_KW = {
     map_name = f'{family.name}_op_strmap'
     cw.block_start(line=f"static const char * const {map_name}[] =")
     for op_name, op in family.msgs.items():
-        cw.p(f'[{op.enum_name}] = "{op_name}",')
+        if op.rsp_value:
+            if op.req_value == op.rsp_value:
+                cw.p(f'[{op.enum_name}] = "{op_name}",')
+            else:
+                cw.p(f'[{op.rsp_value}] = "{op_name}",')
     cw.block_end(line=';')
     cw.nl()
 
Signature · 1 line
2.40.1
author maintainer
#3 lore raw

PATCH 3/11 tools: ynl-gen: refactor strmap helper generation

In reply to Jakub Kicinski

Move generating strmap lookup function to a helper. No functional changes.

---
 tools/net/ynl/ynl-gen-c.py | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
tools/net/ynl/ynl-gen-c.py +17 -19
index 8a0abf9048db..efcf91675dfa 100755
@@ -1212,6 +1212,21 @@ _C_KW = {
     cw.nl()
 
 
+def _put_enum_to_str_helper(cw, render_name, map_name, arg_name, enum=None):
+    args = [f'int {arg_name}']
+    if enum and not ('enum-name' in enum and not enum['enum-name']):
+        args = [f'enum {render_name} {arg_name}']
+    cw.write_func_prot('const char *', f'{render_name}_str', args)
+    cw.block_start()
+    if enum and enum.type == 'flags':
+        cw.p(f'{arg_name} = ffs({arg_name}) - 1;')
+    cw.p(f'if ({arg_name} < 0 || {arg_name} >= (int)MNL_ARRAY_SIZE({map_name}))')
+    cw.p('return NULL;')
+    cw.p(f'return {map_name}[{arg_name}];')
+    cw.block_end()
+    cw.nl()
+
+
 def put_op_name_fwd(family, cw):
     cw.write_func_prot('const char *', f'{family.name}_op_str', ['int op'], suffix=';')
 
@@ -1228,13 +1243,7 @@ _C_KW = {
     cw.block_end(line=';')
     cw.nl()
 
-    cw.write_func_prot('const char *', f'{family.name}_op_str', ['int op'])
-    cw.block_start()
-    cw.p(f'if (op < 0 || op >= (int)MNL_ARRAY_SIZE({map_name}))')
-    cw.p('return NULL;')
-    cw.p(f'return {map_name}[op];')
-    cw.block_end()
-    cw.nl()
+    _put_enum_to_str_helper(cw, family.name + '_op', map_name, 'op')
 
 
 def put_enum_to_str_fwd(family, cw, enum):
@@ -1252,18 +1261,7 @@ _C_KW = {
     cw.block_end(line=';')
     cw.nl()
 
-    args = [f'enum {enum.render_name} value']
-    if 'enum-name' in enum and not enum['enum-name']:
-        args = ['int value']
-    cw.write_func_prot('const char *', f'{enum.render_name}_str', args)
-    cw.block_start()
-    if enum.type == 'flags':
-        cw.p('value = ffs(value) - 1;')
-    cw.p(f'if (value < 0 || value >= (int)MNL_ARRAY_SIZE({map_name}))')
-    cw.p('return NULL;')
-    cw.p(f'return {map_name}[value];')
-    cw.block_end()
-    cw.nl()
+    _put_enum_to_str_helper(cw, enum.render_name, map_name, 'value', enum=enum)
 
 
 def put_req_nested(ri, struct):
Signature · 1 line
2.40.1
author maintainer
#4 lore raw

PATCH 4/11 tools: ynl-gen: enable code gen for directional specs

In reply to Jakub Kicinski

I think that user space code gen for directional specs works after recent changes. Let them through.

---
 tools/net/ynl/lib/nlspec.py |  7 ++++---
 tools/net/ynl/ynl-gen-c.py  | 10 +++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)
tools/net/ynl/lib/nlspec.py +4 -3
index bd5da8aaeac7..9f7ad87d69af 100644
@@ -324,6 +324,7 @@ jsonschema = None
 
     Attributes:
         proto     protocol type (e.g. genetlink)
+        msg_id_model   enum-model for operations (unified, directional etc.)
         license   spec license (loaded from an SPDX tag on the spec)
 
         attr_sets  dict of attribute sets
@@ -349,6 +350,7 @@ jsonschema = None
         super().__init__(self, spec)
 
         self.proto = self.yaml.get('protocol', 'genetlink')
+        self.msg_id_model = self.yaml['operations'].get('enum-model', 'unified')
 
         if schema_path is None:
             schema_path = os.path.dirname(os.path.dirname(spec_path)) + f'/{self.proto}.yaml'
@@ -477,10 +479,9 @@ jsonschema = None
             attr_set = self.new_attr_set(elem)
             self.attr_sets[elem['name']] = attr_set
 
-        msg_id_model = self.yaml['operations'].get('enum-model', 'unified')
-        if msg_id_model == 'unified':
+        if self.msg_id_model == 'unified':
             self._dictify_ops_unified()
-        elif msg_id_model == 'directional':
+        elif self.msg_id_model == 'directional':
             self._dictify_ops_directional()
 
         for op in self.msgs.values():
tools/net/ynl/ynl-gen-c.py +7 -3
index efcf91675dfa..7b3e79e17c01 100755
@@ -709,9 +709,6 @@ from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, S
     def __init__(self, family, yaml, req_value, rsp_value):
         super().__init__(family, yaml, req_value, rsp_value)
 
-        if req_value != rsp_value:
-            raise Exception("Directional messages not supported by codegen")
-
         self.render_name = family.name + '_' + c_lower(self.name)
 
         self.dual_policy = ('do' in yaml and 'request' in yaml['do']) and \
@@ -2243,6 +2240,13 @@ _C_KW = {
         os.sys.exit(1)
         return
 
+    supported_models = ['unified']
+    if args.mode == 'user':
+        supported_models += ['directional']
+    if parsed.msg_id_model not in supported_models:
+        print(f'Message enum-model {parsed.msg_id_model} not supported for {args.mode} generation')
+        os.sys.exit(1)
+
     cw = CodeWriter(BaseNlLib(), out_file)
 
     _, spec_kernel = find_kernel_root(args.spec)
Signature · 1 line
2.40.1
author maintainer
#5 lore raw

PATCH 5/11 tools: ynl-gen: try to sort the types more intelligently

In reply to Jakub Kicinski

We need to sort the structures to avoid the need for forward declarations. While at it remove the sort of structs when rendering, it doesn't do anything.

---
 tools/net/ynl/ynl-gen-c.py | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
tools/net/ynl/ynl-gen-c.py +24 -2
index 7b3e79e17c01..d9c74a678df8 100755
@@ -875,6 +875,28 @@ from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, S
                         inherit.add('idx')
                     self.pure_nested_structs[nested].set_inherited(inherit)
 
+        # Try to reorder according to dependencies
+        pns_key_list = list(self.pure_nested_structs.keys())
+        pns_key_seen = set()
+        rounds = len(pns_key_list)**2  # it's basically bubble sort
+        for _ in range(rounds):
+            if len(pns_key_list) == 0:
+                break
+            name = pns_key_list.pop(0)
+            finished = True
+            for _, spec in self.attr_sets[name].items():
+                if 'nested-attributes' in spec:
+                    if spec['nested-attributes'] not in pns_key_seen:
+                        # Dicts are sorted, this will make struct last
+                        struct = self.pure_nested_structs.pop(name)
+                        self.pure_nested_structs[name] = struct
+                        finished = False
+                        break
+            if finished:
+                pns_key_seen.add(name)
+            else:
+                pns_key_list.append(name)
+
     def _load_all_notify(self):
         for op_name, op in self.ops.items():
             if not op:
@@ -2379,7 +2401,7 @@ _C_KW = {
             cw.nl()
 
             cw.p('/* Common nested types */')
-            for attr_set, struct in sorted(parsed.pure_nested_structs.items()):
+            for attr_set, struct in parsed.pure_nested_structs.items():
                 ri = RenderInfo(cw, parsed, args.mode, "", "", "", attr_set)
                 print_type_full(ri, struct)
 
@@ -2448,7 +2470,7 @@ _C_KW = {
                 put_typol(cw, struct)
 
             cw.p('/* Common nested types */')
-            for attr_set, struct in sorted(parsed.pure_nested_structs.items()):
+            for attr_set, struct in parsed.pure_nested_structs.items():
                 ri = RenderInfo(cw, parsed, args.mode, "", "", "", attr_set)
 
                 free_rsp_nested(ri, struct)
Signature · 1 line
2.40.1
author maintainer
#6 lore raw

PATCH 6/11 tools: ynl-gen: inherit struct use info

In reply to Jakub Kicinski

We only render parse and netlink generation helpers as needed, to avoid generating dead code. Propagate the information from first- and second-layer attribute sets onto all children. Otherwise devlink won't work, it has a lot more levels of nesting.

---
 tools/net/ynl/ynl-gen-c.py | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/net/ynl/ynl-gen-c.py +8 -0
index d9c74a678df8..1a97cd517116 100755
@@ -896,6 +896,14 @@ from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, S
                 pns_key_seen.add(name)
             else:
                 pns_key_list.append(name)
+        # Propagate the request / reply
+        for attr_set, struct in reversed(self.pure_nested_structs.items()):
+            for _, spec in self.attr_sets[attr_set].items():
+                if 'nested-attributes' in spec:
+                    child = self.pure_nested_structs.get(spec['nested-attributes'])
+                    if child:
+                        child.request |= struct.request
+                        child.reply |= struct.reply
 
     def _load_all_notify(self):
         for op_name, op in self.ops.items():
Signature · 1 line
2.40.1
author maintainer
#7 lore raw

PATCH 7/11 tools: ynl-gen: walk nested types in depth

In reply to Jakub Kicinski

So far we had only created structures for nested types nested directly in messages (second level of attrs so to speak). Walk types in depth to support deeper nesting.

---
 tools/net/ynl/ynl-gen-c.py | 41 +++++++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 12 deletions(-)
tools/net/ynl/ynl-gen-c.py +29 -12
index 1a97cd517116..0cb0f74e714b 100755
@@ -854,27 +854,44 @@ from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, S
                 self.root_sets[op['attribute-set']]['reply'].update(rsp_attrs)
 
     def _load_nested_sets(self):
+        attr_set_queue = list(self.root_sets.keys())
+        attr_set_seen = set(self.root_sets.keys())
+
+        while len(attr_set_queue):
+            a_set = attr_set_queue.pop(0)
+            for attr, spec in self.attr_sets[a_set].items():
+                if 'nested-attributes' not in spec:
+                    continue
+
+                nested = spec['nested-attributes']
+                if nested not in attr_set_seen:
+                    attr_set_queue.append(nested)
+                    attr_set_seen.add(nested)
+
+                inherit = set()
+                if nested not in self.root_sets:
+                    if nested not in self.pure_nested_structs:
+                        self.pure_nested_structs[nested] = Struct(self, nested, inherited=inherit)
+                else:
+                    raise Exception(f'Using attr set as root and nested not supported - {nested}')
+
+                if 'type-value' in spec:
+                    if nested in self.root_sets:
+                        raise Exception("Inheriting members to a space used as root not supported")
+                    inherit.update(set(spec['type-value']))
+                elif spec['type'] == 'array-nest':
+                    inherit.add('idx')
+                self.pure_nested_structs[nested].set_inherited(inherit)
+
         for root_set, rs_members in self.root_sets.items():
             for attr, spec in self.attr_sets[root_set].items():
                 if 'nested-attributes' in spec:
-                    inherit = set()
                     nested = spec['nested-attributes']
-                    if nested not in self.root_sets:
-                        if nested not in self.pure_nested_structs:
-                            self.pure_nested_structs[nested] = Struct(self, nested, inherited=inherit)
                     if attr in rs_members['request']:
                         self.pure_nested_structs[nested].request = True
                     if attr in rs_members['reply']:
                         self.pure_nested_structs[nested].reply = True
 
-                    if 'type-value' in spec:
-                        if nested in self.root_sets:
-                            raise Exception("Inheriting members to a space used as root not supported")
-                        inherit.update(set(spec['type-value']))
-                    elif spec['type'] == 'array-nest':
-                        inherit.add('idx')
-                    self.pure_nested_structs[nested].set_inherited(inherit)
-
         # Try to reorder according to dependencies
         pns_key_list = list(self.pure_nested_structs.keys())
         pns_key_seen = set()
Signature · 1 line
2.40.1
author maintainer
#8 lore raw

PATCH 8/11 tools: ynl-gen: don't generate forward declarations for policies

In reply to Jakub Kicinski

Now that all nested types have structs and are sorted topologically there should be no need to generate forward declarations for policies.

---
 tools/net/ynl/ynl-gen-c.py | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
tools/net/ynl/ynl-gen-c.py +3 -9
index 0cb0f74e714b..251c5bfffd8d 100755
@@ -1235,10 +1235,6 @@ _C_KW = {
     print_prototype(ri, "request")
 
 
-def put_typol_fwd(cw, struct):
-    cw.p(f'extern struct ynl_policy_nest {struct.render_name}_nest;')
-
-
 def put_typol(cw, struct):
     type_max = struct.attr_set.max_name
     cw.block_start(line=f'struct ynl_policy_attr {struct.render_name}_policy[{type_max} + 1] =')
@@ -2485,12 +2481,10 @@ _C_KW = {
             cw.nl()
 
             cw.p('/* Policies */')
-            for name, _ in parsed.attr_sets.items():
+            for name in parsed.pure_nested_structs:
                 struct = Struct(parsed, name)
-                put_typol_fwd(cw, struct)
-            cw.nl()
-
-            for name, _ in parsed.attr_sets.items():
+                put_typol(cw, struct)
+            for name in parsed.root_sets:
                 struct = Struct(parsed, name)
                 put_typol(cw, struct)
 
Signature · 1 line
2.40.1
author maintainer
#9 lore raw

PATCH 9/11 tools: ynl-gen: don't generate forward declarations for policies - regen

In reply to Jakub Kicinski

Renegerate code after dropping forward declarations for policies.

---
 tools/net/ynl/generated/fou-user.c       | 2 --
 tools/net/ynl/generated/handshake-user.c | 4 ----
 tools/net/ynl/generated/netdev-user.c    | 2 --
 3 files changed, 8 deletions(-)
tools/net/ynl/generated/fou-user.c +0 -2
index a0f33bb882e4..c08c85a6b6c4 100644
@@ -42,8 +42,6 @@ const char *fou_encap_type_str(int value)
 }
 
 /* Policies */
-extern struct ynl_policy_nest fou_nest;
-
 struct ynl_policy_attr fou_policy[FOU_ATTR_MAX + 1] = {
 	[FOU_ATTR_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, },
 	[FOU_ATTR_PORT] = { .name = "port", .type = YNL_PT_U16, },
tools/net/ynl/generated/handshake-user.c +0 -4
index fe99c4ef7373..72eb1c52a8fc 100644
@@ -69,10 +69,6 @@ const char *handshake_auth_str(enum handshake_auth value)
 }
 
 /* Policies */
-extern struct ynl_policy_nest handshake_x509_nest;
-extern struct ynl_policy_nest handshake_accept_nest;
-extern struct ynl_policy_nest handshake_done_nest;
-
 struct ynl_policy_attr handshake_x509_policy[HANDSHAKE_A_X509_MAX + 1] = {
 	[HANDSHAKE_A_X509_CERT] = { .name = "cert", .type = YNL_PT_U32, },
 	[HANDSHAKE_A_X509_PRIVKEY] = { .name = "privkey", .type = YNL_PT_U32, },
tools/net/ynl/generated/netdev-user.c +0 -2
index aea5c7cc8ead..3db6921b9fab 100644
@@ -48,8 +48,6 @@ const char *netdev_xdp_act_str(enum netdev_xdp_act value)
 }
 
 /* Policies */
-extern struct ynl_policy_nest netdev_dev_nest;
-
 struct ynl_policy_attr netdev_dev_policy[NETDEV_A_DEV_MAX + 1] = {
 	[NETDEV_A_DEV_IFINDEX] = { .name = "ifindex", .type = YNL_PT_U32, },
 	[NETDEV_A_DEV_PAD] = { .name = "pad", .type = YNL_PT_IGNORE, },
Signature · 1 line
2.40.1
author maintainer
#10 lore raw

PATCH 10/11 tools: ynl: generate code for the devlink family

In reply to Jakub Kicinski

Admittedly the devlink.yaml spec is fairly limitted, it only covers basic device get and info-get ops. That's sufficient to be useful (monitoring FW versions in the fleet). Plus it gives us a chance to exercise deep nesting and directional messaging in YNL.

---
 tools/net/ynl/generated/Makefile       |   2 +-
 tools/net/ynl/generated/devlink-user.c | 721 +++++++++++++++++++++++++
 tools/net/ynl/generated/devlink-user.h | 210 +++++++
 3 files changed, 932 insertions(+), 1 deletion(-)
 create mode 100644 tools/net/ynl/generated/devlink-user.c
 create mode 100644 tools/net/ynl/generated/devlink-user.h
tools/net/ynl/generated/Makefile +1 -1
index 916723193b60..8ce610910b8d 100644
@@ -9,7 +9,7 @@ endif
 
 TOOL:=../ynl-gen-c.py
 
-GENS:=handshake fou netdev
+GENS:=devlink handshake fou netdev
 SRCS=$(patsubst %,%-user.c,${GENS})
 HDRS=$(patsubst %,%-user.h,${GENS})
 OBJS=$(patsubst %,%-user.o,${GENS})
tools/net/ynl/generated/devlink-user.c new file +721 -0

721 lines not on this page · raw message

tools/net/ynl/generated/devlink-user.h new file +210 -0

210 lines not on this page · raw message

Signature · 1 line
2.40.1
author maintainer
#14 lore raw

PATCH 11/11 tools: ynl: add sample for devlink

In reply to Jakub Kicinski

Add a sample to show off how to issue basic devlink requests. For added testing issue get requests while walking a dump.

$ ./devlink
netdevsim/netdevsim1:
    driver: netdevsim
    running fw:
        fw.mgmt: 10.20.30
    ...
netdevsim/netdevsim2:
    driver: netdevsim
    running fw:
        fw.mgmt: 10.20.30
    ...
---
 tools/net/ynl/samples/.gitignore |  1 +
 tools/net/ynl/samples/devlink.c  | 60 ++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 tools/net/ynl/samples/devlink.c
tools/net/ynl/samples/.gitignore +1 -0
index 7b1f5179cb54..a24678b67557 100644
@@ -1 +1,2 @@
+devlink
 netdev
tools/net/ynl/samples/devlink.c new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.40.1
#11 lore raw
In reply to Jakub Kicinski
Quoted 1 line · Jakub Kicinski

Admittedly the devlink.yaml spec is fairly limitted,

nit: limitted -> limited

Quoted 6 lines

it only covers basic device get and info-get ops. That's sufficient to be useful (monitoring FW versions in the fleet). Plus it gives us a chance to exercise deep nesting and directional messaging in YNL.

...

author maintainer
#12 lore raw
Quoted 4 lines · On Thu, 8 Jun 2023 13:48:49 +0200 Simon Horman wrote:
Quoted 1 line · Jakub Kicinski

Admittedly the devlink.yaml spec is fairly limitted,

nit: limitted -> limited

I'll fix when applying if that's okay (assuming it's the only comment).

#15 lore raw
In reply to Jakub Kicinski
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 7 Jun 2023 13:23:52 -0700 you wrote:

Another chunk of changes to support more capabilities in the YNL code gen. Devlink brings in deep nesting and directional messages (requests and responses have different IDs). We need a healthy dose of codegen changes to support those (I wasn't planning to support code gen for "directional" families initially, but the importance of devlink and ethtool is undeniable).

[...]

Here is the summary with links:
- [net-next,01/11] netlink: specs: devlink: fill in some details important for C

    https://git.kernel.org/netdev/net-next/c/8947e5037371
  - [net-next,02/11] tools: ynl-gen: use enum names in op strmap more carefully
    https://git.kernel.org/netdev/net-next/c/9858bfc271de
  - [net-next,03/11] tools: ynl-gen: refactor strmap helper generation
    https://git.kernel.org/netdev/net-next/c/6f115d4575ab
  - [net-next,04/11] tools: ynl-gen: enable code gen for directional specs
    https://git.kernel.org/netdev/net-next/c/ff6db4b58c93
  - [net-next,05/11] tools: ynl-gen: try to sort the types more intelligently
    https://git.kernel.org/netdev/net-next/c/6afaa0ef9b0e
  - [net-next,06/11] tools: ynl-gen: inherit struct use info
    https://git.kernel.org/netdev/net-next/c/37487f93b125
  - [net-next,07/11] tools: ynl-gen: walk nested types in depth
    https://git.kernel.org/netdev/net-next/c/eae7af21bdb9
  - [net-next,08/11] tools: ynl-gen: don't generate forward declarations for policies
    https://git.kernel.org/netdev/net-next/c/168dea20ecef
  - [net-next,09/11] tools: ynl-gen: don't generate forward declarations for policies - regen
    https://git.kernel.org/netdev/net-next/c/0a9471219672
  - [net-next,10/11] tools: ynl: generate code for the devlink family
    https://git.kernel.org/netdev/net-next/c/5d1a30eb989a
  - [net-next,11/11] tools: ynl: add sample for devlink
    https://git.kernel.org/netdev/net-next/c/fff8660b5425

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#13 lore raw
In reply to Jakub Kicinski
Quoted 7 lines · Jakub Kicinski
Quoted 4 lines · On Thu, 8 Jun 2023 13:48:49 +0200 Simon Horman wrote:
Quoted 1 line · Jakub Kicinski

Admittedly the devlink.yaml spec is fairly limitted,

nit: limitted -> limited

I'll fix when applying if that's okay (assuming it's the only comment).

Sure, that is fine by me.
I don't think I have any further comments on this series.