[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240621081906.0466c431@kernel.org>
Date: Fri, 21 Jun 2024 08:19:06 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Kory Maincent <kory.maincent@...tlin.com>
Cc: netdev@...r.kernel.org, Donald Hunter <donald.hunter@...il.com>
Subject: Re: Netlink specs, help dealing with nested array
On Fri, 21 Jun 2024 16:15:43 +0200 Kory Maincent wrote:
> Hello Jakub, Donald or other ynl experts,
>
> I have an issue dealing with a nested array.
>
> Here is my current netlink spec and ethtool patches:
> https://termbin.com/gbyx
> https://termbin.com/b325
>
> Here is the error I got:
> https://termbin.com/c7b1
>
> I am trying to investigate what goes wrong with ynl but I still don't know.
> If someone have an idea of what is going wrong with ynl or my specs it would be
> lovely!
You're (correctly) formatting your data as a basic multi-attr.
Instead of:
+ name: c33-pse-pw-limit-ranges
+ name-prefix: ethtool-a-
+ type: indexed-array
+ sub-type: nest
+ nested-attributes: c33-pse-pw-limit
use:
+ name: c33-pse-pw-limit-ranges
+ name-prefix: ethtool-a-
+ type: nest
+ multi-attr: true
+ nested-attributes: c33-pse-pw-limit
The indexed array is described here:
https://docs.kernel.org/next/userspace-api/netlink/genetlink-legacy.html#indexed-array
it has an extra layer of nesting, which uses the index in the array
as the type of the attribute.
Powered by blists - more mailing lists