lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Jan 2020 15:51:05 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Paul Blakey <paulb@...lanox.com>
Cc:     Saeed Mahameed <saeedm@...lanox.com>,
        Oz Shlomo <ozsh@...lanox.com>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Vlad Buslov <vladbu@...lanox.com>,
        David Miller <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Jiri Pirko <jiri@...nulli.us>
Subject: Re: [PATCH net-next-mlx5 02/13] net/mlx5: Add new driver lib for
 mappings unique ids to data

On Wed, Jan 22, 2020 at 12:17:44PM +0000, Paul Blakey wrote:
>
> On 1/21/2020 9:04 PM, Leon Romanovsky wrote:
> > 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 <paulb@...lanox.com>
> >> Reviewed-by: Oz Shlomo <ozsh@...lanox.com>
> >> Reviewed-by: Mark Bloch <markb@...lanox.com>
> >> ---
> > 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
> This data structure uses idr (currently wrapper for xarray) but also a
> hash table, refcount, and
> generic allocators.
> The hashtable is used on top of the idr to find if data added to the
> mapping already exists, if it
> does it updates a refcount.
> We also have some special delayed removal for our use case.
> The addition to xarray is translation from data to hash function. It is
> something that doesn't exist
> and needs extra code. IDR was chosen as being simplified interface of
> xarray and it is good enough
> in our case.
>
> The mlx5 is first user of such library, once the other user will arrive,
> we will be happy to
> collaborate in order to make it generic.

Makes sense, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