From: Wen Gong <quic_wgong@quicinc.com>
To: Johannes Berg <johannes@sipsolutions.net>,
<linux-wireless@vger.kernel.org>
Cc: Johannes Berg <johannes.berg@intel.com>,
<ath11k@lists.infradead.org>, <ath12k@lists.infradead.org>,
<quic_wgong@quicinc.com>
Subject: Re: [PATCH 24/27] wifi: mac80211: implement link switching
Date: Sat, 25 Mar 2023 22:33:44 +0800 [thread overview]
Message-ID: <ca5177fe-3b9f-2309-9afd-1d5e827540f7@quicinc.com> (raw)
In-Reply-To: <20220902161143.d99dfbe65c90.I92385ba882ec984a9a2ad18293173436657e82aa@changeid>
On 9/2/2022 10:12 PM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Implement an API function and debugfs file to switch
> active links.
>
> Also provide an async version of the API so drivers
> can call it in arbitrary contexts, e.g. while in the
> authorized callback.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> include/net/mac80211.h | 41 ++++++++
> net/mac80211/debugfs_netdev.c | 26 ++++++
> net/mac80211/ieee80211_i.h | 4 +
> net/mac80211/iface.c | 12 +++
> net/mac80211/key.c | 34 +++++++
> net/mac80211/key.h | 3 +
> net/mac80211/link.c | 171 ++++++++++++++++++++++++++++++++++
> 7 files changed, 291 insertions(+)
>
> ...
> +static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata,
> + u16 active_links)
> +{
> + struct ieee80211_bss_conf *link_confs[IEEE80211_MLD_MAX_NUM_LINKS];
> + struct ieee80211_local *local = sdata->local;
> + u16 old_active = sdata->vif.active_links;
> + unsigned long rem = old_active & ~active_links;
> + unsigned long add = active_links & ~old_active;
> + struct sta_info *sta;
> + unsigned int link_id;
> + int ret, i;
> +
> + if (!ieee80211_sdata_running(sdata))
> + return -ENETDOWN;
> +
> + if (sdata->vif.type != NL80211_IFTYPE_STATION)
> + return -EINVAL;
> +
> + /* cannot activate links that don't exist */
> + if (active_links & ~sdata->vif.valid_links)
> + return -EINVAL;
> +
> + /* nothing to do */
> + if (old_active == active_links)
> + return 0;
> +
> + for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++)
> + link_confs[i] = sdata_dereference(sdata->vif.link_conf[i],
> + sdata);
> +
> + if (add) {
> + sdata->vif.active_links |= active_links;
> + ret = drv_change_vif_links(local, sdata,
> + old_active,
> + sdata->vif.active_links,
> + link_confs);
> + if (ret) {
> + sdata->vif.active_links = old_active;
> + return ret;
> + }
> + }
> +
> + for_each_set_bit(link_id, &rem, IEEE80211_MLD_MAX_NUM_LINKS) {
> + struct ieee80211_link_data *link;
> +
> + link = sdata_dereference(sdata->link[link_id], sdata);
> +
> + /* FIXME: kill TDLS connections on the link */
> +
> + ieee80211_link_release_channel(link);
> + }
> +
> + list_for_each_entry(sta, &local->sta_list, list) {
> + if (sdata != sta->sdata)
> + continue;
> + ret = drv_change_sta_links(local, sdata, &sta->sta,
> + old_active,
> + old_active | active_links);
> + WARN_ON_ONCE(ret);
> + }
> +
> + ret = ieee80211_key_switch_links(sdata, rem, add);
I see ieee80211_key_switch_link() only handler the per-link(link_id >=
0) keys,
So I think lower driver also install the pairwise keys(link_id = -1) for
the added links at this moment?
> + WARN_ON_ONCE(ret);
> +
> + list_for_each_entry(sta, &local->sta_list, list) {
> + if (sdata != sta->sdata)
> + continue;
> + ret = drv_change_sta_links(local, sdata, &sta->sta,
> + old_active | active_links,
> + active_links);
> + WARN_ON_ONCE(ret);
> + }
> +
I see 2 times to call drv_change_sta_link() above, and with sequence
old_active->old_active | active_links->active_links
May I know is it has some design here?
> + for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
> + struct ieee80211_link_data *link;
> +
> + link = sdata_dereference(sdata->link[link_id], sdata);
> +
> + ret = ieee80211_link_use_channel(link, &link->conf->chandef,
> + IEEE80211_CHANCTX_SHARED);
For the 1st link of MLO connection/NON-MLO connetion, ieee80211_link_use_channel() is called before drv_change_sta_link(),
And now it is after drv_change_sta_link(), May I know is it also has some design here?
Also I see commit(8fb7e2ef4bab mac80211_hwsim: always activate all links) and ieee80211_if_parse_active_links()
will use ieee80211_set_active_links(), so I think ieee80211_set_active_links() has passed test case with some type lower driver/chip?
> + WARN_ON_ONCE(ret);
> +
> + ieee80211_link_info_change_notify(sdata, link,
> + BSS_CHANGED_ERP_CTS_PROT |
> + BSS_CHANGED_ERP_PREAMBLE |
> + BSS_CHANGED_ERP_SLOT |
> + BSS_CHANGED_HT |
> + BSS_CHANGED_BASIC_RATES |
> + BSS_CHANGED_BSSID |
> + BSS_CHANGED_CQM |
> + BSS_CHANGED_QOS |
> + BSS_CHANGED_TXPOWER |
> + BSS_CHANGED_BANDWIDTH |
> + BSS_CHANGED_TWT |
> + BSS_CHANGED_HE_OBSS_PD |
> + BSS_CHANGED_HE_BSS_COLOR);
> + ieee80211_mgd_set_link_qos_params(link);
> + }
> +
> + old_active = sdata->vif.active_links;
> + sdata->vif.active_links = active_links;
> +
> + if (rem) {
> + ret = drv_change_vif_links(local, sdata, old_active,
> + active_links, link_confs);
> + WARN_ON_ONCE(ret);
> + }
> +
> + return 0;
> +}
> +
...
next prev parent reply other threads:[~2023-03-25 14:34 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 14:12 [PATCH 00/27] another set of MLO patches Johannes Berg
2022-09-02 14:12 ` [PATCH 01/27] wifi: mac80211_hwsim: remove multicast workaround Johannes Berg
2022-09-02 14:12 ` [PATCH 02/27] wifi: mac80211: remove unused arg to ieee80211_chandef_eht_oper Johannes Berg
2022-09-02 14:12 ` [PATCH 03/27] wifi: mac80211_hwsim: check STA magic in change_sta_links Johannes Berg
2022-09-02 14:12 ` [PATCH 04/27] wifi: mac80211_hwsim: refactor RX a bit Johannes Berg
2022-09-02 14:12 ` [PATCH 05/27] wifi: mac80211: move link code to a new file Johannes Berg
2022-09-02 14:12 ` [PATCH 06/27] wifi: mac80211: mlme: assign link address correctly Johannes Berg
2022-09-02 14:12 ` [PATCH 07/27] wifi: mac80211_hwsim: warn on invalid link address Johannes Berg
2022-09-02 14:12 ` [PATCH 08/27] wifi: mac80211: use correct rx link_sta instead of default Johannes Berg
2022-09-02 14:12 ` [PATCH 09/27] wifi: mac80211: make smps_mode per-link Johannes Berg
2022-09-02 14:12 ` [PATCH 10/27] wifi: mac80211: isolate driver from inactive links Johannes Berg
2022-09-08 15:23 ` Wen Gong
2022-09-08 15:36 ` Johannes Berg
2022-09-08 15:51 ` Wen Gong
2022-09-08 15:52 ` Johannes Berg
2022-09-09 4:16 ` Wen Gong
2022-09-09 7:28 ` Johannes Berg
2022-09-09 8:38 ` Wen Gong
2022-09-09 8:58 ` Wen Gong
2022-09-28 15:20 ` Wen Gong
2022-09-28 15:28 ` Johannes Berg
2022-10-11 4:07 ` Wen Gong
2022-10-11 7:26 ` Johannes Berg
2023-04-04 2:54 ` Wen Gong
2023-04-11 7:32 ` Johannes Berg
2023-04-17 14:07 ` Wen Gong
2023-04-18 8:15 ` Johannes Berg
2023-04-18 8:59 ` Wen Gong
2023-04-18 9:11 ` Johannes Berg
2023-04-18 9:22 ` Wen Gong
2023-04-18 9:31 ` Johannes Berg
2023-04-18 9:37 ` Wen Gong
2023-04-18 9:38 ` Johannes Berg
2023-04-18 9:44 ` Wen Gong
2023-04-18 10:18 ` Johannes Berg
[not found] ` <5bd1776e-0691-d0a8-d198-e5b4ee676494@quicinc.com>
2023-04-18 10:47 ` Johannes Berg
2023-04-04 3:28 ` Wen Gong
2023-04-11 7:38 ` Johannes Berg
2023-04-17 14:13 ` Wen Gong
2023-04-18 8:18 ` Johannes Berg
2023-04-18 9:27 ` Wen Gong
2023-04-18 9:34 ` Johannes Berg
2023-04-18 9:52 ` Wen Gong
2023-05-24 7:39 ` Wen Gong
2023-05-24 7:41 ` Wen Gong
2023-06-14 18:32 ` Johannes Berg
2023-06-15 2:26 ` Wen Gong
2023-06-15 7:56 ` Johannes Berg
2023-06-21 7:55 ` Wen Gong
2023-06-27 11:02 ` Wen Gong
2023-06-30 9:32 ` Wen Gong
2023-05-10 11:06 ` Wen Gong
2023-05-10 11:24 ` Johannes Berg
2023-05-10 12:25 ` Wen Gong
2023-05-10 12:25 ` Johannes Berg
2022-09-02 14:12 ` [PATCH 11/27] wifi: mac80211: add ieee80211_find_sta_by_link_addrs API Johannes Berg
2022-09-02 14:12 ` [PATCH 12/27] wifi: mac80211_hwsim: skip inactive links on TX Johannes Berg
2022-09-02 14:12 ` [PATCH 13/27] wifi: mac80211_hwsim: track active STA links Johannes Berg
2022-09-02 14:12 ` [PATCH 14/27] wifi: mac80211: mlme: refactor QoS settings code Johannes Berg
2022-09-02 14:12 ` [PATCH 15/27] wifi: mac80211: extend ieee80211_nullfunc_get() for MLO Johannes Berg
2022-09-02 14:12 ` [PATCH 16/27] wifi: mac80211_hwsim: send NDP for link (de)activation Johannes Berg
2022-09-02 14:12 ` [PATCH 17/27] wifi: mac80211_hwsim: fix multi-channel handling in netlink RX Johannes Berg
2022-09-02 14:12 ` [PATCH 18/27] wifi: nl80211: add MLD address to assoc BSS entries Johannes Berg
2022-09-02 14:12 ` [PATCH 19/27] wifi: mac80211: call drv_sta_state() under sdata_lock() in reconfig Johannes Berg
2022-09-02 14:12 ` [PATCH 20/27] wifi: mac80211: add vif/sta link RCU dereference macros Johannes Berg
2022-09-02 14:12 ` [PATCH 21/27] wifi: mac80211: set up beacon timing config on links Johannes Berg
2022-09-02 14:12 ` [PATCH 22/27] wifi: mac80211: keep A-MSDU data in sta and per-link Johannes Berg
2022-09-02 14:12 ` [PATCH 23/27] wifi: mac80211: fix double SW scan stop Johannes Berg
2022-09-02 14:12 ` [PATCH 24/27] wifi: mac80211: implement link switching Johannes Berg
2023-03-25 14:33 ` Wen Gong [this message]
2023-03-27 8:31 ` Johannes Berg
2023-03-27 8:40 ` Wen Gong
2023-03-27 9:04 ` Johannes Berg
2023-03-27 9:10 ` Wen Gong
2023-03-28 7:37 ` Wen Gong
2023-03-28 7:39 ` Johannes Berg
2023-04-03 14:15 ` Wen Gong
2023-04-11 10:16 ` Johannes Berg
2023-04-03 14:21 ` Wen Gong
2023-04-11 10:18 ` Johannes Berg
2022-09-02 14:12 ` [PATCH 25/27] wifi: mac80211_hwsim: always activate all links Johannes Berg
2022-09-02 14:12 ` [PATCH 26/27] wifi: mac80211: prevent 4-addr use on MLDs Johannes Berg
2022-09-02 14:12 ` [PATCH 27/27] wifi: mac80211: prevent VLANs " Johannes Berg
2022-09-06 7:18 ` [PATCH 00/27] another set of MLO patches Wen Gong
2022-09-06 7:28 ` Johannes Berg
2022-09-06 7:58 ` Wen Gong
2022-09-06 8:03 ` Johannes Berg
2022-09-06 8:42 ` Wen Gong
2022-09-12 13:17 ` Otcheretianski, Andrei
2022-09-13 4:26 ` Wen Gong
2022-09-28 15:12 ` Wen Gong
2022-10-11 2:28 ` Wen Gong
2022-10-19 10:04 ` wifi: hostapd:/wpa_supplicant MLO " Wen Gong
2022-10-19 13:31 ` Otcheretianski, Andrei
2022-11-28 8:45 ` Wen Gong
2022-11-28 14:05 ` Otcheretianski, Andrei
2022-11-29 2:06 ` Wen Gong
2022-11-29 6:59 ` Otcheretianski, Andrei
2022-11-29 7:04 ` Wen Gong
2022-09-07 3:34 ` Wen Gong
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=ca5177fe-3b9f-2309-9afd-1d5e827540f7@quicinc.com \
--to=quic_wgong@quicinc.com \
--cc=ath11k@lists.infradead.org \
--cc=ath12k@lists.infradead.org \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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