net/mlx5: Lock mlx5 devlink reload callbacks
authorMoshe Shemesh <moshe@nvidia.com>
Thu, 28 Jul 2022 15:53:45 +0000 (18:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Jul 2022 04:58:46 +0000 (21:58 -0700)
commit84a433a40d0ebf3bbf36b8bfa58c6f45dc782344
tree29d14ccf6e933e6f50d2d003c7623a7b65ceec2c
parentc12f4c6ac3b49bdf38b31f7362cfde5ed63ea7cb
net/mlx5: Lock mlx5 devlink reload callbacks

Change devlink instance locks in mlx5 driver to have devlink reload
callbacks locked, while keeping all driver paths which lead to devl_ API
functions called by the driver locked.

Add mlx5_load_one_devl_locked() and mlx5_unload_one_devl_locked() which
are used by the paths which are already locked such as devlink reload
callbacks.

This patch makes the driver use devl_ API also for traps register as
these functions are called from the driver paths parallel to reload that
requires locking now.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/dev.c
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
drivers/net/ethernet/mellanox/mlx5/core/sriov.c