Commit 34493336 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski
Browse files

netlink: specs: devlink: extend per-instance dump commands to accept instance attributes



Extend per-instance dump command definitions to accept instance
attributes. Allow parsing of devlink handle attributes so they could
be used for instance selection.

Re-generate the related code.

Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230811155714.1736405-12-jiri@resnulli.us


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4a1b5aa8
Loading
Loading
Loading
Loading
+26 −13
Original line number Diff line number Diff line
@@ -284,7 +284,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit-port
@@ -299,6 +298,8 @@ operations:
          value: 7
          attributes: *port-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply:
          value: 3  # due to a bug, port dump returns DEVLINK_CMD_NEW
          attributes: *port-id-attrs
@@ -311,7 +312,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -326,6 +326,8 @@ operations:
          value: 11
          attributes: *sb-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *sb-get-reply

      # TODO: fill in the operations in between
@@ -336,7 +338,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -352,6 +353,8 @@ operations:
          value: 15
          attributes: *sb-pool-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *sb-pool-get-reply

      # TODO: fill in the operations in between
@@ -362,7 +365,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit-port
@@ -379,6 +381,8 @@ operations:
          value: 19
          attributes: *sb-port-pool-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *sb-port-pool-get-reply

      # TODO: fill in the operations in between
@@ -389,7 +393,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit-port
@@ -407,6 +410,8 @@ operations:
          value: 23
          attributes: *sb-tc-pool-bind-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *sb-tc-pool-bind-get-reply

      # TODO: fill in the operations in between
@@ -417,7 +422,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -432,6 +436,8 @@ operations:
          value: 38
          attributes: *param-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *param-get-reply

      # TODO: fill in the operations in between
@@ -442,7 +448,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit-port-optional
@@ -458,6 +463,8 @@ operations:
          value: 42
          attributes: *region-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *region-get-reply

      # TODO: fill in the operations in between
@@ -495,7 +502,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit-port-optional
@@ -509,6 +515,8 @@ operations:
        reply: &health-reporter-get-reply
          attributes: *health-reporter-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *health-reporter-get-reply

      # TODO: fill in the operations in between
@@ -519,7 +527,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -534,6 +541,8 @@ operations:
          value: 61
          attributes: *trap-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *trap-get-reply

      # TODO: fill in the operations in between
@@ -544,7 +553,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -559,6 +567,8 @@ operations:
          value: 65
          attributes: *trap-group-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *trap-group-get-reply

      # TODO: fill in the operations in between
@@ -569,7 +579,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -584,6 +593,8 @@ operations:
          value: 69
          attributes: *trap-policer-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *trap-policer-get-reply

      # TODO: fill in the operations in between
@@ -594,7 +605,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -610,6 +620,8 @@ operations:
          value: 74
          attributes: *rate-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *rate-get-reply

      # TODO: fill in the operations in between
@@ -620,7 +632,6 @@ operations:
      attribute-set: devlink
      dont-validate:
        - strict
        - dump

      do:
        pre: devlink-nl-pre-doit
@@ -635,6 +646,8 @@ operations:
          value: 78
          attributes: *linecard-id-attrs
      dump:
        request:
          attributes: *dev-id-attrs
        reply: *linecard-get-reply

      # TODO: fill in the operations in between
+130 −39
Original line number Diff line number Diff line
@@ -17,29 +17,47 @@ static const struct nla_policy devlink_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1]
};

/* DEVLINK_CMD_PORT_GET - do */
static const struct nla_policy devlink_port_get_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = {
static const struct nla_policy devlink_port_get_do_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
};

/* DEVLINK_CMD_PORT_GET - dump */
static const struct nla_policy devlink_port_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_SB_GET - do */
static const struct nla_policy devlink_sb_get_nl_policy[DEVLINK_ATTR_SB_INDEX + 1] = {
static const struct nla_policy devlink_sb_get_do_nl_policy[DEVLINK_ATTR_SB_INDEX + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, },
};

/* DEVLINK_CMD_SB_GET - dump */
static const struct nla_policy devlink_sb_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_SB_POOL_GET - do */
static const struct nla_policy devlink_sb_pool_get_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = {
static const struct nla_policy devlink_sb_pool_get_do_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, },
	[DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, },
};

