diff options
author | Daniel Jurgens | 2018-01-04 16:25:31 +0100 |
---|---|---|
committer | Jason Gunthorpe | 2018-01-08 19:42:20 +0100 |
commit | 734dc065fc41f6143ff88225aa5d335cb1e0f6aa (patch) | |
tree | 4c6bd43972f743d469b5c9d1f875cc9bd6ca2a26 /include/linux/mlx5/driver.h | |
parent | IB/mlx5: Add support for DC target QP (diff) | |
download | kernel-qcow2-linux-734dc065fc41f6143ff88225aa5d335cb1e0f6aa.tar.gz kernel-qcow2-linux-734dc065fc41f6143ff88225aa5d335cb1e0f6aa.tar.xz kernel-qcow2-linux-734dc065fc41f6143ff88225aa5d335cb1e0f6aa.zip |
net/mlx5: Fix race for multiple RoCE enable
There are two potential problems with the existing implementation.
1. Enable and disable can race after the atomic operations.
2. If a command fails the refcount is left in an inconsistent state.
Introduce a lock and perform error checking.
Fixes: a6f7d2aff623 ("net/mlx5: Add support for multiple RoCE enable")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/driver.h')
-rw-r--r-- | include/linux/mlx5/driver.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 0776554f18dc..5b0443c9d337 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -835,7 +835,7 @@ struct mlx5_core_dev { struct mlx5e_resources mlx5e_res; struct { struct mlx5_rsvd_gids reserved_gids; - atomic_t roce_en; + u32 roce_en; } roce; #ifdef CONFIG_MLX5_FPGA struct mlx5_fpga_device *fpga; |