From 36fbbd12019e8997f8760f3343aa1120bfa59f60 Mon Sep 17 00:00:00 2001 From: Oren Sidi Date: Thu, 8 Feb 2024 17:35:02 +0200 Subject: [PATCH] librdmacm: Ack the pending event in sync UD connection [ Upstream commit 9a0fc3afdc9988e4949ee1e2a0fe41058166362a ] When the server accepts a UD connection request in sync mode, the event needs to be acked, otherwise destroying the listening id would get stuck because there is a pending event. For RC, the event is acked in ucma_complete(). Fixes: 332b203d1a30 ("librdmacm: Do not wait in rdma_accept for UD QPs") Signed-off-by: Oren Sidi Reviewed-by: Leon Romanovsky Reviewed-by: Sean Hefty Signed-off-by: Yishai Hadas Signed-off-by: Nicolas Morey --- librdmacm/cma.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/librdmacm/cma.c b/librdmacm/cma.c index 8d957245b..9439cea95 100644 --- a/librdmacm/cma.c +++ b/librdmacm/cma.c @@ -1953,8 +1953,14 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param) return (ret >= 0) ? ERR(ENODATA) : -1; } - if (ucma_is_ud_qp(id->qp_type)) + if (ucma_is_ud_qp(id->qp_type)) { + if (id_priv->sync && id_priv->id.event) { + rdma_ack_cm_event(id_priv->id.event); + id_priv->id.event = NULL; + } + return 0; + } return ucma_complete(id); }