Re: [PATCH net-next] devlink: Require devlink lock during device reload

From
Jiri Pirko <jiri@resnulli.us>
Date
2021-11-01 15:03:14
Also in
lkml
Reply to
Leon Romanovsky, 2021-10-31
Sun, Oct 31, 2021 at 06:35:56PM CET, leon@kernel.org wrote:
From: Leon Romanovsky <leonro@nvidia.com>

Devlink reload was implemented as a special command which does _SET_
operation, but doesn't take devlink->lock, while recursive devlink
calls that were part of .reload_up()/.reload_down() sequence took it.

This fragile flow was possible due to holding a big devlink lock
(devlink_mutex), which effectively stopped all devlink activities,
even unrelated to reloaded devlink.

So let's make sure that devlink reload behaves as other commands and
use special nested locking primitives with a depth of 1. Such change
opens us to a venue of removing devlink_mutex completely, while keeping
devlink locking complexity in devlink.c.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Looks fine to me.

Reviewed-by: Jiri Pirko <redacted>
Thread (42 messages) 42 messages, 5 authors, last reply 2021-11-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help