Subject: Re: [PATCH net-next-mlx5 02/13] net/mlx5: Add new driver lib for mappings unique ids to data

From: Leon Romanovsky <[email-masked]>
Date: Tue, 21 Jan 2020 21:04:20 +0200

On Tue, Jan 21, 2020 at 06:16:11PM +0200, Paul Blakey wrote:
> Add a new interface for mapping data to a given id range (max_id),
> and back again. It supports variable sized data, and different
> allocators, and read/write locks.
>
> This mapping interface also supports delaying the mapping removal via
> a workqueue. This is for cases where we need the mapping to have
> some grace period in regards to finding it back again, for example
> for packets arriving from hardware that were marked with by a rule
> with an old mapping that no longer exists.
>
> We also provide a first implementation of the interface is idr_mapping
> that uses idr for the allocator and a mutex lock for writes
> (add/del, but not for find).
>
> Signed-off-by: Paul Blakey <[email-masked]>
> Reviewed-by: Oz Shlomo <[email-masked]>
> Reviewed-by: Mark Bloch <[email-masked]>
> ---

I have many issues with this patch, but two main are:
1. This is general implementation without proper documentation and test
which doesn't belong to driver code.
2. It looks very similar to already existing code, for example xarray.

Thanks