RDMA/rxe: Fix ref error in rxe_av.c
authorBob Pearson <rpearsonhpe@gmail.com>
Fri, 4 Mar 2022 00:07:57 +0000 (18:07 -0600)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 15 Mar 2022 23:49:56 +0000 (20:49 -0300)
commit63221acb0c63141cc7650f8eefb148337061e6db
tree3eb024dea559b9119db0ee6b724e927db9f63ac5
parent70f92521584f1d1e8268311ee84413307b0fdea8
RDMA/rxe: Fix ref error in rxe_av.c

The commit referenced below can take a reference to the AH which is never
dropped. This only happens in the UD request path. This patch optionally
passes that AH back to the caller so that it can hold the reference while
the AV is being accessed and then drop it. Code to do this is added to
rxe_req.c. The AV is also passed to rxe_prepare in rxe_net.c as an
optimization.

Fixes: e2fe06c90806 ("RDMA/rxe: Lookup kernel AH from ah index in UD WQEs")
Link: https://lore.kernel.org/r/20220304000808.225811-2-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_av.c
drivers/infiniband/sw/rxe/rxe_loc.h
drivers/infiniband/sw/rxe/rxe_net.c
drivers/infiniband/sw/rxe/rxe_req.c
drivers/infiniband/sw/rxe/rxe_resp.c