From: Miquel Raynal <miquel.raynal@bootlin.com>
To: 이건형 <leegun25@proton.me>
Cc: alex.aring@gmail.com, stefan@datenfreihafen.org,
linux-wpan@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net] mac802154: take RTNL around ASSOC RESP transmission
Date: Thu, 26 Nov 2026 12:05:09 +0100 [thread overview]
Message-ID: <8733snyhsq.fsf@bootlin.com> (raw)
In-Reply-To: <-4vARCf0AvznsCw8bnUA-0HXh6HLIvZclkIK_aUJIf4ULKof8WuzgWidE8XZJi5Cndbt9iMVb_IiHNVA4W6GDQlym0Ny8mSRaxRCojci95o=@proton.me> ("이건형"'s message of "Wed, 25 Nov 2026 22:35:11 +0000")
On 25/11/2026 at 22:35:11 GMT, 이건형 <leegun25@proton.me> wrote:
> Hi Miquèl,
>
> On Wednesday, November 25th, 2026 at 03:48, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
>> First let's approach the numbers. 4ms is on a locally run simulator. You
>> are fixing a subsystem that plays with radios. A physical IEEE802154
>> radio would probably bring the usual bad case to > 100ms, and worth case
>> would be above the 1s boundary. So taking the RTNL lock as you do it
>> there would no longer warn in dev mode, but might lead to a DoS.
>
> Thanks for pointing this out. I also found that taking the RTNL in
> the association response worker causes association between two PHYs
> on the same host to time out in hwsim.
>
>> Reviewing your patch makes me realize we do something even worse: up to
>> 10s waiting with the RTNL when waiting for an association response (for
>> which we are ouselves the initiator). That is slightly less a problem
>> since it is not remotely triggerable like the approach you propose, but
>> still.
>>
>> I don't remember why we *had* to take the RTNL in the mlme_tx path.
>>
>> Alex, maybe you remember why?
>
> Commit ddd9ee7cda12 added the RTNL to prevent ndo_stop() from running
> during MLME TX.
>
> I also found your 2022 device_lock proposal:
>
> https://lore.kernel.org/netdev/20220826144049.256134-11-miquel.raynal@bootlin.com/
>
> I tried adding a per-PHY mutex shared by MLME TX, ndo_open() and
> ndo_stop(). With this change, the association response worker uses
> the new mutex without taking the RTNL. The existing MLME TX wrappers
> retain their RTNL requirements.
>
> In mac802154_hwsim, association between two PHYs on the same host
> works, and I saw no warnings or hangs during 5,000 association
> requests and 100 interface down/up cycles.
>
> With an artificial TX delay of 1 second, bringing the interface
> down still takes about 900 ms. ndo_stop() can still wait for an
> in-flight association response TX while holding the RTNL.
>
> As Alex pointed out in the 2022 discussion, page/channel changes
> also need to be considered. These are not covered by the new mutex.
>
> Would this be a reasonable direction for the fix? If so, I can send
> a v2.
Yes please, let's see what it would look like.
Thanks,
Miquèl
next prev parent reply other threads:[~2026-11-26 11:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 15:08 [PATCH net] mac802154: take RTNL around ASSOC RESP transmission Lee Keon-Hyeong
2026-11-24 18:48 ` Miquel Raynal
2026-11-25 22:35 ` 이건형
2026-11-26 11:05 ` Miquel Raynal [this message]
2026-11-25 15:08 ` netdev-bot+sashiko
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=8733snyhsq.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=alex.aring@gmail.com \
--cc=leegun25@proton.me \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stefan@datenfreihafen.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