Re: [PATCH v4 net-next 2/5] devlink: Implement devlink param multi attribute nested data values
From: Jiri Pirko <jiri@resnulli.us>
Date: 2026-03-17 13:22:38
Also in:
lkml
From: Jiri Pirko <jiri@resnulli.us>
Date: 2026-03-17 13:22:38
Also in:
lkml
Thu, Mar 12, 2026 at 03:27:51AM +0100, rkannoth@marvell.com wrote:
From: Saeed Mahameed <saeedm@nvidia.com>
[..]
+
+ case DEVLINK_PARAM_TYPE_U32_ARRAY:
+ cnt = 0;
+ nla_for_each_attr_type(param_data,
+ DEVLINK_ATTR_PARAM_VALUE_DATA,
+ genlmsg_data(info->genlhdr),
+ genlmsg_len(info->genlhdr), rem) {
+ if (cnt >= __DEVLINK_PARAM_MAX_ARRAY_SIZE)
+ return -EMSGSIZE;
+
+ if (nla_len(param_data) != sizeof(u32))
+ return -EINVAL;
+
+ value->u32arr.val[cnt] = nla_get_u32(param_data);Now that we have UINT to be used everywhere for new netlink attributes, wouldn't it make sense to have rather UINT array?
+ cnt++; + } + + value->u32arr.size = cnt; + break;
[..]