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

From: Jakub Kicinski <[email-masked]>
Date: Tue, 29 Apr 2025 09:58:09 -0700

On Tue, 29 Apr 2025 13:34:57 +0200 Jiri Pirko wrote:
> >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?

The attribute type (nla_type) should define the nested type. Having 
the nested type carried as a value in another attribute makes writing
generic parsers so much harder. I made a similar mistake in one the the
ethtool commands.

We should have basically have separate attr types for each of the value
sizes:
	DEVLINK_ATTR_PARAM_VALUE_DATA_U32
	DEVLINK_ATTR_PARAM_VALUE_DATA_BOOL
etc. They should be in a separate attr space, not the main devlink_attr
one, but every type should have its own value_data attr type.