IN DAPL_EVD *evd_ptr,
IN ib_wait_obj_handle_t *p_cq_wait_obj_handle )
{
- dapl_dbg_log ( DAPL_DBG_TYPE_CM,
+ dapl_dbg_log ( DAPL_DBG_TYPE_UTIL,
" cq_object_create: (%p,%p)\n",
evd_ptr, p_cq_wait_obj_handle );
return DAT_SUCCESS;
}
+#if defined(_WIN32) || defined(_WIN64)
+DAT_RETURN
+dapls_ib_wait_object_wait (
+ IN ib_wait_obj_handle_t p_cq_wait_obj_handle,
+ IN uint32_t timeout)
+{
+ struct dapl_evd *evd_ptr;
+ struct ibv_cq *ibv_cq = NULL;
+ int status = 0;
+
+ dapl_dbg_log(DAPL_DBG_TYPE_UTIL,
+ " cq_object_wait: CQ channel %p time %d\n",
+ p_cq_wait_obj_handle, timeout);
+
+ /* uDAPL timeout values in usecs */
+ p_cq_wait_obj_handle->comp_channel.Milliseconds = timeout / 1000;
+
+ /* returned event */
+ status = ibv_get_cq_event(p_cq_wait_obj_handle, &ibv_cq,
+ (void *) &evd_ptr);
+ if (status == 0) {
+ ibv_ack_cq_events(ibv_cq, 1);
+ }
+
+ dapl_dbg_log(DAPL_DBG_TYPE_UTIL,
+ " cq_object_wait: RET evd %p ibv_cq %p %s\n",
+ evd_ptr, ibv_cq,strerror(errno));
+
+ return(dapl_convert_errno(status,"cq_wait_object_wait"));
+}
+#else //_WIN32 || _WIN64
DAT_RETURN
dapls_ib_wait_object_wait (
IN ib_wait_obj_handle_t p_cq_wait_obj_handle,
- IN u_int32_t timeout)
+ IN uint32_t timeout)
{
struct dapl_evd *evd_ptr;
struct ibv_cq *ibv_cq = NULL;
.revents = 0
};
- dapl_dbg_log ( DAPL_DBG_TYPE_CM,
+ dapl_dbg_log ( DAPL_DBG_TYPE_UTIL,
" cq_object_wait: CQ channel %p time %d\n",
p_cq_wait_obj_handle, timeout );
} else if (status == 0)
status = ETIMEDOUT;
- dapl_dbg_log (DAPL_DBG_TYPE_CM,
+ dapl_dbg_log (DAPL_DBG_TYPE_UTIL,
" cq_object_wait: RET evd %p ibv_cq %p %s\n",
evd_ptr, ibv_cq,strerror(errno));
return(dapl_convert_errno(status,"cq_wait_object_wait"));
}
-#endif
+#endif //_WIN32 || _WIN64
+#endif // CQ_WAIT_OBJECT
/*
* Local variables: