[ofw] [PATCH] uDAPL v2: scm: transistion QP to error state when disconnecting instead of reset/init.

Davis, Arlin R arlin.r.davis at intel.com
Tue Aug 4 22:40:18 PDT 2009


SCM: Fix disconnect. QP's need to move to ERROR state in 
order to flush work requests and notify consumer. Moving to 
RESET removed all requests but did not notify consumer.

diff --git a/dapl/openib_scm/cm.c b/dapl/openib_scm/cm.c
index 164cc4e..416ee71 100644
--- a/dapl/openib_scm/cm.c
+++ b/dapl/openib_scm/cm.c
@@ -773,7 +773,7 @@ ud_bail:
 
 bail:
 	/* close socket, and post error event */
-	dapls_ib_reinit_ep(ep_ptr);	/* reset QP state */
+	dapls_modify_qp_state(ep_ptr->qp_handle, IBV_QPS_ERR, 0);
 	closesocket(cm_ptr->socket);
 	cm_ptr->socket = DAPL_INVALID_SOCKET;
 	dapl_evd_connection_callback(NULL, event, cm_ptr->p_data, ep_ptr);
@@ -1107,7 +1107,7 @@ dapli_socket_accept_usr(DAPL_EP * ep_ptr,
 	return DAT_SUCCESS;
       bail:
 	dapls_ib_cm_free(cm_ptr, cm_ptr->ep);
-	dapls_ib_reinit_ep(ep_ptr);	/* reset QP state */
+	dapls_modify_qp_state(ep_ptr->qp_handle, IBV_QPS_ERR, 0);
 	return DAT_INTERNAL_ERROR;
 }
 
@@ -1169,7 +1169,7 @@ void dapli_socket_accept_rtu(dp_ib_cm_handle_t cm_ptr)
 	return;
       
 bail:
-	dapls_ib_reinit_ep(cm_ptr->ep);	/* reset QP state */
+	dapls_modify_qp_state(cm_ptr->ep->qp_handle, IBV_QPS_ERR, 0);
 	dapls_ib_cm_free(cm_ptr, cm_ptr->ep);
 	dapls_cr_callback(cm_ptr, IB_CME_DESTINATION_REJECT, NULL, cm_ptr->sp);
 }
@@ -1236,9 +1236,9 @@ dapls_ib_disconnect(IN DAPL_EP * ep_ptr, IN DAT_CLOSE_FLAGS close_flags)
 	dapl_dbg_log(DAPL_DBG_TYPE_EP,
 		     "dapls_ib_disconnect(ep_handle %p ....)\n", ep_ptr);
 
-	/* reinit to modify QP state */
-	dapls_ib_reinit_ep(ep_ptr);
-
+	/* Transition to error state to flush queue */
+        dapls_modify_qp_state(ep_ptr->qp_handle, IBV_QPS_ERR, 0);
+	
 	if (ep_ptr->cm_handle == NULL ||
 	    ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED)
 		return DAT_SUCCESS;



More information about the ofw mailing list