From: Jakub Kicinski <kuba@kernel.org>
To: Donald Hunter <donald.hunter@gmail.com>, Jiri Pirko <jiri@resnulli.us>
Cc: Hangbin Liu <liuhangbin@gmail.com>, netdev@vger.kernel.org
Subject: Re: How to display IPv4 array?
Date: Tue, 12 Mar 2024 10:01:05 -0700 [thread overview]
Message-ID: <20240312100105.16a59086@kernel.org> (raw)
In-Reply-To: <CAD4GDZwxS1Av6XNkKnC-pmOWTwuc_u7JRLRkCXO5kJyy6wvwkA@mail.gmail.com>
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.
next prev parent reply other threads:[~2024-03-12 17:01 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 [this message]
2024-03-13 2:51 ` Hangbin Liu
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=20240312100105.16a59086@kernel.org \
--to=kuba@kernel.org \
--cc=donald.hunter@gmail.com \
--cc=jiri@resnulli.us \
--cc=liuhangbin@gmail.com \
--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).