diff options
| author | Jiri Pirko <jiri@nvidia.com> | 2026-03-12 11:03:59 +0100 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-03-14 13:08:48 -0700 |
| commit | 725d5fdb7b9c01d9e7079682acf998703762475b (patch) | |
| tree | 076f9770f2024247a9b91e102a7c61315852df85 /include | |
| parent | d85a8af57da871964c60eb5b9ab121a6c31e3bd3 (diff) | |
devlink: support index-based lookup via bus_name/dev_name handle
Devlink instances without a backing device use bus_name
"devlink_index" and dev_name set to the decimal index string.
When user space sends this handle, detect the pattern and perform
a direct xarray lookup by index instead of iterating all instances.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20260312100407.551173-6-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/uapi/linux/devlink.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index 1ba3436db4ae..7de2d8cc862f 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -19,6 +19,8 @@ #define DEVLINK_GENL_VERSION 0x1 #define DEVLINK_GENL_MCGRP_CONFIG_NAME "config" +#define DEVLINK_INDEX_BUS_NAME "devlink_index" + enum devlink_command { /* don't change the order or add anything between, this is ABI! */ DEVLINK_CMD_UNSPEC, |
