From: Jakub Kicinski <kuba@kernel.org>
To: Donald Hunter <donald.hunter@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org, donald.hunter@redhat.com
Subject: Re: [RFC PATCH net-next v1 0/6] tools/net/ynl: Add dynamic selector for options attrs
Date: Wed, 29 Nov 2023 09:49:43 -0800 [thread overview]
Message-ID: <20231129094943.13f1ae0c@kernel.org> (raw)
In-Reply-To: <m2bkbc8pim.fsf@gmail.com>
On Wed, 29 Nov 2023 16:58:57 +0000 Donald Hunter wrote:
> rt_link shares attribute-sets between different kinds of link so I think
> that rules out putting the key on the attribute-set. I think we may also
> see reuse across stats attribute sets in tc.
>
> FWIW I initially considered avoiding a selector list by using a template
> to generate the attribute set name, but that broke pretty quickly.
Ah :(
> It seems reasonable to pull the selector list out of line because
> they do get big, e.g. over 100 lines for tc "options".
>
> My preference is 1, probably including a fallback to "binary" if there
> is no selector match.
Are there any "nests" that need a real binary type? An actual byte
array? Or are these all structs? If the latter then fixed-header
covers it.
> I think that once you have broken out to a sub-message, they're no
> longer "nested-attributes" and we should maybe reuse "attribute-set".
Good point.
> I don't think we can reuse "sub-type" because the schema for it is the
> set of netlink type names, not a free string. Maybe we add "sub-message"
> instead?
Sounds good.
> So how about this:
>
> attribute-sets:
> -
> name: outside-attrs
> attributes:
> ...
> -
> name: kind
> type: string
> -
> name: options
> type: sub-message
> sub-message: inside-msg
> selector: kind
> ...
> -
> name: inside-attrs:
> attributes:
> ...
>
> sub-messages:
> -
> name: inside-msg
> formats:
> -
> value: some-value
> fixed-header: struct-name
> -
> value: other-value
> fixed-header: struct-name-two
> attribute-set: inside-attrs
> -
> value: another-one
> attribute-set: inside-attrs
> -
> name: different-inside-msg
> ...
>
> operations:
> ...
LG!
> I cannot think of a better name than "formats" so happy to go with that.
Or maybe "variants" ?
> Did you want an explicit "list:" in the yaml schema?
You mean instead of the "formats" or in addition somewhere?
Under sub-messages?
The "formats" is basically a "list", just feels less artificial
to call it something else than "list". No strong preference, tho.
If you mean under "sub-messages" - I can't think of any extra property
we may want to put there. So going directly to entries seems fine.
next prev parent reply other threads:[~2023-11-29 17:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 10:11 [RFC PATCH net-next v1 0/6] tools/net/ynl: Add dynamic selector for options attrs Donald Hunter
2023-11-29 10:11 ` [RFC PATCH net-next v1 1/6] doc/netlink: Add bitfield32, s8, s16 to the netlink-raw schema Donald Hunter
2023-11-29 10:11 ` [RFC PATCH net-next v1 2/6] doc/netlink: Add a nest selector to " Donald Hunter
2023-11-29 10:11 ` [RFC PATCH net-next v1 3/6] tools/net/ynl: Add dynamic attribute decoding to ynl Donald Hunter
2023-11-29 10:11 ` [RFC PATCH net-next v1 4/6] doc/netlink/specs: add dynamic nest selector for rt_link data Donald Hunter
2023-11-29 10:11 ` [RFC PATCH net-next v1 5/6] doc/netlink/specs: Add a spec for tc Donald Hunter
2023-11-29 10:11 ` [RFC PATCH net-next v1 6/6] tools/net/ynl: Add optional fixed-header to dynamic nests Donald Hunter
2023-11-29 16:09 ` [RFC PATCH net-next v1 0/6] tools/net/ynl: Add dynamic selector for options attrs Jakub Kicinski
2023-11-29 16:58 ` Donald Hunter
2023-11-29 17:49 ` Jakub Kicinski [this message]
2023-11-30 8:48 ` Donald Hunter
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=20231129094943.13f1ae0c@kernel.org \
--to=kuba@kernel.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=donald.hunter@redhat.com \
--cc=edumazet@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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).