net/mlx5e: Reduce eswitch mode_lock protection context
authorJianbo Liu <jianbol@nvidia.com>
Wed, 11 Oct 2023 03:38:29 +0000 (03:38 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 5 Dec 2023 06:11:52 +0000 (22:11 -0800)
commitbaac8351f74c543896b8fd40138b7ad9365587a3
tree48ae340dab0e72d5dd0555a7c061e098b569b925
parentc2bf84f1d1a1595dcc45fe867f0e02b331993fee
net/mlx5e: Reduce eswitch mode_lock protection context

Currently eswitch mode_lock is so heavy, for example, it's locked
during the whole process of the mode change, which may need to hold
other locks. As the mode_lock is also used by IPSec to block mode and
encap change now, it is easy to cause lock dependency.

Since some of protections are also done by devlink lock, the eswitch
mode_lock is not needed at those places, and thus the possibility of
lockdep issue is reduced.

Fixes: c8e350e62fc5 ("net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdev")
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c