summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOr Har-Toov <ohartoov@nvidia.com>2026-04-07 22:40:57 +0300
committerJakub Kicinski <kuba@kernel.org>2026-04-08 19:55:38 -0700
commit6f38acfed5edb398201d9ff127919745cbb331a1 (patch)
treedcaae4a151ef1d177c2352f1cf59b664c66a32a3 /include
parent7be3163c49b24bf923d32f333096963159e03a14 (diff)
downloadlwn-6f38acfed5edb398201d9ff127919745cbb331a1.tar.gz
lwn-6f38acfed5edb398201d9ff127919745cbb331a1.zip
devlink: Add port-level resource registration infrastructure
The current devlink resource infrastructure supports only device-level resources. Some hardware resources are associated with specific ports rather than the entire device, and today we have no way to show resource per-port. Add support for registering resources at the port level. Signed-off-by: Or Har-Toov <ohartoov@nvidia.com> Reviewed-by: Shay Drori <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260407194107.148063-3-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/devlink.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index f5439d050eb0..bcd31de1f890 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -129,6 +129,7 @@ struct devlink_rate {
struct devlink_port {
struct list_head list;
struct list_head region_list;
+ struct list_head resource_list;
struct devlink *devlink;
const struct devlink_port_ops *ops;
unsigned int index;
@@ -1891,6 +1892,13 @@ void devlink_resources_unregister(struct devlink *devlink);
int devl_resource_size_get(struct devlink *devlink,
u64 resource_id,
u64 *p_resource_size);
+int
+devl_port_resource_register(struct devlink_port *devlink_port,
+ const char *resource_name,
+ u64 resource_size, u64 resource_id,
+ u64 parent_resource_id,
+ const struct devlink_resource_size_params *params);
+void devl_port_resources_unregister(struct devlink_port *devlink_port);
int devl_dpipe_table_resource_set(struct devlink *devlink,
const char *table_name, u64 resource_id,
u64 resource_units);