Subject: Re: [PATCH net-next V3 14/15] devlink: Implement devlink param multi attribute nested data values

From: Jakub Kicinski <[email-masked]>
Date: Mon, 28 Apr 2025 16:17:32 -0700

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?