Netdev List
 help / color / mirror / Atom feed
From: Cosmin Ratiu <cratiu@nvidia.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Tariq Toukan <tariqt@nvidia.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	Carolina Jubran <cjubran@nvidia.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	Dragos Tatulea <dtatulea@nvidia.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] wifi: wext: Limit notifier event flushes to the device's netns
Date: Wed, 21 Oct 2026 14:57:25 +0000	[thread overview]
Message-ID: <1f19a52be17394943b4269606719ebfc5cc99226.camel@nvidia.com> (raw)
In-Reply-To: <20261021144111.611840-1-cratiu@nvidia.com>

On Wed, 2026-10-21 at 17:41 +0300, Cosmin Ratiu wrote:
> With mlx5 netdev instance locking enabled, registering an IPoIB
> netdev
> calls the WEXT notifier while holding the instance mutex. Its call to
> wireless_nlevent_flush() takes net_rwsem to walk every namespace,
> completing the following lockdep dependency cycle:
> 
>   netdev instance mutex -> net_rwsem (read) -> GID table mutex
>     -> event_handler_rwsem (read) -> netdev instance mutex
> 
> RoCE GID enumeration takes the GID table mutex under net_rwsem. GID
> updates dispatch events under the table mutex, taking
> event_handler_rwsem.
> The IPoIB event handler takes the netdev instance mutex in
> ipoib_queue_work() to traverse child interfaces.
> 
> The all-namespace walk originated in the single global worker
> servicing
> per-namespace WEXT queues. The ordering fixes later reused that
> routine
> in netdevice notifiers to prevent delayed WEXT RTM_NEWLINK messages
> from
> following RTM_DELLINK or reporting stale interface flags. A notifier
> only
> needs to drain the affected device's namespace; there is no reason
> for it
> to walk and flush all namespaces.
> 
> Pass dev_net(dev) from both notifier callers and make the flush
> helper
> operate on that namespace. Keep the all-namespace walk and net_rwsem
> in
> the existing worker. This removes the instance-mutex -> net_rwsem
> dependency while retaining synchronous flushing from the notifiers.
> 
> It may seem strange that the fix for a lock cycle across multiple
> subsystems lies in a completely unrelated part of the code, but this
> seemed the most justified lock cycle edge to break.
> 
> Issue: 5331015
> Fixes: 8f7b00307bf1 ("net/mlx5e: Convert mlx5 netdevs to instance
> locking")
> Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
> Change-Id: I98d7e77ffc9fa0ce72296d93c200da8fe1db378e

Sigh...Turns out I forgot to remove the "Issue" and the "Change-Id"
tags.
So there will be a v2 without those, but please let me know about the
rest of the patch until then...

Cosmin.


  reply	other threads:[~2026-10-21 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 14:41 [PATCH] wifi: wext: Limit notifier event flushes to the device's netns Cosmin Ratiu
2026-10-21 14:57 ` Cosmin Ratiu [this message]
2026-10-21 15:21 ` 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=1f19a52be17394943b4269606719ebfc5cc99226.camel@nvidia.com \
    --to=cratiu@nvidia.com \
    --cc=cjubran@nvidia.com \
    --cc=dtatulea@nvidia.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@nvidia.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