dapl_os_lock(&cm_ptr->lock);
cm_ptr->state = SCM_DESTROY;
- if (cm_ptr->ep) {
+ if (cm_ptr->ep)
cm_ptr->ep->cm_handle = IB_INVALID_HANDLE;
- cm_ptr->ep->qp_handle = IB_INVALID_HANDLE;
- }
/* close socket if still active */
if (cm_ptr->socket >= 0) {
IN DAPL_EVD *evd_ptr)
{
DAT_EVENT event;
+ ib_work_completion_t wc;
if (evd_ptr->ib_cq_handle != IB_INVALID_HANDLE) {
/* pull off CQ and EVD entries and toss */
- while (dapls_ib_completion_poll == DAT_SUCCESS);
- while (dapl_evd_dequeue(evd_ptr,&event) != DAT_QUEUE_EMPTY);
-#if 1
- ibv_destroy_cq(evd_ptr->ib_cq_handle);
- evd_ptr->ib_cq_handle = IB_INVALID_HANDLE;
- return DAT_SUCCESS;
-#else
+ while (ibv_poll_cq(evd_ptr->ib_cq_handle, 1, &wc) == 1);
+ while (dapl_evd_dequeue(evd_ptr, &event) == DAT_SUCCESS);
if (ibv_destroy_cq(evd_ptr->ib_cq_handle))
- return(dapl_convert_errno(errno,"destroy_cq"));
+ return(dapl_convert_errno(errno,"ibv_destroy_cq"));
evd_ptr->ib_cq_handle = IB_INVALID_HANDLE;
-#endif
}
return DAT_SUCCESS;
}
dapls_ib_pd_free(IN DAPL_PZ *pz )
{
if (pz->pd_handle != IB_INVALID_HANDLE) {
-#if 1
- ibv_dealloc_pd(pz->pd_handle);
- pz->pd_handle = IB_INVALID_HANDLE;
- return DAT_SUCCESS;
-#else
if (ibv_dealloc_pd(pz->pd_handle))
- return(dapl_convert_errno(errno,"dealloc_pd"));
+ return(dapl_convert_errno(errno,"ibv_dealloc_pd"));
pz->pd_handle = IB_INVALID_HANDLE;
-#endif
}
return DAT_SUCCESS;
}