]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: E-Switch, Change mode lock from mutex to rw semaphore
authorRoi Dayan <roid@nvidia.com>
Wed, 16 Sep 2020 07:11:42 +0000 (10:11 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 16 Mar 2021 23:48:42 +0000 (16:48 -0700)
commitaa5059740b613c832decd4a25d5c0e7411be3b37
tree9ed2f7e753c6cb5dc2865591eb2ec897f7f1ada6
parentbdbdde7f1648e1f1add94b8e403818e9c5ac6d9a
net/mlx5: E-Switch, Change mode lock from mutex to rw semaphore

E-Switch mode change routine will take the write lock to prevent any
consumer to access the E-Switch resources while E-Switch is going
through a mode change.

In the next patch
E-Switch consumers (e.g vport representors) will take read_lock prior to
accessing E-Switch resources to prevent E-Switch mode changing in the
middle of the operation.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
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