* This keeps events in order if dat_evd_wait() has copied events\r
* from CQ to EVD. \r
*/\r
- local_event = (DAT_EVENT *)dapls_rbuf_remove (&evd_ptr->pending_event_queue);\r
+ local_event = (DAT_EVENT *)dapls_rbuf_remove(&evd_ptr->pending_event_queue);\r
if (local_event != NULL)\r
{\r
*event = *local_event;\r
- dat_status = dapls_rbuf_add (&evd_ptr->free_event_queue, \r
- local_event);\r
+ dat_status = dapls_rbuf_add (&evd_ptr->free_event_queue, local_event);\r
DAPL_CNTR(DCNT_EVD_DEQUEUE_FOUND);\r
}\r
else if (evd_ptr->ib_cq_handle != IB_INVALID_HANDLE)\r
IN DAPL_EP *ep_ptr,\r
IN DAT_CLOSE_FLAGS disconnect_flags)\r
{\r
- DAPL_IA *ia_ptr;\r
- ib_api_status_t ib_status;\r
- ib_cm_dreq_t cm_dreq;\r
+ ib_api_status_t ib_status = IB_SUCCESS;\r
+ ib_cm_dreq_t cm_dreq;\r
\r
- UNUSED_PARAM( disconnect_flags );\r
-\r
- ia_ptr = ep_ptr->header.owner_ia;\r
- ib_status = IB_SUCCESS;\r
+ UNUSED_PARAM( disconnect_flags );\r
\r
dapl_os_memzero(&cm_dreq, sizeof(ib_cm_dreq_t));\r
\r
*/\r
cm_dreq.p_dreq_pdata = NULL;\r
\r
- if ( (ep_ptr->recv_discreq == DAT_FALSE ) && (ep_ptr->sent_discreq == DAT_FALSE ) )\r
+ if ( (ep_ptr->recv_discreq == DAT_FALSE )\r
+ && (ep_ptr->sent_discreq == DAT_FALSE ) )\r
//(disconnect_flags == DAT_CLOSE_ABRUPT_FLAG ) )\r
{\r
ep_ptr->sent_discreq = DAT_TRUE;\r
ib_status = ib_cm_dreq ( &cm_dreq );\r
\r
- dapl_dbg_log (DAPL_DBG_TYPE_CM,"--> DsD: EP=%p QP= %p DREQ SENT status =%s\n", \r
- ep_ptr, ep_ptr->qp_handle,ib_get_err_str(ib_status));\r
+ /* tolerate INVALID_STATE error as the other side can race ahead and\r
+ * generate a DREQ before we do.\r
+ */ \r
+ if ( ib_status == IB_INVALID_STATE )\r
+ ib_status = IB_SUCCESS;\r
+\r
+ if (ib_status )\r
+ {\r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
+ "--> DsD: EP=%p QP= %p DREQ SEND status %s\n", \r
+ ep_ptr, ep_ptr->qp_handle,ib_get_err_str(ib_status));\r
+ }\r
}\r
return dapl_ib_status_convert (ib_status);\r
}\r
dapls_ib_disconnect ( IN DAPL_EP *ep_ptr,\r
IN DAT_CLOSE_FLAGS disconnect_flags )\r
{\r
- ib_api_status_t ib_status;\r
- ib_cm_dreq_t cm_dreq;\r
+ ib_api_status_t ib_status = IB_SUCCESS;\r
+ ib_cm_dreq_t cm_dreq;\r
\r
dapl_os_assert(ep_ptr);\r
\r
/* tolerate INVALID_STATE error as the other side can race ahead and\r
* generate a DREQ before we do.\r
*/\r
- if (ib_status && (ib_status != IB_INVALID_STATE))\r
+ if ( ib_status == IB_INVALID_STATE )\r
+ ib_status = IB_SUCCESS;\r
+\r
+ if (ib_status)\r
{\r
- dapl_dbg_log(DAPL_DBG_TYPE_CM,\r
- "%s() EP %p Ignored ib_cm_dreq() status %s\n",\r
+ dapl_dbg_log(DAPL_DBG_TYPE_ERR,\r
+ "%s() EP %p ib_cm_dreq() status %s\n",\r
__FUNCTION__,ep_ptr,ib_get_err_str(ib_status));\r
}\r
if ( ib_status == IB_SUCCESS )\r
dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
"--> DsD: EP %p DREQ SENT\n", ep_ptr);\r
}\r
- return DAT_SUCCESS;\r
+ return ib_status;\r
}\r
\r
\r