From: Arlin Davis Date: Thu, 8 Dec 2011 00:39:55 +0000 (-0800) Subject: cma,scm,ucm: extra reference on EP, with RSP, causes dat_ep_free() to hang X-Git-Tag: dapl-2.0.35-1~22 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d29a85aecd0976be0ea677c4d55ee80b8c9b5f52;p=~ardavis%2Fdapl.git cma,scm,ucm: extra reference on EP, with RSP, causes dat_ep_free() to hang 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 --- 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;