net/mlx5: introduce thread safe linked list cache
authorXueming Li <xuemingl@nvidia.com>
Wed, 28 Oct 2020 09:33:40 +0000 (17:33 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:35:04 +0000 (23:35 +0100)
commit1ff37bee32579fddd4c8036c2b01d440db3e3d1b
treee0fbfe0bcef468bb0ddeaeecb7b32d638ccc82bc
parentf961fd490fd438c7ae64620bb62264c3f52cd2df
net/mlx5: introduce thread safe linked list cache

New API of linked list for cache:
- Optimized for small amount cache list.
- Optimized for read-most list.
- Thread safe.
- Since number of entries are limited, entries allocated by API.
- For dynamic entry size, pass 0 as entry size, then the creation
callback allocate the entry.
- Since number of entries are limited, no need to use indexed pool to
allocate memory. API will remove entry and free with mlx5_free.
- Search API is not supposed to be used in multi-thread.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5_utils.c
drivers/net/mlx5/mlx5_utils.h