net/mlx5: minimize list critical sections
authorMatan Azrad <matan@nvidia.com>
Tue, 13 Jul 2021 08:44:43 +0000 (11:44 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 15 Jul 2021 13:19:11 +0000 (15:19 +0200)
commit0b4ce17a11ad2a1321549d82b8767e1377cc4efe
tree7e215632b0f1be3a04d9dfca1293320a4ea08495
parent491b7137ff774bf0cbb8a1e8aff3d5d130c8f046
net/mlx5: minimize list critical sections

The mlx5 internal list utility is thread safe.

In order to synchronize list access between the threads, a RW lock is
taken for the critical sections.

The create\remove\clone\clone_free operations are in the critical
sections.

These operations are heavy and make the critical sections heavy because
they are used for memory and other resources allocations\deallocations.

Moved out the operations from the critical sections and use generation
counter in order to detect parallel allocations.

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
drivers/net/mlx5/mlx5_utils.c
drivers/net/mlx5/mlx5_utils.h