ep_ptr->qp_handle = IB_INVALID_HANDLE;
}
+#ifdef DAT_EXTENSIONS
+{
+ dp_ib_cm_handle_t cr, next_cr;
+
+ /*
+ * UD CR objects are kept active because of direct private data references
+ * from CONN events. The cr->socket is closed and marked inactive but the
+ * object remains allocated and queued on the CR resource list. There can
+ * be multiple CR's associated with a given EP. There is no way to determine
+ * when consumer is finished with event until the dat_ep_free.
+ *
+ * Schedule destruction for all CR's associated with this EP, cr_thread will
+ * complete the cleanup with state == SCM_DESTROY.
+ */
+ dapl_os_lock(&ia_ptr->hca_ptr->ib_trans.lock);
+ if (!dapl_llist_is_empty((DAPL_LLIST_HEAD*)
+ &ia_ptr->hca_ptr->ib_trans.list))
+ next_cr = dapl_llist_peek_head((DAPL_LLIST_HEAD*)
+ &ia_ptr->hca_ptr->ib_trans.list);
+ else
+ next_cr = NULL;
+
+ while (next_cr) {
+ cr = next_cr;
+ next_cr = dapl_llist_next_entry((DAPL_LLIST_HEAD*)
+ &ia_ptr->hca_ptr->ib_trans.list,
+ (DAPL_LLIST_ENTRY*)&cr->entry);
+ if (cr->ep == ep_ptr) {
+ dapl_dbg_log(DAPL_DBG_TYPE_EP,
+ " qp_free CR: ep %p cr %p\n", ep_ptr, cr);
+ cr->state = SCM_DESTROY;
+ }
+ }
+ dapl_os_unlock(&ia_ptr->hca_ptr->ib_trans.lock);
+ send(ia_ptr->hca_ptr->ib_trans.scm[1], "w", sizeof "w", 0);
+}
+#endif
+
return DAT_SUCCESS;
}