Commit 392c108b authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'tools-ynl-generate-code-for-the-devlink-family'

Jakub Kicinski says:

====================
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).
====================

Link: https://lore.kernel.org/r/20230607202403.1089925-1-kuba@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 449f6bc1 fff8660b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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 @@ attribute-sets:
      -
        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 @@ operations:
          attributes:
            - bus-name
            - dev-name
            - info-driver-name
            - info-serial-number
            - info-version-fixed
            - info-version-running
            - info-version-stored
+1 −1
Original line number Diff line number Diff line
@@ -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})
+721 −0

File added.

Preview size limit exceeded, changes collapsed.

+210 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −3
Original line number Diff line number Diff line
@@ -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",
@@ -43,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, },
Loading