From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
edumazet@google.com, jacob.e.keller@intel.com, saeedm@nvidia.com,
moshe@nvidia.com
Subject: Re: [patch net 3/3] devlink: fix a deadlock with nested instances during namespace remove
Date: Wed, 10 May 2023 08:11:41 +0200 [thread overview]
Message-ID: <ZFs1nezX0OiDg/1g@nanopsycho> (raw)
In-Reply-To: <20230509202444.30436b9f@kernel.org>
Wed, May 10, 2023 at 05:24:44AM CEST, kuba@kernel.org wrote:
>On Tue, 9 May 2023 12:09:36 +0200 Jiri Pirko wrote:
>> The commit 565b4824c39f ("devlink: change port event netdev notifier
>> from per-net to global") changed original per-net notifier to be global
>> which fixed the issue of non-receiving events of netdev uninit if that
>> moved to a different namespace. That worked fine in -net tree.
>>
>> However, later on when commit ee75f1fc44dd ("net/mlx5e: Create
>> separate devlink instance for ethernet auxiliary device") and
>> commit 72ed5d5624af ("net/mlx5: Suspend auxiliary devices only in
>> case of PCI device suspend") were merged, a deadlock was introduced
>> when removing a namespace with devlink instance with another nested
>> instance.
>>
>> Here there is the bad flow example resulting in deadlock with mlx5:
>> net_cleanup_work -> cleanup_net (takes down_read(&pernet_ops_rwsem) ->
>> devlink_pernet_pre_exit() -> devlink_reload() ->
>> mlx5_devlink_reload_down() -> mlx5_unload_one_devl_locked() ->
>> mlx5_detach_device() -> del_adev() -> mlx5e_remove() ->
>> mlx5e_destroy_devlink() -> devlink_free() ->
>> unregister_netdevice_notifier() (takes down_write(&pernet_ops_rwsem)
>
>Why don't we have a single, static notifier for all of devlink?
>Why the per device/per port notifiers?
>
>We have the devlink port pointer in struct net_device, resolving from
>a global event to the correct devlink instance is trivial.
Okay, that might work. Let me explore that.
next prev parent reply other threads:[~2023-05-10 6:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 10:09 [patch net 3/3] devlink: fix a deadlock with nested instances during namespace remove Jiri Pirko
2023-05-09 10:09 ` [patch net 1/3] net: allow to ask per-net netdevice notifier to follow netdev dynamically Jiri Pirko
2023-05-09 10:09 ` [patch net 2/3] devlink: make netdev notifier per-port Jiri Pirko
2023-05-09 10:09 ` [patch net 3/3] devlink: change port event netdev notifier to be per-net and following netdev Jiri Pirko
2023-05-09 20:13 ` [patch net 3/3] devlink: fix a deadlock with nested instances during namespace remove Jacob Keller
2023-05-10 3:24 ` Jakub Kicinski
2023-05-10 6:11 ` Jiri Pirko [this message]
2023-05-10 18:27 ` Jacob Keller
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=ZFs1nezX0OiDg/1g@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@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