OSDN Git Service

RDMA/rxe: Replace red-black trees by xarrays
authorBob Pearson <rpearsonhpe@gmail.com>
Fri, 4 Mar 2022 00:08:04 +0000 (18:08 -0600)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 16 Mar 2022 13:34:42 +0000 (10:34 -0300)
commit3225717f6dfa29a6f03629b7a7f8492e1521d06d
tree488095b35bc616b55823b18b4283ab38914cc702
parentdf34dc9e03bfb9181f6f5405f4dd319340b5b46c
RDMA/rxe: Replace red-black trees by xarrays

Currently the rxe driver uses red-black trees to add indices to the rxe
object pools. Linux xarrays provide a better way to implement the same
functionality for indices. This patch replaces red-black trees by xarrays
for pool objects. Since xarrays already have a spinlock use that in place
of the pool rwlock. Make sure that all changes in the xarray(index) and
kref(ref counnt) occur atomically.

Link: https://lore.kernel.org/r/20220304000808.225811-9-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe.c
drivers/infiniband/sw/rxe/rxe_mr.c
drivers/infiniband/sw/rxe/rxe_mw.c
drivers/infiniband/sw/rxe/rxe_pool.c
drivers/infiniband/sw/rxe/rxe_pool.h
drivers/infiniband/sw/rxe/rxe_verbs.c