summaryrefslogtreecommitdiff
path: root/net/devlink/netlink.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-08-11 17:57:06 +0200
committerJakub Kicinski <kuba@kernel.org>2023-08-14 11:47:24 -0700
commit24c8e56d4f983527cc5e1f6d771fef8ec7ce352e (patch)
tree257b68b74003d5f8e59e70d60988a553c318edd0 /net/devlink/netlink.c
parent8fa995ad1f7f8f615b479edcf540cc12fe7b87ba (diff)
devlink: introduce dumpit callbacks for split ops
Introduce dumpit callbacks for generated split ops. Have them as a thin wrapper around iteration function and allow to pass dump_one() function pointer directly without need to store in devlink_cmd structs. Note that the function prototypes are temporary until the generated ones will replace them in a follow-up patch. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230811155714.1736405-6-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/devlink/netlink.c')
-rw-r--r--net/devlink/netlink.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/net/devlink/netlink.c b/net/devlink/netlink.c
index 3c59b9c49150..13388665f319 100644
--- a/net/devlink/netlink.c
+++ b/net/devlink/netlink.c
@@ -170,23 +170,6 @@ void devlink_nl_post_doit(const struct genl_split_ops *ops,
devlink_put(devlink);
}
-static const struct devlink_cmd *devl_cmds[] = {
- [DEVLINK_CMD_PORT_GET] = &devl_cmd_port_get,
- [DEVLINK_CMD_SB_GET] = &devl_cmd_sb_get,
- [DEVLINK_CMD_SB_POOL_GET] = &devl_cmd_sb_pool_get,
- [DEVLINK_CMD_SB_PORT_POOL_GET] = &devl_cmd_sb_port_pool_get,
- [DEVLINK_CMD_SB_TC_POOL_BIND_GET] = &devl_cmd_sb_tc_pool_bind_get,
- [DEVLINK_CMD_PARAM_GET] = &devl_cmd_param_get,
- [DEVLINK_CMD_REGION_GET] = &devl_cmd_region_get,
- [DEVLINK_CMD_HEALTH_REPORTER_GET] = &devl_cmd_health_reporter_get,
- [DEVLINK_CMD_TRAP_GET] = &devl_cmd_trap_get,
- [DEVLINK_CMD_TRAP_GROUP_GET] = &devl_cmd_trap_group_get,
- [DEVLINK_CMD_TRAP_POLICER_GET] = &devl_cmd_trap_policer_get,
- [DEVLINK_CMD_RATE_GET] = &devl_cmd_rate_get,
- [DEVLINK_CMD_LINECARD_GET] = &devl_cmd_linecard_get,
- [DEVLINK_CMD_SELFTESTS_GET] = &devl_cmd_selftests_get,
-};
-
int devlink_nl_dumpit(struct sk_buff *msg, struct netlink_callback *cb,
devlink_nl_dump_one_func_t *dump_one)
{
@@ -220,15 +203,6 @@ int devlink_nl_dumpit(struct sk_buff *msg, struct netlink_callback *cb,
return msg->len;
}
-int devlink_nl_instance_iter_dumpit(struct sk_buff *msg,
- struct netlink_callback *cb)
-{
- const struct genl_dumpit_info *info = genl_dumpit_info(cb);
- const struct devlink_cmd *cmd = devl_cmds[info->op.cmd];
-
- return devlink_nl_dumpit(msg, cb, cmd->dump_one);
-}
-
struct genl_family devlink_nl_family __ro_after_init = {
.name = DEVLINK_GENL_NAME,
.version = DEVLINK_GENL_VERSION,