[ofa-general] [PATCH] dapl scm: remove unecessary thread when using direct objects

Arlin Davis arlin.r.davis at intel.com
Fri Jan 16 10:44:06 PST 2009


dapl scm: remove unecessary thread when using direct objects

A thread is created for processing events on devices without
direct CQ event object support. Since all openfabrics devices support
direct events there is no need to start a thread in the provider. 
Move this under #ifndef CQ_WAIT_OBJECT.

Signed-off-by: Arlin Davis <ardavis at ichips.intel.com>
---
 dapl/openib_scm/dapl_ib_util.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dapl/openib_scm/dapl_ib_util.c b/dapl/openib_scm/dapl_ib_util.c
index f1f6103..ca7746e 100644
--- a/dapl/openib_scm/dapl_ib_util.c
+++ b/dapl/openib_scm/dapl_ib_util.c
@@ -238,6 +238,7 @@ found:
 	hca_ptr->ib_trans.mtu = 
 		dapl_ib_mtu(dapl_os_get_env_val("DAPL_IB_MTU", SCM_IB_MTU));
 
+#ifndef CQ_WAIT_OBJECT
 	/* initialize cq_lock */
 	dat_status = dapl_os_lock_init(&hca_ptr->ib_trans.cq_lock);
 	if (dat_status != DAT_SUCCESS) {
@@ -272,7 +273,7 @@ found:
                          ibv_get_device_name(hca_ptr->ib_trans.ib_dev));
                 goto bail;
         }
-
+#endif
 	/* initialize cr_list lock */
 	dat_status = dapl_os_lock_init(&hca_ptr->ib_trans.lock);
 	if (dat_status != DAT_SUCCESS) {
@@ -348,14 +349,16 @@ DAT_RETURN dapls_ib_close_hca (	IN   DAPL_HCA	*hca_ptr )
 {
 	dapl_dbg_log (DAPL_DBG_TYPE_UTIL," close_hca: %p\n",hca_ptr);
 
+#ifndef CQ_WAIT_OBJECT
 	dapli_cq_thread_destroy(hca_ptr);
+	dapl_os_lock_destroy(&hca_ptr->ib_trans.cq_lock);
+#endif
 
 	if (hca_ptr->ib_hca_handle != IB_INVALID_HANDLE) {
 		if (ibv_close_device(hca_ptr->ib_hca_handle)) 
 			return(dapl_convert_errno(errno,"ib_close_device"));
 		hca_ptr->ib_hca_handle = IB_INVALID_HANDLE;
 	}
-	dapl_os_lock_destroy(&hca_ptr->ib_trans.cq_lock);
 
 	/* destroy cr_thread and lock */
 	hca_ptr->ib_trans.cr_state = IB_THREAD_CANCEL;
-- 
1.5.2.5






More information about the general mailing list