[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_SMzyR0SaS2J2kT@LQ3V64L9R2>
Date: Mon, 7 Apr 2025 19:41:19 -0700
From: Joe Damato <jdamato@...tly.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, andrew+netdev@...n.ch, horms@...nel.org,
sdf@...ichev.me, hramamurthy@...gle.com, kuniyu@...zon.com
Subject: Re: [PATCH net-next 3/8] netdev: add "ops compat locking" helpers
On Mon, Apr 07, 2025 at 12:01:12PM -0700, Jakub Kicinski wrote:
> Add helpers to "lock a netdev in a backward-compatible way",
> which for ops-locked netdevs will mean take the instance lock.
> For drivers which haven't opted into the ops locking we'll take
> rtnl_lock.
>
> The scoped foreach is dropping and re-taking the lock for each
> device, even if prev and next are both under rtnl_lock.
> I hope that's fine since we expect that netdev nl to be mostly
> supported by modern drivers, and modern drivers should also
> opt into the instance locking.
>
> Note that these helpers are mostly needed for queue related state,
> because drivers modify queue config in their ops in a non-atomic
> way. Or differently put, queue changes don't have a clear-cut API
> like NAPI configuration. Any state that can should just use the
> instance lock directly, not the "compat" hacks.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> include/net/netdev_lock.h | 16 ++++++++++++
> net/core/dev.h | 15 ++++++++++++
> net/core/dev.c | 51 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 82 insertions(+)
>
Reviewed-by: Joe Damato <jdamato@...tly.com>
Powered by blists - more mailing lists