netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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,
	Jacob Keller <jacob.e.keller@intel.com>,
	donald.hunter@redhat.com
Subject: Re: [PATCH net-next v2 06/11] doc/netlink: Document the sub-message format for netlink-raw
Date: Mon, 11 Dec 2023 17:56:34 -0800	[thread overview]
Message-ID: <20231211175634.3ac1ea07@kernel.org> (raw)
In-Reply-To: <20231211164039.83034-7-donald.hunter@gmail.com>

On Mon, 11 Dec 2023 16:40:34 +0000 Donald Hunter wrote:
> +Sub-messages
> +------------
> +
> +Several raw netlink families such as rt_link and tc have type-specific
> +sub-messages. These sub-messages can appear as an attribute in a top-level or a
> +nested attribute space.
> +
> +A sub-message attribute uses the value of another attribute as a selector key to
> +choose the right sub-message format. For example if the following attribute has
> +already been decoded:

We may want to explain why we call this thing "sub-message". How about:

  Several raw netlink families such as rt_link and tc use attribute
  nesting as an abstraction to carry module specific information.
  Conceptually it looks as follows::

    [OUTER NEST OR MESSAGE LEVEL]
      [GENERIC ATTR 1]
      [GENERIC ATTR 2]
      [GENERIC ATTR 3]
      [GENERIC ATTR - wrapper]
        [MODULE SPECIFIC ATTR 1]
        [MODULE SPECIFIC ATTR 2]

  The GENERIC ATTRs at the outer level are defined in the core (or rt_link
  or core TC), while specific drivers / TC classifiers, qdiscs etc. can
  carry their own information wrapped in the "GENERIC ATTR - wrapper".
  Even though the example above shows attributes nesting inside the wrapper,
  the modules generally have full freedom of defining the format of the nest.
  In practice payload of the wrapper attr has very similar characteristics
  to a netlink message. It may contain a fixed header / structure, netlink
  attributes, or both. Because of those shared characteristics we refer
  to the payload of the wrapper attribute as a sub-message.

> +A sub-message attribute uses the value of another attribute as a selector key to
> +choose the right sub-message format. For example if the following attribute has
> +already been decoded:

  reply	other threads:[~2023-12-12  1:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 16:40 [PATCH net-next v2 00/11] tools/net/ynl: Add 'sub-message' support to ynl Donald Hunter
2023-12-11 16:40 ` [PATCH net-next v2 01/11] tools/net/ynl-gen-rst: Use bullet lists for attribute-set entries Donald Hunter
2023-12-11 23:28   ` Jakub Kicinski
2023-12-12 11:27     ` Donald Hunter
2023-12-12 16:11       ` Jakub Kicinski
2023-12-11 16:40 ` [PATCH net-next v2 02/11] tools/net/ynl-gen-rst: Sort the index of generated netlink specs Donald Hunter
2023-12-11 23:30   ` Jakub Kicinski
2023-12-12 11:30     ` Donald Hunter
2023-12-12 16:13       ` Jakub Kicinski
2023-12-12 20:42     ` Breno Leitao
2023-12-11 16:40 ` [PATCH net-next v2 03/11] doc/netlink: Regenerate netlink .rst files if ynl-gen-rst changes Donald Hunter
2023-12-11 23:30   ` Jakub Kicinski
2023-12-12 20:39   ` Breno Leitao
2023-12-12 21:48     ` Donald Hunter
2023-12-11 16:40 ` [PATCH net-next v2 04/11] tools/net/ynl: Use consistent array index expression formatting Donald Hunter
2023-12-11 23:30   ` Jakub Kicinski
2023-12-11 16:40 ` [PATCH net-next v2 05/11] doc/netlink: Add sub-message support to netlink-raw Donald Hunter
2023-12-11 23:37   ` Jakub Kicinski
2023-12-12 11:30     ` Donald Hunter
2023-12-11 16:40 ` [PATCH net-next v2 06/11] doc/netlink: Document the sub-message format for netlink-raw Donald Hunter
2023-12-12  1:56   ` Jakub Kicinski [this message]
2023-12-12 11:32     ` Donald Hunter
2023-12-11 16:40 ` [PATCH net-next v2 07/11] tools/net/ynl: Add 'sub-message' attribute decoding to ynl Donald Hunter
2023-12-12  2:00   ` Jakub Kicinski
2023-12-11 16:40 ` [PATCH net-next v2 08/11] tools/net/ynl: Add binary and pad support to structs for tc Donald Hunter
2023-12-12  2:04   ` Jakub Kicinski
2023-12-12 11:36     ` Donald Hunter
2023-12-11 16:40 ` [PATCH net-next v2 09/11] doc/netlink/specs: add sub-message type to rt_link family Donald Hunter
2023-12-11 16:40 ` [PATCH net-next v2 10/11] doc/netlink/specs: Add a spec for tc Donald Hunter
2023-12-11 16:40 ` [PATCH net-next v2 11/11] tools/net/ynl-gen-rst: Add sub-messages to generated docs Donald Hunter
2023-12-12 20:42   ` Breno Leitao
2023-12-11 23:32 ` [PATCH net-next v2 00/11] tools/net/ynl: Add 'sub-message' support to ynl Jakub Kicinski
2023-12-12 11:38   ` Donald Hunter
2023-12-12 16:14     ` Jakub Kicinski

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=20231211175634.3ac1ea07@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=jacob.e.keller@intel.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).