[ofw] [PATCH 7/13] DAPL v2.0: cma, scm, ucm: extra reference on EP, with RSP, causes dat_ep_free() to hang

Davis, Arlin R arlin.r.davis at intel.com
Fri Jan 13 15:55:26 PST 2012


Need to add check for RSP or PSP provider type service points during
passive side accepts before taking CR reference on the EP. In these
cases, the EP is already linked to inbound CR.

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/openib_cma/cm.c |    5 +++--
 dapl/openib_scm/cm.c |    5 +++--
 dapl/openib_ucm/cm.c |    5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/dapl/openib_cma/cm.c b/dapl/openib_cma/cm.c
index 7980cf6..bd2c1f0 100644
--- a/dapl/openib_cma/cm.c
+++ b/dapl/openib_cma/cm.c
@@ -901,8 +901,9 @@ dapls_ib_accept_connection(IN DAT_CR_HANDLE cr_handle,
 		rdma_destroy_id(ep_conn->cm_id);
 		dapls_cm_release(ep_conn);
 
-		/* add new CM to EP linking, qp_handle unchanged */
-		dapl_ep_link_cm(ep_ptr, cr_conn);
+		/* add new CM to EP linking, qp_handle unchanged, !PSP !RSP */
+		if (!cr_conn->sp->ep_handle && !cr_conn->sp->psp_flags)
+			dapl_ep_link_cm(ep_ptr, cr_conn);
 		cr_conn->ep = ep_ptr;
 	} else {
 		dapl_log(DAPL_DBG_TYPE_ERR,
diff --git a/dapl/openib_scm/cm.c b/dapl/openib_scm/cm.c
index 586e1b0..b6109f1 100644
--- a/dapl/openib_scm/cm.c
+++ b/dapl/openib_scm/cm.c
@@ -1277,8 +1277,9 @@ dapli_socket_accept_usr(DAPL_EP * ep_ptr,
 	cm_ptr->state = DCM_ACCEPTED;
 	dapl_os_unlock(&cm_ptr->lock);
 
-	/* Link CM to EP, already queued on work thread */
-	dapl_ep_link_cm(ep_ptr, cm_ptr);
+	/* Link CM to EP, already queued on work thread, !PSP !RSP */
+	if (!cm_ptr->sp->ep_handle && !cm_ptr->sp->psp_flags)
+		dapl_ep_link_cm(ep_ptr, cm_ptr);
 	cm_ptr->ep = ep_ptr;
 
 	local.p_size = htons(p_size);
diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c
index 2d2063e..762bd66 100644
--- a/dapl/openib_ucm/cm.c
+++ b/dapl/openib_ucm/cm.c
@@ -1581,8 +1581,9 @@ dapli_accept_usr(DAPL_EP *ep, DAPL_CR *cr, DAT_COUNT p_size, DAT_PVOID p_data)
 	cm->p_size = p_size;
 	dapl_os_memcpy(&cm->p_data, p_data, p_size);
 
-	/* save state and setup valid reference to EP, HCA */
-	dapl_ep_link_cm(ep, cm);
+	/* save state and setup valid reference to EP, HCA. !PSP !RSP */
+	if (!cm->sp->ep_handle && !cm->sp->psp_flags)
+		dapl_ep_link_cm(ep, cm);
 	cm->ep = ep;
 	cm->hca = ia->hca_ptr;
 
-- 
1.7.3





More information about the ofw mailing list