From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Lachlan Hodges <lachlan.hodges@morsemicro.com>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH wireless-next] wifi: mac80211: Remove deleted sta links in ieee80211_ml_reconf_work()
Date: Mon, 9 Mar 2026 09:20:09 +0100 [thread overview]
Message-ID: <aa6CuVi3BZxLBcPA@lore-desk> (raw)
In-Reply-To: <be1c90f6be71f6118590b0add4d657cd79d2ea2b.camel@sipsolutions.net>
[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]
On Mar 09, Johannes Berg wrote:
> On Sun, 2026-03-08 at 14:28 +0100, Lorenzo Bianconi wrote:
> > > > + rcu_read_lock();
> > > > + sta = sta_info_get(sdata, sdata->vif.cfg.ap_addr);
> > > > + if (sta) {
> > > > + unsigned long removed_links = sdata->u.mgd.removed_links;
> > > > + unsigned int link_id;
> > > > +
> > > > + for_each_set_bit(link_id, &removed_links,
> > > > + IEEE80211_MLD_MAX_NUM_LINKS)
> > > > + ieee80211_sta_free_link(sta, link_id);
> > > > + }
> > > > + rcu_read_unlock();
> > > > +
> > >
> > > Could use scoped_guard(rcu) instead?
> >
> > I do not have a strong opinion here.
> > @Johannes: Which one do you prefer?
> >
>
> To answer the literal question: No strong preference I guess, given that
> there's no error path here this seems fine, and the scoped version would
> just add another indentation level.
>
> But you really should just remove the rcu_read_lock/unlock anyway, it's
> not needed since this holds wiphy mutex, which is sufficient to access
> the STA table etc.
ack, I will fix it in v2.
>
> Also, I think you need ieee80211_sta_remove_link() to tell the driver?
I think we already inform the driver running ieee80211_set_active_links() so
ieee80211_sta_remove_link() seems redundant, right?
ieee80211_set_active_links() -> _ieee80211_set_active_links() -> drv_change_sta_links()
>
> And I realized another thing - this needs to destroy TDLS stations that
> were on the link being removed, but maybe that's a separate commit.
Do you mean ieee80211_teardown_tdls_peers()? Is it done in
_ieee80211_set_active_links() too?
Regards,
Lorenzo
>
> johannes
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-03-09 8:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 18:45 [PATCH wireless-next] wifi: mac80211: Remove deleted sta links in ieee80211_ml_reconf_work() Lorenzo Bianconi
2026-03-08 7:34 ` Lachlan Hodges
2026-03-08 13:28 ` Lorenzo Bianconi
2026-03-09 7:14 ` Johannes Berg
2026-03-09 8:20 ` Lorenzo Bianconi [this message]
2026-03-09 8:22 ` Johannes Berg
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=aa6CuVi3BZxLBcPA@lore-desk \
--to=lorenzo@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=lachlan.hodges@morsemicro.com \
--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