[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdk3jo2w7mg5meofpj7c5v6h5ngo46x4zev7buh7iqw3uil3yx@3rljgtc3l464>
Date: Tue, 29 Apr 2025 13:34:57 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Saeed Mahameed <saeed@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>, Saeed Mahameed <saeedm@...dia.com>, netdev@...r.kernel.org,
Tariq Toukan <tariqt@...dia.com>, Gal Pressman <gal@...dia.com>,
Leon Romanovsky <leonro@...dia.com>, Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH net-next V3 14/15] devlink: Implement devlink param multi
attribute nested data values
Tue, Apr 29, 2025 at 01:17:32AM +0200, kuba@...nel.org wrote:
>On Fri, 25 Apr 2025 14:48:07 -0700 Saeed Mahameed wrote:
>> + case DEVLINK_PARAM_TYPE_ARR_U32:
>> + len = 0;
>> + nla_for_each_attr_type(param_data,
>> + DEVLINK_ATTR_PARAM_VALUE_DATA,
>> + genlmsg_data(info->genlhdr),
>> + genlmsg_len(info->genlhdr), rem) {
>> + if (nla_len(param_data) != sizeof(u32)) {
>> + NL_SET_ERR_MSG_MOD(extack,
>> + "Array element size must be 4 bytes");
>> + return -EINVAL;
>> + }
>> + if (++len > __DEVLINK_PARAM_MAX_ARRAY_SIZE) {
>> + NL_SET_ERR_MSG_MOD(extack,
>> + "Array size exceeds maximum");
>> + return -EINVAL;
>> + }
>> + }
>> + if (len)
>> + return 0;
>> + NL_SET_ERR_MSG_MOD(extack,
>> + "Value array must have at least one entry");
>> + break;
>
>I'd really rather not build any more complexity into this funny
>indirect attribute construct. Do you have many more arrays to expose?
How else do you imagine to expose arrays in params?
Btw, why is it "funny"? I mean, if you would be designing it from
scratch, how would you do that (params with multiple types) differently?
>From netlink perspective there's nothing wrong with it, is it?
Powered by blists - more mailing lists