summaryrefslogtreecommitdiff
path: root/include/uapi/linux/devlink.h
diff options
context:
space:
mode:
authorCosmin Ratiu <cratiu@nvidia.com>2026-07-01 10:32:45 +0300
committerPaolo Abeni <pabeni@redhat.com>2026-07-07 11:31:26 +0200
commitb5f90fd4580ce71aa24ac9afcf5c9b4fa8121518 (patch)
tree01c8047ef19d74579d7ed2448625aebc0d07ed66 /include/uapi/linux/devlink.h
parentdb078bc2b03157648ef901f4f78a23586777b184 (diff)
devlink: Add parent dev to devlink API
Upcoming changes to the rate commands need the parent devlink specified. This change adds a nested 'parent-dev' attribute to the API and helpers to obtain and put a reference to the parent devlink instance in info->ctx. To avoid deadlocks, the parent devlink is unlocked before obtaining the main devlink instance that is the target of the request. A reference to the parent is kept until the end of the request to avoid it suddenly disappearing. This means that this reference is of limited use without additional protection. Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Reviewed-by: Carolina Jubran <cjubran@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260701073254.754518-6-tariqt@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/uapi/linux/devlink.h')
-rw-r--r--include/uapi/linux/devlink.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index ca713bcc47b9..a6801feb7744 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -648,6 +648,8 @@ enum devlink_attr {
DEVLINK_ATTR_INDEX, /* uint */
DEVLINK_ATTR_RESOURCE_SCOPE_MASK, /* u32 */
+ DEVLINK_ATTR_PARENT_DEV, /* nested */
+
/* Add new attributes above here, update the spec in
* Documentation/netlink/specs/devlink.yaml and re-generate
* net/devlink/netlink_gen.c.