Skip to content

Commit fff3029

Browse files
committed
devlink: Add support for u64 parameters
JIRA: https://issues.redhat.com/browse/RHEL-105064 commit c0ef144 Author: Ivan Vecera <ivecera@redhat.com> Date: Fri Jul 4 20:21:53 2025 +0200 devlink: Add support for u64 parameters Only 8, 16 and 32-bit integers are supported for numeric devlink parameters. The subsequent patch adds support for DPLL clock ID that is defined as 64-bit number. Add support for u64 parameter type. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://patch.msgid.link/20250704182202.1641943-4-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
1 parent 3172bcf commit fff3029

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/net/devlink.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ enum devlink_param_type {
442442
DEVLINK_PARAM_TYPE_U8 = DEVLINK_VAR_ATTR_TYPE_U8,
443443
DEVLINK_PARAM_TYPE_U16 = DEVLINK_VAR_ATTR_TYPE_U16,
444444
DEVLINK_PARAM_TYPE_U32 = DEVLINK_VAR_ATTR_TYPE_U32,
445+
DEVLINK_PARAM_TYPE_U64 = DEVLINK_VAR_ATTR_TYPE_U64,
445446
DEVLINK_PARAM_TYPE_STRING = DEVLINK_VAR_ATTR_TYPE_STRING,
446447
DEVLINK_PARAM_TYPE_BOOL = DEVLINK_VAR_ATTR_TYPE_FLAG,
447448
};
@@ -450,6 +451,7 @@ union devlink_param_value {
450451
u8 vu8;
451452
u16 vu16;
452453
u32 vu32;
454+
u64 vu64;
453455
char vstr[__DEVLINK_PARAM_MAX_STRING_VALUE];
454456
bool vbool;
455457
};

net/devlink/param.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ devlink_nl_param_value_fill_one(struct sk_buff *msg,
200200
if (nla_put_u32(msg, DEVLINK_ATTR_PARAM_VALUE_DATA, val.vu32))
201201
goto value_nest_cancel;
202202
break;
203+
case DEVLINK_PARAM_TYPE_U64:
204+
if (devlink_nl_put_u64(msg, DEVLINK_ATTR_PARAM_VALUE_DATA,
205+
val.vu64))
206+
goto value_nest_cancel;
207+
break;
203208
case DEVLINK_PARAM_TYPE_STRING:
204209
if (nla_put_string(msg, DEVLINK_ATTR_PARAM_VALUE_DATA,
205210
val.vstr))
@@ -434,6 +439,11 @@ devlink_param_value_get_from_info(const struct devlink_param *param,
434439
return -EINVAL;
435440
value->vu32 = nla_get_u32(param_data);
436441
break;
442+
case DEVLINK_PARAM_TYPE_U64:
443+
if (nla_len(param_data) != sizeof(u64))
444+
return -EINVAL;
445+
value->vu64 = nla_get_u64(param_data);
446+
break;
437447
case DEVLINK_PARAM_TYPE_STRING:
438448
len = strnlen(nla_data(param_data), nla_len(param_data));
439449
if (len == nla_len(param_data) ||

0 commit comments

Comments
 (0)