From: Hangbin Liu <liuhangbin@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Donald Hunter <donald.hunter@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
netdev@vger.kernel.org
Subject: Re: How to display IPv4 array?
Date: Wed, 13 Mar 2024 10:51:42 +0800 [thread overview]
Message-ID: <ZfEUvmD8V1Yjwmk5@Laptop-X1> (raw)
In-Reply-To: <20240312100105.16a59086@kernel.org>
On Tue, Mar 12, 2024 at 10:01:05AM -0700, Jakub Kicinski wrote:
> On Tue, 12 Mar 2024 16:04:56 +0000 Donald Hunter wrote:
> > > "nested-array" would tell the parser to expect a nest that has attr
> > > type of value of array index, "type" is the same for all array members.
> > > The output will be the same as in case of "multi-attr", array index
> > > ignored (I don't see what it would be good for to the user).
> >
> > I'd say that this construct looks more like nest-type-value
>
> type-value is sort of a decomposed array, if we have all the entries
> under one nest I reckon array extension may be more appropriate.
>
> My gut feeling is that we should generalize the array-nest type,
> when I wrote the initial spec we didn't have sub-type. How about
> we replace array-nest with indexed-array (good name TBD), and instead
> of assuming the value is always a nest pass the type via sub-type?
>
> For bonding probably something like:
>
> -
> name: linkinfo-bond-attrs
> name-prefix: ifla-bond-
> attributes:
> -
> name: arp-ip-target
> type: indexed-array
> sub-type: u32
> byte-order: big-endian
>
> how does that sound?
>
> exiting array-nests would change from:
>
> -
> name: bla
> type: array-nest
> nested-attributes: bla-attrs
>
> to
>
> -
> name: bla
> type: indexed-array
> sub-type: nest
> nested-attributes: bla-attrs
>
> But that'd mean updating all existing specs and codegen.
This looks good to me.
Thanks
Hangbin
prev parent reply other threads:[~2024-03-13 2:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 10:08 How to display IPv4 array? Hangbin Liu
2024-03-12 12:12 ` Jiri Pirko
2024-03-12 12:37 ` Hangbin Liu
2024-03-12 12:48 ` Jiri Pirko
2024-03-12 16:04 ` Donald Hunter
2024-03-12 17:01 ` Jakub Kicinski
2024-03-13 2:51 ` Hangbin Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfEUvmD8V1Yjwmk5@Laptop-X1 \
--to=liuhangbin@gmail.com \
--cc=donald.hunter@gmail.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).