]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
devlink: Implement devlink param multi attribute nested data values
authorSaeed Mahameed <saeedm@nvidia.com>
Tue, 9 Jun 2026 04:04:48 +0000 (09:34 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 23:16:58 +0000 (16:16 -0700)
commiteb7b4d458e0d6833ffbb717edf4282f5ca6a7b57
tree6ab29cff7e2ee6f71fd8c95cbe64c13d62ba31a6
parentc0e67fd12313e92e83b0b4795c0bf71eb8e34618
devlink: Implement devlink param multi attribute nested data values

Devlink param value attribute is not defined since devlink is handling
the value validating and parsing internally, this allows us to implement
multi attribute values without breaking any policies.

Devlink param multi-attribute values are considered to be dynamically
sized arrays of u64 values, by introducing a new devlink param type
DEVLINK_PARAM_TYPE_U64_ARRAY, driver and user space can set a variable
count of u64 values into the DEVLINK_ATTR_PARAM_VALUE_DATA attribute.

Implement get/set parsing and add to the internal value structure passed
to drivers.

This is useful for devices that need to configure a list of values for
a specific configuration.

example:
$ devlink dev param show pci/... name multi-value-param
name multi-value-param type driver-specific
values:
cmode permanent value: 0,1,2,3,4,5,6,7

$ devlink dev param set pci/... name multi-value-param \
value 4,5,6,7,0,1,2,3 cmode permanent

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://patch.msgid.link/20260609040453.711932-5-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/specs/devlink.yaml
include/net/devlink.h
include/uapi/linux/devlink.h
net/devlink/netlink_gen.c
net/devlink/param.c