/* DEVLINK_CMD_SB_POOL_GET - dump */
static const struct nla_policy devlink_sb_pool_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_SB_PORT_POOL_GET - do */
static const struct nla_policy devlink_sb_port_pool_get_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = {
static const struct nla_policy devlink_sb_port_pool_get_do_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
@@ -47,8 +65,14 @@ static const struct nla_policy devlink_sb_port_pool_get_nl_policy[DEVLINK_ATTR_S
	[DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, },
};

/* DEVLINK_CMD_SB_PORT_POOL_GET - dump */
static const struct nla_policy devlink_sb_port_pool_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_SB_TC_POOL_BIND_GET - do */
static const struct nla_policy devlink_sb_tc_pool_bind_get_nl_policy[DEVLINK_ATTR_SB_TC_INDEX + 1] = {
static const struct nla_policy devlink_sb_tc_pool_bind_get_do_nl_policy[DEVLINK_ATTR_SB_TC_INDEX + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
@@ -57,21 +81,39 @@ static const struct nla_policy devlink_sb_tc_pool_bind_get_nl_policy[DEVLINK_ATT
	[DEVLINK_ATTR_SB_TC_INDEX] = { .type = NLA_U16, },
};

/* DEVLINK_CMD_SB_TC_POOL_BIND_GET - dump */
static const struct nla_policy devlink_sb_tc_pool_bind_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_PARAM_GET - do */
static const struct nla_policy devlink_param_get_nl_policy[DEVLINK_ATTR_PARAM_NAME + 1] = {
static const struct nla_policy devlink_param_get_do_nl_policy[DEVLINK_ATTR_PARAM_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_PARAM_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_PARAM_GET - dump */
static const struct nla_policy devlink_param_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_REGION_GET - do */
static const struct nla_policy devlink_region_get_nl_policy[DEVLINK_ATTR_REGION_NAME + 1] = {
static const struct nla_policy devlink_region_get_do_nl_policy[DEVLINK_ATTR_REGION_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
	[DEVLINK_ATTR_REGION_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_REGION_GET - dump */
static const struct nla_policy devlink_region_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_INFO_GET - do */
static const struct nla_policy devlink_info_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
@@ -79,49 +121,85 @@ static const struct nla_policy devlink_info_get_nl_policy[DEVLINK_ATTR_DEV_NAME
};

/* DEVLINK_CMD_HEALTH_REPORTER_GET - do */
static const struct nla_policy devlink_health_reporter_get_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = {
static const struct nla_policy devlink_health_reporter_get_do_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
	[DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_HEALTH_REPORTER_GET - dump */
static const struct nla_policy devlink_health_reporter_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_TRAP_GET - do */
static const struct nla_policy devlink_trap_get_nl_policy[DEVLINK_ATTR_TRAP_NAME + 1] = {
static const struct nla_policy devlink_trap_get_do_nl_policy[DEVLINK_ATTR_TRAP_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_TRAP_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_TRAP_GET - dump */
static const struct nla_policy devlink_trap_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_TRAP_GROUP_GET - do */
static const struct nla_policy devlink_trap_group_get_nl_policy[DEVLINK_ATTR_TRAP_GROUP_NAME + 1] = {
static const struct nla_policy devlink_trap_group_get_do_nl_policy[DEVLINK_ATTR_TRAP_GROUP_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_TRAP_GROUP_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_TRAP_GROUP_GET - dump */
static const struct nla_policy devlink_trap_group_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_TRAP_POLICER_GET - do */
static const struct nla_policy devlink_trap_policer_get_nl_policy[DEVLINK_ATTR_TRAP_POLICER_ID + 1] = {
static const struct nla_policy devlink_trap_policer_get_do_nl_policy[DEVLINK_ATTR_TRAP_POLICER_ID + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_TRAP_POLICER_ID] = { .type = NLA_U32, },
};

/* DEVLINK_CMD_TRAP_POLICER_GET - dump */
static const struct nla_policy devlink_trap_policer_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_RATE_GET - do */
static const struct nla_policy devlink_rate_get_nl_policy[DEVLINK_ATTR_RATE_NODE_NAME + 1] = {
static const struct nla_policy devlink_rate_get_do_nl_policy[DEVLINK_ATTR_RATE_NODE_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
	[DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_RATE_GET - dump */
static const struct nla_policy devlink_rate_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_LINECARD_GET - do */
static const struct nla_policy devlink_linecard_get_nl_policy[DEVLINK_ATTR_LINECARD_INDEX + 1] = {
static const struct nla_policy devlink_linecard_get_do_nl_policy[DEVLINK_ATTR_LINECARD_INDEX + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_LINECARD_INDEX] = { .type = NLA_U32, },
};

/* DEVLINK_CMD_LINECARD_GET - dump */
static const struct nla_policy devlink_linecard_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
};

/* DEVLINK_CMD_SELFTESTS_GET - do */
static const struct nla_policy devlink_selftests_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
@@ -152,14 +230,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit_port,
		.doit		= devlink_nl_port_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_port_get_nl_policy,
		.policy		= devlink_port_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_PORT_INDEX,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_PORT_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_port_get_dumpit,
		.policy		= devlink_port_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -168,14 +247,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_sb_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_sb_get_nl_policy,
		.policy		= devlink_sb_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_SB_INDEX,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_SB_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_sb_get_dumpit,
		.policy		= devlink_sb_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -184,14 +264,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_sb_pool_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_sb_pool_get_nl_policy,
		.policy		= devlink_sb_pool_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_SB_POOL_INDEX,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_SB_POOL_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_sb_pool_get_dumpit,
		.policy		= devlink_sb_pool_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -200,14 +281,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit_port,
		.doit		= devlink_nl_sb_port_pool_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_sb_port_pool_get_nl_policy,
		.policy		= devlink_sb_port_pool_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_SB_POOL_INDEX,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_SB_PORT_POOL_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_sb_port_pool_get_dumpit,
		.policy		= devlink_sb_port_pool_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -216,14 +298,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit_port,
		.doit		= devlink_nl_sb_tc_pool_bind_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_sb_tc_pool_bind_get_nl_policy,
		.policy		= devlink_sb_tc_pool_bind_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_SB_TC_INDEX,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_SB_TC_POOL_BIND_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_sb_tc_pool_bind_get_dumpit,
		.policy		= devlink_sb_tc_pool_bind_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -232,14 +315,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_param_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_param_get_nl_policy,
		.policy		= devlink_param_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_PARAM_NAME,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_PARAM_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_param_get_dumpit,
		.policy		= devlink_param_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -248,14 +332,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit_port_optional,
		.doit		= devlink_nl_region_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_region_get_nl_policy,
		.policy		= devlink_region_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_REGION_NAME,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_REGION_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_region_get_dumpit,
		.policy		= devlink_region_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -280,14 +365,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit_port_optional,
		.doit		= devlink_nl_health_reporter_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_health_reporter_get_nl_policy,
		.policy		= devlink_health_reporter_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_HEALTH_REPORTER_NAME,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_HEALTH_REPORTER_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_health_reporter_get_dumpit,
		.policy		= devlink_health_reporter_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -296,14 +382,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_trap_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_trap_get_nl_policy,
		.policy		= devlink_trap_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_TRAP_NAME,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_TRAP_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_trap_get_dumpit,
		.policy		= devlink_trap_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -312,14 +399,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_trap_group_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_trap_group_get_nl_policy,
		.policy		= devlink_trap_group_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_TRAP_GROUP_NAME,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_TRAP_GROUP_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_trap_group_get_dumpit,
		.policy		= devlink_trap_group_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -328,14 +416,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_trap_policer_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_trap_policer_get_nl_policy,
		.policy		= devlink_trap_policer_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_TRAP_POLICER_ID,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_TRAP_POLICER_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_trap_policer_get_dumpit,
		.policy		= devlink_trap_policer_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -344,14 +433,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_rate_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_rate_get_nl_policy,
		.policy		= devlink_rate_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_RATE_NODE_NAME,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_RATE_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_rate_get_dumpit,
		.policy		= devlink_rate_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
@@ -360,14 +450,15 @@ const struct genl_split_ops devlink_nl_ops[32] = {
		.pre_doit	= devlink_nl_pre_doit,
		.doit		= devlink_nl_linecard_get_doit,
		.post_doit	= devlink_nl_post_doit,
		.policy		= devlink_linecard_get_nl_policy,
		.policy		= devlink_linecard_get_do_nl_policy,
		.maxattr	= DEVLINK_ATTR_LINECARD_INDEX,
		.flags		= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= DEVLINK_CMD_LINECARD_GET,
		.validate	= GENL_DONT_VALIDATE_DUMP,
		.dumpit		= devlink_nl_linecard_get_dumpit,
		.policy		= devlink_linecard_get_dump_nl_policy,
		.maxattr	= DEVLINK_ATTR_DEV_NAME,
		.flags		= GENL_CMD_CAP_DUMP,
	},
	{
+110 −13

File changed.

Preview size limit exceeded, changes collapsed.

+533 −13

File changed.

Preview size limit exceeded, changes collapsed.