aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/sw/rxe/rxe_srq.c
diff options
context:
space:
mode:
authorBob Pearson <rpearsonhpe@gmail.com>2022-04-20 20:40:35 -0500
committerJason Gunthorpe <jgg@nvidia.com>2022-05-09 09:03:39 -0300
commitb2a41678fc21fd39b11f5aca0a8c999f8efcb1a8 (patch)
tree938fa5e86ecf899b0fb2041c39061e1ef3ddc3eb /drivers/infiniband/sw/rxe/rxe_srq.c
parent0b1fbfb9e9058e6eae6564cdb4ed0003d766445c (diff)
RDMA/rxe: Add rxe_srq_cleanup()
Move cleanup code from rxe_destroy_srq() to rxe_srq_cleanup() which is called after all references are dropped to allow code depending on the srq object to complete. Link: https://lore.kernel.org/r/20220421014042.26985-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_srq.c')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_srq.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_srq.c b/drivers/infiniband/sw/rxe/rxe_srq.c
index e2dcfc5d97e3..02b39498c370 100644
--- a/drivers/infiniband/sw/rxe/rxe_srq.c
+++ b/drivers/infiniband/sw/rxe/rxe_srq.c
@@ -174,3 +174,14 @@ err2:
srq->rq.queue = NULL;
return err;
}
+
+void rxe_srq_cleanup(struct rxe_pool_elem *elem)
+{
+ struct rxe_srq *srq = container_of(elem, typeof(*srq), elem);
+
+ if (srq->pd)
+ rxe_put(srq->pd);
+
+ if (srq->rq.queue)
+ rxe_queue_cleanup(srq->rq.queue);
+}