]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: DR, ICM pool memory allocator
authorAlex Vesker <valex@mellanox.com>
Mon, 19 Aug 2019 10:46:40 +0000 (13:46 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 3 Sep 2019 19:54:20 +0000 (12:54 -0700)
commit0eba1dcc5fed17232f96b22714b9f94ee44a639a
treee758a8c3d624487bafbdd7ba4972806ad960192c
parentaaebe5c2aa10009864408acdaaca4dbc8cf00c41
net/mlx5: DR, ICM pool memory allocator

ICM device memory is used for writing steering rules (STEs) to the NIC.
An ICM memory pool allocator was implemented to manage the required
memory. The pool consists of buckets, a bucket per chunk size.
Once a bucket is empty we will cut a row of memory from the latest
allocated MR, if the MR size is not sufficient we will allocate a new MR.
HW design requires that chunks memory address should be aligned to the
chunk size, this is the reason for managing the MR with row size that
insures memory alignment.
Current design is greedy in memory but provides quick allocation times
in steady state.

Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Erez Shitrit <erezsh@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c [new file with mode: 0644]