RDMA/rxe: Make pool lookup and alloc APIs type safe
authorBob Pearson <rpearsonhpe@gmail.com>
Wed, 16 Dec 2020 23:15:47 +0000 (17:15 -0600)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 12 Jan 2021 20:35:38 +0000 (16:35 -0400)
commit2622aa718a6a774ba302ca002adc62eeab9cdf28
tree16e7ec0e228fd0e452c09524f43c5fde4d5cf182
parentb994d49ef4afa28dc335ee2b4b734939c7a1d95f
RDMA/rxe: Make pool lookup and alloc APIs type safe

The allocate, lookup index, lookup key and cleanup routines in rxe_pool.c
currently are not type safe against relocating the pelem field in the
objects. Planned changes to move allocation of objects into rdma-core make
addressing this a requirement.

Use the elem_offset field in rxe_type_info make these APIs safe against
moving the pelem field.

Link: https://lore.kernel.org/r/20201216231550.27224-5-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearson@hpe.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_pool.c