aboutsummaryrefslogtreecommitdiff
path: root/net/devlink/devl_internal.h
diff options
context:
space:
mode:
authorGravatar Jakub Kicinski <kuba@kernel.org> 2023-01-04 20:05:31 -0800
committerGravatar Jakub Kicinski <kuba@kernel.org> 2023-01-05 22:13:40 -0800
commit5ce76d78b99650c0b22f466060d8b75df9123511 (patch)
treed40bbd8361fe6fa0b66d5fcc3169b46387b55ee2 /net/devlink/devl_internal.h
parentdevlink: add by-instance dump infra (diff)
downloadlinux-5ce76d78b99650c0b22f466060d8b75df9123511.tar.gz
linux-5ce76d78b99650c0b22f466060d8b75df9123511.tar.bz2
linux-5ce76d78b99650c0b22f466060d8b75df9123511.zip
devlink: convert remaining dumps to the by-instance scheme
Soon we'll have to check if a devlink instance is alive after locking it. Convert to the by-instance dumping scheme to make refactoring easier. Most of the subobject code no longer has to worry about any devlink locking / lifetime rules (the only ones that still do are the two subject types which stubbornly use their own locking). Both dump and do callbacks are given a devlink instance which is already locked and good-to-access (do from the .pre_doit handler, dump from the new dump indirection). Note that we'll now check presence of an op (e.g. for sb_pool_get) under the devlink instance lock, that will soon be necessary anyway, because we don't hold refs on the driver modules so the memory in which ops live may be gone for a dead instance, after upcoming locking changes. Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/devlink/devl_internal.h')
-rw-r--r--net/devlink/devl_internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index 856954e4a02d..adf9f6c177db 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -156,6 +156,21 @@ devlink_dump_state(struct netlink_callback *cb)
return (struct devlink_nl_dump_state *)cb->ctx;
}
+/* gen cmds */
+extern const struct devlink_gen_cmd devl_gen_inst;
+extern const struct devlink_gen_cmd devl_gen_port;
+extern const struct devlink_gen_cmd devl_gen_sb;
+extern const struct devlink_gen_cmd devl_gen_sb_pool;
+extern const struct devlink_gen_cmd devl_gen_sb_port_pool;
+extern const struct devlink_gen_cmd devl_gen_sb_tc_pool_bind;
+extern const struct devlink_gen_cmd devl_gen_selftests;
+extern const struct devlink_gen_cmd devl_gen_param;
+extern const struct devlink_gen_cmd devl_gen_region;
+extern const struct devlink_gen_cmd devl_gen_info;
+extern const struct devlink_gen_cmd devl_gen_trap;
+extern const struct devlink_gen_cmd devl_gen_trap_group;
+extern const struct devlink_gen_cmd devl_gen_trap_policer;
+
/* Ports */
int devlink_port_netdevice_event(struct notifier_block *nb,
unsigned long event, void *ptr);