summaryrefslogtreecommitdiff
path: root/net/devlink/devl_internal.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2026-03-12 11:03:58 +0100
committerJakub Kicinski <kuba@kernel.org>2026-03-14 13:08:47 -0700
commitd85a8af57da871964c60eb5b9ab121a6c31e3bd3 (patch)
treee7670b6f6412eec63f4036deac79491161af3db5 /net/devlink/devl_internal.h
parente2e3666fd3609bfc03c42bd8544be8cbd080d24d (diff)
downloadlwn-d85a8af57da871964c60eb5b9ab121a6c31e3bd3.tar.gz
lwn-d85a8af57da871964c60eb5b9ab121a6c31e3bd3.zip
devlink: allow to use devlink index as a command handle
Currently devlink instances are addressed bus_name/dev_name tuple. Allow the newly introduced DEVLINK_ATTR_INDEX to be used as an alternative handle for all devlink commands. When DEVLINK_ATTR_INDEX is present in the request, use it for a direct xarray lookup instead of iterating over all instances comparing bus_name/dev_name strings. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Link: https://patch.msgid.link/20260312100407.551173-5-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/devlink/devl_internal.h')
-rw-r--r--net/devlink/devl_internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index 1b770de0313e..395832ed4477 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -90,6 +90,7 @@ extern struct genl_family devlink_nl_family;
for (index = 0; (devlink = devlinks_xa_find_get(net, &index)); index++)
struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp);
+struct devlink *devlinks_xa_lookup_get(struct net *net, unsigned long index);
static inline bool __devl_is_registered(struct devlink *devlink)
{