Files
linux-stable-mirror/include/uapi/linux
Daniel Zahka 2a367002ed devlink: support default values for param-get and param-set
Support querying and resetting to default param values.

Introduce two new devlink netlink attrs:
DEVLINK_ATTR_PARAM_VALUE_DEFAULT and
DEVLINK_ATTR_PARAM_RESET_DEFAULT. The former is used to contain an
optional parameter value inside of the param_value nested
attribute. The latter is used in param-set requests from userspace to
indicate that the driver should reset the param to its default value.

To implement this, two new functions are added to the devlink driver
api: devlink_param::get_default() and
devlink_param::reset_default(). These callbacks allow drivers to
implement default param actions for runtime and permanent cmodes. For
driverinit params, the core latches the last value set by a driver via
devl_param_driverinit_value_set(), and uses that as the default value
for a param.

Because default parameter values are optional, it would be impossible
to discern whether or not a param of type bool has default value of
false or not provided if the default value is encoded using a netlink
flag type. For this reason, when a DEVLINK_PARAM_TYPE_BOOL has an
associated default value, the default value is encoded using a u8
type.

Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20251119025038.651131-4-daniel.zahka@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-11-20 19:01:22 -08:00
..
2025-10-16 12:04:47 -07:00
2025-02-05 13:22:04 +09:00
2025-02-12 02:29:30 +00:00
2025-10-28 22:59:19 +01:00
2025-09-19 14:26:16 +02:00
2025-08-29 15:08:07 +02:00
2025-09-05 09:11:28 +02:00
2025-05-03 12:02:09 +02:00
2025-07-14 09:15:58 +02:00
2025-09-15 14:32:54 +02:00
2025-04-17 11:09:10 +02:00
2025-07-08 12:39:24 +02:00
2025-04-17 12:30:02 +02:00
2025-06-24 15:50:06 +02:00
2025-02-25 18:14:03 -08:00
2025-07-14 18:41:42 -07:00
2025-06-19 14:28:22 +02:00
2025-05-21 13:41:03 +02:00
2025-04-17 12:30:02 +02:00
2025-09-21 17:44:20 -04:00
2025-09-22 09:29:28 +01:00
2025-05-27 10:27:54 -04:00
2025-09-22 09:29:29 +01:00