during RC QP release, when receiving a disconnect request from remote peer
instead of a disconnect call from the client, the QP didn't get properly
set in ERR state and didn't flush the queue during disconnect processing.

Signed-off-by: Arlin Davis <[email protected]>
---
 dapl/openib_ucm/cm.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c
index 2b7471e..b51556a 100644
--- a/dapl/openib_ucm/cm.c
+++ b/dapl/openib_ucm/cm.c
@@ -711,7 +711,8 @@ static void ucm_ud_free(DAPL_EP *ep)
 void dapls_ib_cm_free(dp_ib_cm_handle_t cm, DAPL_EP *ep)
 {
        dapl_dbg_log(DAPL_DBG_TYPE_CM,
-                    " cm_destroy: cm %p ep %p\n", cm, ep);
+                    " cm_destroy: %s cm %p ep %p\n",
+                    cm ? dapl_cm_state_str(cm->state) : "", cm, ep);
 
        if (!cm && ep) {
                ucm_ud_free(ep);
@@ -813,6 +814,10 @@ DAT_RETURN dapli_cm_disconnect(dp_ib_cm_handle_t cm)
        dapl_os_lock(&cm->lock);
        switch (cm->state) {
        case DCM_CONNECTED:
+               /* CONSUMER: move to err state to flush, if not UD */
+               if (cm->ep->qp_handle->qp_type != IBV_QPT_UD) 
+                       dapls_modify_qp_state(cm->ep->qp_handle, 
IBV_QPS_ERR,0,0,0);
+
                /* send DREQ, event after DREP or DREQ timeout */
                cm->state = DCM_DISC_PENDING;
                cm->msg.op = htons(DCM_DREQ);
@@ -836,6 +841,10 @@ DAT_RETURN dapli_cm_disconnect(dp_ib_cm_handle_t cm)
                }
                break;
        case DCM_DISC_RECV:
+               /* CM_THREAD: move to err state to flush, if not UD */
+               if (cm->ep->qp_handle->qp_type != IBV_QPT_UD) 
+                       dapls_modify_qp_state(cm->ep->qp_handle, 
IBV_QPS_ERR,0,0,0);
+
                /* DREQ received, send DREP and schedule event */
                cm->msg.op = htons(DCM_DREP);
                break;
@@ -1547,10 +1556,6 @@ dapls_ib_disconnect(IN DAPL_EP *ep, IN DAT_CLOSE_FLAGS 
close_flags)
        dapl_dbg_log(DAPL_DBG_TYPE_EP,
                     "dapls_ib_disconnect(ep_handle %p ....)\n", ep);
 
-       /* move to err state to flush, if not UD */
-       if (ep->qp_handle->qp_type != IBV_QPT_UD) 
-               dapls_modify_qp_state(ep->qp_handle, IBV_QPS_ERR,0,0,0);
-       
        if (ep->cm_handle == NULL ||
            ep->param.ep_state == DAT_EP_STATE_DISCONNECTED)
                return DAT_SUCCESS;
-- 
1.5.2.5

_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to