From: Johannes Berg <johannes@sipsolutions.net>
To: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>,
ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org,
Vasanthakumar Thiagarajan <quic_vthiagar@quicinc.com>,
netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH 02/13] wifi: nl80211: send underlying multi-hardware channel capabilities to user space
Date: Thu, 28 Mar 2024 13:01:55 +0100 [thread overview]
Message-ID: <9d0f309da45ae657cd2ce0bc11a93d66e856ef64.camel@sipsolutions.net> (raw)
In-Reply-To: <9d5c2f9f-19b5-af4d-8018-1eb97fac10d6@quicinc.com>
On Thu, 2024-03-28 at 15:48 +0530, Karthikeyan Periyasamy wrote:
> On 3/28/2024 1:19 PM, Johannes Berg wrote:
> > On Thu, 2024-03-28 at 12:59 +0530, Karthikeyan Periyasamy wrote:
> > > +/**
> > > + * nl80211_multi_hw_attrs - multi-hw attributes
> > > + *
> > > + * @NL80211_MULTI_HW_ATTR_INVALID: invalid
> > > + * @NL80211_MULTI_HW_ATTR_IDX: (u8) multi-HW index to refer the underlying HW
> > > + * for which the supported channel list is advertised. Internally refer
> > > + * the index of the wiphy's @hw_chans array.
> > Is there a good reason to expose this? Seems pretty internal to me, and
> > not sure what userspace would do with it?
>
> Hostapd use this hw index for the channel switch cmd.
What, where? I don't see that in this patchset? And why??
In any case, unless I just missed it and you're going to tell me to look
at patch N, we don't need it here, and then I'd prefer to keep it an
internal detail until it's needed.
> The hw index used as a sanity check to identify whether the user
> requested channel fall under the different hw or not.
You mean within hostapd itself? That doesn't make sense, it can derive
that information differently.
> In split-phy hardware, 5GHz band supported by two physical hardware's.
> First supports 5GHz Low band and second supports 5GHz High band.
In your hardware design anyway, but yeah, I get it.
> In this case, user space cannot use band vise check here to identify
> given channel or freq supported in the given hardware.
No, but it also doesn't need an index assigned by the kernel for that.
> > > + for (i = 0; i < wiphy->num_hw; i++) {
> > > + hw_mac = nla_nest_start(msg, i + 1);
> > And you kind of even have it here already ...
>
> Then user and kernel have to make an assumption that implicit index used
> in the life cycle.
Agree that's maybe not a great idea, for all we care this could just use
0 as the index anyway.
Which reminds me ...
Right now, the way you have it, we have the following structure:
NL80211_ATTR_MULTI_HW
- 1
- NL80211_MULTI_HW_ATTR_IDX: 0
- NL80211_MULTI_HW_ATTR_FREQS
- 0: 2412
- 1: 2417
...
- 2
- NL80211_MULTI_HW_ATTR_IDX: 1
- NL80211_MULTI_HW_ATTR_FREQS
- ... as above with 5 GHz etc.
...
Netlink is kind of moving away from nested arrays though:
https://kernel.org/doc/html/latest/userspace-api/netlink/specs.html#multi-attr-arrays
https://kernel.org/doc/html/latest/userspace-api/netlink/genetlink-legacy.html#attribute-type-nests
This talks about families, but maybe we shouldn't read that literally
and do the new style for new arrays in existing families as well, not
just new families.
If we do that, including NL80211_MULTI_HW_ATTR_IDX for illustrative
purposes though I think it should be removed, we'd end up with:
NL80211_ATTR_MULTI_HW
- NL80211_MULTI_HW_ATTR_IDX: 0
- NL80211_MULTI_HW_ATTR_FREQ: 2412
- NL80211_MULTI_HW_ATTR_FREQ: 2417
...
NL80211_ATTR_MULTI_HW
- NL80211_MULTI_HW_ATTR_IDX: 1
- NL80211_MULTI_HW_ATTR_FREQ: 5180
- NL80211_MULTI_HW_ATTR_FREQ: 5200
...
which _is_ a lot more compact, and removes all the uninteresting mid-
level indexing.
So in that sense, I prefer that, but I'm truly not sure how the (hand-
written) userspace code would deal with that.
johannes
next prev parent reply other threads:[~2024-03-28 12:02 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 7:29 [PATCH 00/13] wifi: Add multi physical hardware iface combination support Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 01/13] wifi: cfg80211: Add provision to advertise multiple radio in one wiphy Karthikeyan Periyasamy
2024-03-28 7:46 ` Johannes Berg
2024-03-29 14:11 ` Vasanthakumar Thiagarajan
2024-03-29 14:30 ` Johannes Berg
2024-03-29 14:47 ` Ben Greear
2024-04-10 7:56 ` Johannes Berg
2024-04-10 14:37 ` Ben Greear
2024-04-10 15:42 ` Johannes Berg
2024-04-10 16:23 ` Ben Greear
2024-04-10 16:43 ` Jeff Johnson
2024-04-10 18:08 ` Maxime Bizon
2024-04-11 16:26 ` Vasanthakumar Thiagarajan
2024-04-11 16:39 ` Maxime Bizon
2024-04-12 3:50 ` Vasanthakumar Thiagarajan
2024-04-12 7:38 ` Nicolas Escande
2024-04-12 8:01 ` Vasanthakumar Thiagarajan
2024-04-12 12:00 ` James Dutton
2024-04-12 14:39 ` Vasanthakumar Thiagarajan
2024-04-10 18:01 ` Maxime Bizon
2024-04-10 21:03 ` Ben Greear
2024-04-12 4:11 ` Vasanthakumar Thiagarajan
2024-04-12 14:08 ` Ben Greear
2024-04-12 14:31 ` Vasanthakumar Thiagarajan
2024-04-12 15:58 ` Ben Greear
2024-04-13 15:40 ` Ben Greear
2024-04-14 16:02 ` Vasanthakumar Thiagarajan
2024-04-15 13:59 ` Ben Greear
2024-04-14 15:52 ` Vasanthakumar Thiagarajan
2024-04-15 13:53 ` Ben Greear
2024-04-01 4:19 ` Karthikeyan Periyasamy
2024-04-10 9:08 ` Karthikeyan Periyasamy
2024-04-10 9:09 ` Johannes Berg
2024-04-10 9:15 ` Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 02/13] wifi: nl80211: send underlying multi-hardware channel capabilities to user space Karthikeyan Periyasamy
2024-03-28 7:49 ` Johannes Berg
2024-03-28 10:18 ` Karthikeyan Periyasamy
2024-03-28 12:01 ` Johannes Berg [this message]
2024-03-28 15:10 ` Karthikeyan Periyasamy
2024-03-28 16:09 ` Johannes Berg
2024-03-28 16:14 ` Jeff Johnson
2024-03-28 16:17 ` Jeff Johnson
2024-03-28 16:17 ` Johannes Berg
2024-03-28 16:18 ` Johannes Berg
2024-03-28 18:49 ` Jakub Kicinski
2024-03-28 18:53 ` Johannes Berg
2024-03-28 18:57 ` Jakub Kicinski
2024-03-28 19:32 ` Johannes Berg
2024-03-29 14:21 ` Vasanthakumar Thiagarajan
2024-04-10 7:59 ` Johannes Berg
2024-04-10 16:52 ` Jeff Johnson
2024-03-28 7:29 ` [PATCH 03/13] wifi: cfg80211: Refactor the interface combination limit check Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 04/13] wifi: cfg80211/mac80211: extend iface comb advertisement for multi-hardware dev Karthikeyan Periyasamy
2024-03-28 13:22 ` Johannes Berg
2024-04-01 9:56 ` Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 05/13] wifi: nl80211: Refactor the interface combination limit check Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 06/13] wifi: nl80211: send iface combination to user space in multi-hardware wiphy Karthikeyan Periyasamy
2024-03-28 13:33 ` Johannes Berg
2024-03-28 16:19 ` Jeff Johnson
2024-03-29 14:34 ` Vasanthakumar Thiagarajan
2024-04-10 4:10 ` Karthikeyan Periyasamy
2024-04-10 6:59 ` Johannes Berg
2024-04-12 5:27 ` Karthikeyan Periyasamy
2024-04-12 5:45 ` Karthikeyan Periyasamy
2024-04-15 14:27 ` Johannes Berg
2024-04-15 15:57 ` Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 07/13] wifi: cfg80211/mac80211: Refactor iface comb iterate callback for multi-hardware dev Karthikeyan Periyasamy
2024-03-28 13:36 ` Johannes Berg
2024-03-28 7:29 ` [PATCH 08/13] wifi: cfg80211: Refactor the iface combination iteration helper function Karthikeyan Periyasamy
2024-03-28 13:43 ` Johannes Berg
2024-04-02 16:35 ` Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 09/13] wifi: cfg80211: Add multi-hardware iface combination support Karthikeyan Periyasamy
2024-03-28 14:16 ` Johannes Berg
2024-04-03 9:58 ` Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 10/13] wifi: mac80211: expose channel context helper function Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 11/13] wifi: mac80211: Add multi-hardware support in the iface comb helper Karthikeyan Periyasamy
2024-03-28 14:41 ` Johannes Berg
2024-03-28 16:39 ` Jeff Johnson
2024-04-23 16:01 ` Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 12/13] wifi: ath12k: Introduce iface combination cleanup helper Karthikeyan Periyasamy
2024-03-28 7:29 ` [PATCH 13/13] wifi: ath12k: Advertise multi hardware iface combination Karthikeyan Periyasamy
2024-03-28 23:42 ` kernel test robot
2024-05-22 14:55 ` [PATCH 00/13] wifi: Add multi physical hardware iface combination support Felix Fietkau
2024-05-23 16:41 ` Johannes Berg
2024-05-27 6:58 ` Aditya Kumar Singh
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=9d0f309da45ae657cd2ce0bc11a93d66e856ef64.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ath12k@lists.infradead.org \
--cc=kuba@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=quic_periyasa@quicinc.com \
--cc=quic_vthiagar@quicinc.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