summaryrefslogtreecommitdiffstats
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2022-07-16 13:02:35 +0200
committerJakub Kicinski <kuba@kernel.org>2022-07-18 20:10:46 -0700
commitc223d6a4bf6d2a88f2418316393f9170f81c54f0 (patch)
treee2ecadec738d039729f85cb20366c6b8bd44147a /include/net/devlink.h
parent852e85a704c2e11c050bdea286bc438aba4f4a22 (diff)
downloadlinux-stable-c223d6a4bf6d2a88f2418316393f9170f81c54f0.tar.gz
linux-stable-c223d6a4bf6d2a88f2418316393f9170f81c54f0.tar.bz2
linux-stable-c223d6a4bf6d2a88f2418316393f9170f81c54f0.zip
net: devlink: add unlocked variants of devlink_resource*() functions
Add unlocked variants of devlink_resource*() functions to be used in drivers called-in with devlink->lock held. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r--include/net/devlink.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index fb1e17d998b6..d341753753ce 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -1608,23 +1608,40 @@ extern struct devlink_dpipe_header devlink_dpipe_header_ethernet;
extern struct devlink_dpipe_header devlink_dpipe_header_ipv4;
extern struct devlink_dpipe_header devlink_dpipe_header_ipv6;
+int devl_resource_register(struct devlink *devlink,
+ const char *resource_name,
+ u64 resource_size,
+ u64 resource_id,
+ u64 parent_resource_id,
+ const struct devlink_resource_size_params *size_params);
int devlink_resource_register(struct devlink *devlink,
const char *resource_name,
u64 resource_size,
u64 resource_id,
u64 parent_resource_id,
const struct devlink_resource_size_params *size_params);
+void devl_resources_unregister(struct devlink *devlink);
void devlink_resources_unregister(struct devlink *devlink);
+int devl_resource_size_get(struct devlink *devlink,
+ u64 resource_id,
+ u64 *p_resource_size);
int devlink_resource_size_get(struct devlink *devlink,
u64 resource_id,
u64 *p_resource_size);
int devlink_dpipe_table_resource_set(struct devlink *devlink,
const char *table_name, u64 resource_id,
u64 resource_units);
+void devl_resource_occ_get_register(struct devlink *devlink,
+ u64 resource_id,
+ devlink_resource_occ_get_t *occ_get,
+ void *occ_get_priv);
void devlink_resource_occ_get_register(struct devlink *devlink,
u64 resource_id,
devlink_resource_occ_get_t *occ_get,
void *occ_get_priv);
+void devl_resource_occ_get_unregister(struct devlink *devlink,
+ u64 resource_id);
+
void devlink_resource_occ_get_unregister(struct devlink *devlink,
u64 resource_id);
int devlink_params_register(struct devlink *devlink,