linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
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,
	 Jacob Keller <jacob.e.keller@intel.com>,
	 donald.hunter@redhat.com
Subject: Re: [PATCH net-next v1 6/6] doc/netlink/specs: Add a spec for tc
Date: Mon, 04 Dec 2023 22:38:23 +0000	[thread overview]
Message-ID: <m2wmtt4mqo.fsf@gmail.com> (raw)
In-Reply-To: <20231204103247.6476f4b4@kernel.org> (Jakub Kicinski's message of "Mon, 4 Dec 2023 10:32:47 -0800")

Jakub Kicinski <kuba@kernel.org> writes:

> On Mon, 04 Dec 2023 16:27:24 +0000 Donald Hunter wrote:
>> > Ugh. Meaning the selector is at a "previous" level of nesting?
>>
>> That's right. I wonder if we should use a relative syntax like "../kind"
>> for the selector. Will either need to pass the known attrs to nest
>> parsing, or pass a resolver instead?
>
> ../kind is my first thought, too.
>
> But on reflection I reckon it may make the codegen and Python parser
> quite a bit more complex. :S

That was my main concern with it too.

Another thought I had was to explicitly mark attrs that get used as
selector keys, but I don't think that actually buys us anything.

> Passing in known selector attrs to nests sounds good. Assuming we never
> have to do something like: "../other-nest/attr".
> Or perhaps in that case we can support passing in nested attrs, just
> not backtracking? Backtracking is the hard part, really. Yeah, that
> sounds simplest, at least at the "thought exercise level" :)
>
> What would "resolver" look like?

I was thinking a resolver would be a class with a single lookup method
that internally holds attributes from the current scope and has a parent
it can delegate to. It would try to resolve e.g. "kind" in current scope
then, on failure, delegate to its parent. When recursing to decode a
submsg, create a new resolver with the current one as its parent.

If we did it this way, there'd be no need for "../kind".

> BTW how do we deal with ordering. Do we require that selector attr
> must be present in the message before the submsg? I think in practice
> is should always be the case, but we should document that.

The selector attr is de-facto present in the message before it is
needed, both at the same level and for sub messages. So, yeah, I think
we require this and agreed we should document it. I will do that in
the next revision.

From what I have seen so far, selector attrs are at same level or at
root level, but I'm not confident that will hold true for all of the raw
families.

  reply	other threads:[~2023-12-05  8:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 21:49 [PATCH net-next v1 0/6] tools/net/ynl: Add 'sub-message' support to ynl Donald Hunter
2023-11-30 21:49 ` [PATCH net-next v1 1/6] doc/netlink: Add bitfield32, s8, s16 to the netlink-raw schema Donald Hunter
2023-12-02  1:47   ` Jakub Kicinski
2023-11-30 21:49 ` [PATCH net-next v1 2/6] doc/netlink: Add sub-message support to netlink-raw Donald Hunter
2023-12-02  1:53   ` Jakub Kicinski
2023-12-04 15:58     ` Donald Hunter
2023-11-30 21:49 ` [PATCH net-next v1 3/6] tools/net/ynl: Add 'sub-message' attribute decoding to ynl Donald Hunter
2023-12-02  2:00   ` Jakub Kicinski
2023-12-04 15:59     ` Donald Hunter
2023-11-30 21:49 ` [PATCH net-next v1 4/6] tools/net/ynl: Add binary and pad support to structs for tc Donald Hunter
2023-12-02  2:06   ` Jakub Kicinski
2023-12-04 16:18     ` Donald Hunter
2023-12-04 18:21       ` Jakub Kicinski
2023-11-30 21:49 ` [PATCH net-next v1 5/6] doc/netlink/specs: add sub-message type to rt_link family Donald Hunter
2023-12-02  2:10   ` Jakub Kicinski
2023-12-04 16:22     ` Donald Hunter
2023-11-30 21:49 ` [PATCH net-next v1 6/6] doc/netlink/specs: Add a spec for tc Donald Hunter
2023-12-02  2:13   ` Jakub Kicinski
2023-12-04 16:27     ` Donald Hunter
2023-12-04 18:32       ` Jakub Kicinski
2023-12-04 22:38         ` Donald Hunter [this message]
2023-12-02  1:50 ` [PATCH net-next v1 0/6] tools/net/ynl: Add 'sub-message' support to ynl patchwork-bot+netdevbpf
2023-12-02  2:15 ` Jakub Kicinski
2023-12-04 15:54   ` Donald Hunter
2023-12-04 18:33     ` Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2023-11-30 17:13 [PATCH net-next v1 4/6] tools/net/ynl: Add binary and pad support to structs for tc Donald Hunter
2023-11-30 17:13 ` [PATCH net-next v1 6/6] doc/netlink/specs: Add a spec " 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=m2wmtt4mqo.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@redhat.com \
    --cc=edumazet@google.com \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --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).