netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Donald Hunter <donald.hunter@gmail.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,  Simon Horman <horms@kernel.org>,
	linux-wireless@vger.kernel.org, donald.hunter@redhat.com
Subject: Re: [PATCH net-next v5 10/10] netlink: specs: wireless: add a spec for nl80211
Date: Mon, 05 May 2025 11:10:27 +0200	[thread overview]
Message-ID: <004030652d592b379e730be2f0344bebc4a03475.camel@sipsolutions.net> (raw)
In-Reply-To: <20250503130739.1c94d433@kernel.org>

On Sat, 2025-05-03 at 13:07 -0700, Jakub Kicinski wrote:
> Looks like we have 3 structs in the Netlink spec:
>  - ieee80211-ht-cap
>  - ieee80211-mcs-info
>  - ieee80211-vht-mcs-info
> which are defined in include/linux/ieee80211.h rather than the uAPI,
> but we do use them in Netlink attrs. I'm guessing these come from 
> the IEEE spec so there is no ambiguity?

Yes. In some of these cases userspace has different definitions that
match the same bits, but might have e.g. __le32 vs. u8 for some fields
and then just has a different number of fields. For HT it looks pretty
similar though.

Certainly there are many more in this area that could have a similar
situation. There are also new ones where there's maybe not a good struct
representation at all, unless you care only about special cases (which
may well be appropriate for some tools, but not for the API.)

> I'm trying to figure out what to do with them in the C codegen
> for YNL. Normally we assume all structs used by the spec are defined
> in the headers. We can add an annotation to render the definition
> in user space code, but I wonder if this omission is really intentional?
> Wouldn't it be generally useful to user space to expose the types 
> in uAPI?

We never even conceptually exposed these in the original nl80211.h, that
just literally said it's the HT capability element, without caring how
you arrived at the bytes representing it. We did define the length for
the policy check, but I guess in some way even that isn't needed.

I'm not really sure it really is all that useful given that different
tools care about different things and restrictions (endian, etc.).

I also don't know if we'd really want the kernel to become the canonical
definition of structures used for elements defined in the spec., but
then is it restricted to those that need to be in the userspace API?
That would also feel a bit odd?

So not sure. I'd almost prefer to just remove the struct annotation from
the spec here.

johannes

  reply	other threads:[~2025-05-05  9:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 12:01 [PATCH net-next v5 00/10] netlink: specs: add a spec for nl80211 wiphy Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 01/10] tools/net/ynl: remove extraneous plural from variable names Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 02/10] tools/net/ynl: support decoding indexed arrays as enums Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 03/10] tools/net/ynl: support rendering C array members to strings Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 04/10] tools/net/ynl: accept IP string inputs Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 05/10] tools/net/ynl: add s8, s16 to valid scalars in ynl-gen-c Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 06/10] tools/net/ynl: sanitise enums with leading digits " Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 07/10] tools/net/ynl: add indexed-array scalar support to ynl-gen-c Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 08/10] netlink: specs: support nested structs in genetlink legacy Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 09/10] netlink: specs: add s8, s16 to genetlink schemas Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 10/10] netlink: specs: wireless: add a spec for nl80211 Donald Hunter
2025-05-03 20:07   ` Jakub Kicinski
2025-05-05  9:10     ` Johannes Berg [this message]
2025-02-13  3:40 ` [PATCH net-next v5 00/10] netlink: specs: add a spec for nl80211 wiphy patchwork-bot+netdevbpf

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=004030652d592b379e730be2f0344bebc4a03475.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=donald.hunter@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-wireless@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).