[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250428161732.43472b2a@kernel.org>
Date: Mon, 28 Apr 2025 16:17:32 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Saeed Mahameed <saeed@...nel.org>
Cc: "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
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?
Powered by blists - more mailing lists