[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250327145043.0d852f86@kernel.org>
Date: Thu, 27 Mar 2025 14:50:43 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Stanislav Fomichev <stfomichev@...il.com>
Cc: Stanislav Fomichev <sdf@...ichev.me>, netdev@...r.kernel.org,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com
Subject: Re: [PATCH net v2 08/11] docs: net: document netdev notifier
expectations
On Thu, 27 Mar 2025 13:57:01 -0700 Stanislav Fomichev wrote:
> That sounds very sensible, let me try it out and run the tests.
> I'll have to drop the lock twice, once for NETDEV_UNREGISTER
> and another time for move_netdevice_notifiers_dev_net, but since
> the device is unlisted, nothing should touch it (in theory)?
Yup, and/or we can adjust if we find a reason to, I don't think
the ordering of the actions in netns changes is precisely intentional.
> netif_change_net_namespace is already the first thing that happens
> in do_setlink, so I won't be converting it to dev_xxx (lmk if I
> miss something here).
I thought you could move it outside the lock in do_setlink()
and have [netif -> dev]_change_net_namespace take the lock.
Dropping and taking the lock in a callee is a bit bad, so
I'd prefer if the netif_ / "I want to switch netns but I'm already
holding the lock" version of _change_net_namespace didn't exist
at all.
Powered by blists - more mailing lists