From: Kalle Valo <kvalo@kernel.org>
To: Baochen Qiang <quic_bqiang@quicinc.com>
Cc: <ath12k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 1/8] wifi: ath12k: Add MLO station state change handling
Date: Tue, 12 Nov 2024 18:03:13 +0200 [thread overview]
Message-ID: <877c984eym.fsf@kernel.org> (raw)
In-Reply-To: <f75d7222-514b-4c6f-985d-e6ffd67e317a@quicinc.com> (Baochen Qiang's message of "Thu, 7 Nov 2024 10:26:56 +0800")
Baochen Qiang <quic_bqiang@quicinc.com> writes:
> On 11/6/2024 10:26 PM, Kalle Valo wrote:
>> +static int ath12k_mac_assign_link_sta(struct ath12k_hw *ah,
>> + struct ath12k_sta *ahsta,
>> + struct ath12k_link_sta *arsta,
>> + struct ath12k_vif *ahvif,
>> + u8 link_id)
>> +{
>> + struct ieee80211_sta *sta = ath12k_ahsta_to_sta(ahsta);
>> + struct ieee80211_link_sta *link_sta;
>> + struct ath12k_link_vif *arvif;
>> +
>> + lockdep_assert_wiphy(ah->hw->wiphy);
>> +
>> + if (!arsta || link_id >= IEEE80211_MLD_MAX_NUM_LINKS)
>> + return -EINVAL;
>> +
>> + arvif = wiphy_dereference(ah->hw->wiphy, ahvif->link[link_id]);
>> + if (!arvif)
>> + return -EINVAL;
>> +
>> + memset(arsta, 0, sizeof(*arsta));
>> +
>> + link_sta = wiphy_dereference(ah->hw->wiphy, sta->link[link_id]);
>> + if (!link_sta)
>> + return -EINVAL;
>> +
>> + ether_addr_copy(arsta->addr, link_sta->addr);
>> +
>> + /* logical index of the link sta in order of creation */
>> + arsta->link_idx = ahsta->num_peer++;
>> +
>> + arsta->link_id = link_id;
>> + ahsta->links_map |= BIT(arsta->link_id);
>
> would be better to put this after rcu_assign_pointer()?
My thinking is that it's racy anyway so it doesn't really matter.
links_map is not really protected properly right now but luckily there's
only one function which accesses outside of the wiphy lock. My plan is
to fix that in a later patch.
>> + arsta->arvif = arvif;
>> + arsta->ahsta = ahsta;
>> + arsta->state = IEEE80211_STA_NONE;
>> + wiphy_work_init(&arsta->update_wk, ath12k_sta_rc_update_wk);
>> +
>> + rcu_assign_pointer(ahsta->link[link_id], arsta);
>> +
>> + synchronize_rcu();
>
> what are we waiting for here?
That's a good question. I didn't analyse that thoroughly but I'm just
making sure here that all readers have access to the new arsta before we
return to mac80211. The delay shouldn't be that long anyway, I hope.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2024-11-12 16:07 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 14:26 [PATCH 0/8] [0/8] wifi: ath12k: MLO support part 3 Kalle Valo
2024-11-06 14:26 ` [PATCH 1/8] wifi: ath12k: Add MLO station state change handling Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
2024-11-07 2:26 ` Baochen Qiang
2024-11-12 16:03 ` Kalle Valo [this message]
2024-11-13 2:33 ` Baochen Qiang
2024-11-20 15:57 ` Kalle Valo
2024-11-07 2:45 ` Baochen Qiang
2024-11-12 17:10 ` Kalle Valo
2024-11-13 2:55 ` Baochen Qiang
2024-11-20 19:32 ` Kalle Valo
2024-11-21 3:35 ` Baochen Qiang
2024-11-21 14:51 ` Kalle Valo
2024-11-06 14:26 ` [PATCH 2/8] wifi: ath12k: support change_sta_links() mac80211 op Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
2024-11-07 7:14 ` Baochen Qiang
2024-11-12 16:55 ` Kalle Valo
2024-11-12 17:11 ` Kalle Valo
2024-11-06 14:26 ` [PATCH 3/8] wifi: ath12k: add primary link for data path operations Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
2024-11-06 14:26 ` [PATCH 4/8] wifi: ath12k: use arsta instead of sta Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
2024-11-06 14:26 ` [PATCH 5/8] wifi: ath12k: add reo queue lookup table for ML peers Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
2024-11-06 14:26 ` [PATCH 6/8] wifi: ath12k: modify chanctx iterators for MLO Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
2024-11-06 14:26 ` [PATCH 7/8] wifi: ath12k: Use mac80211 vif's link_conf instead of bss_conf Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
2024-11-06 14:26 ` [PATCH 8/8] wifi: ath12k: Use mac80211 sta's link_sta instead of deflink Kalle Valo
2024-11-06 16:33 ` Jeff Johnson
-- strict thread matches above, loose matches on Subject: below --
2024-11-21 15:57 [PATCH 0/8] [0/8] wifi: ath12k: MLO support part 3 Kalle Valo
2024-11-21 15:57 ` [PATCH 1/8] wifi: ath12k: Add MLO station state change handling Kalle Valo
2024-11-25 17:03 ` Kalle Valo
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=877c984eym.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_bqiang@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