Re: [PATCH v11 net-next 4/7] devlink: Implement devlink param multi attribute nested data values

From: Jiri Pirko

Date: Mon Apr 13 2026 - 08:15:05 EST


Thu, Apr 09, 2026 at 04:50:52AM +0200, rkannoth@xxxxxxxxxxx wrote:
>From: Saeed Mahameed <saeedm@xxxxxxxxxx>

[...]


>diff --git a/net/devlink/param.c b/net/devlink/param.c
>index 4595fffbd825..8c9165797b32 100644
>--- a/net/devlink/param.c
>+++ b/net/devlink/param.c
>@@ -252,6 +252,14 @@ devlink_nl_param_value_put(struct sk_buff *msg, enum devlink_param_type type,
> return -EMSGSIZE;
> }
> break;
>+ case DEVLINK_PARAM_TYPE_U64_ARRAY:
>+ if (val->u64arr.size > __DEVLINK_PARAM_MAX_ARRAY_SIZE)

>From UAPI perspective, what's the motivation for such limitation? I
don't think we need it. Whatever kernel/user fits into skb is okay, no?




>+ return -EMSGSIZE;
>+
>+ for (int i = 0; i < val->u64arr.size; i++)
>+ if (nla_put_uint(msg, nla_type, val->u64arr.val[i]))
>+ return -EMSGSIZE;
>+ break;
> }
> return 0;
> }

[...]