]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5: Devcom, serialize devcom registration
authorShay Drory <shayd@nvidia.com>
Tue, 2 May 2023 10:36:42 +0000 (13:36 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 23 May 2023 05:38:06 +0000 (22:38 -0700)
commit1f893f57a3bf9fe1f4bcb25b55aea7f7f9712fe7
tree9859e423a6ab816c5cfae39588c74ffeea8e8737
parentaf87194352cad882d787d06fb7efa714acd95427
net/mlx5: Devcom, serialize devcom registration

From one hand, mlx5 driver is allowing to probe PFs in parallel.
From the other hand, devcom, which is a share resource between PFs, is
registered without any lock. This might resulted in memory problems.

Hence, use the global mlx5_dev_list_lock in order to serialize devcom
registration.

Fixes: fadd59fc50d0 ("net/mlx5: Introduce inter-device communication mechanism")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c