[ofw] [PATCH] DAPL v2.0: cma: disconnect can block for excessive times waiting for rdma_cm DREP timeout
Hefty, Sean
sean.hefty at intel.com
Fri Dec 3 15:41:42 PST 2010
> @@ -636,13 +637,29 @@ dapls_ib_disconnect(IN DAPL_EP * ep_ptr, IN
> DAT_CLOSE_FLAGS close_flags)
>
> /* ABRUPT close, wait for callback and DISCONNECTED state */
> if (close_flags == DAT_CLOSE_ABRUPT_FLAG) {
> + DAPL_EVD *evd = NULL;
> + DAT_EVENT_NUMBER num = DAT_CONNECTION_EVENT_DISCONNECTED;
> +
> dapl_os_lock(&ep_ptr->header.lock);
> - while (ep_ptr->param.ep_state != DAT_EP_STATE_DISCONNECTED) {
> + /* limit DREP waiting, other side could be down */
> + while (--drep_time && ep_ptr->param.ep_state !=
> DAT_EP_STATE_DISCONNECTED) {
> dapl_os_unlock(&ep_ptr->header.lock);
> dapl_os_sleep_usec(10000);
gak - can't you wait on an event using some timeout interval?
> dapl_os_lock(&ep_ptr->header.lock);
> }
> + if (ep_ptr->param.ep_state != DAT_EP_STATE_DISCONNECTED) {
> + dapl_log(DAPL_DBG_TYPE_WARN,
> + " WARNING: disconnect(ep %p, conn %p, id %d) timed
> out\n",
> + ep_ptr, conn, (conn ? conn->cm_id : 0));
> + ep_ptr->param.ep_state = DAT_EP_STATE_DISCONNECTED;
> + evd = (DAPL_EVD *)ep_ptr->param.connect_evd_handle;
> + }
> dapl_os_unlock(&ep_ptr->header.lock);
> +
> + if (evd) {
> + dapl_sp_remove_ep(ep_ptr);
> + dapls_evd_post_connection_event(evd, num, ep_ptr, 0, 0);
> + }
> }
More information about the ofw
mailing list