IB/cm: Fix handling of duplicate SIDR REQs
authorSean Hefty <sean.hefty@intel.com>
Mon, 2 Jul 2007 21:36:19 +0000 (14:36 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 11 Jul 2007 04:51:43 +0000 (21:51 -0700)
Fix handling to duplicate SIDR REQs to avoid sending a reject if a
duplicate is detected.  Duplicates should just be silently discarded.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/cm.c

index c7007c45889ab10469198c0174a2fb0f3d1b3b43..9135a8c1d4acd42b4d9c3000648730c2ebe8d985 100644 (file)
@@ -2794,7 +2794,6 @@ static int cm_sidr_req_handler(struct cm_work *work)
                                work->mad_recv_wc->recv_buf.grh,
                                &cm_id_priv->av);
        cm_id_priv->id.remote_id = sidr_req_msg->request_id;
-       cm_id_priv->id.state = IB_CM_SIDR_REQ_RCVD;
        cm_id_priv->tid = sidr_req_msg->hdr.tid;
        atomic_inc(&cm_id_priv->work_count);
 
@@ -2804,6 +2803,7 @@ static int cm_sidr_req_handler(struct cm_work *work)
                spin_unlock_irq(&cm.lock);
                goto out; /* Duplicate message. */
        }
+       cm_id_priv->id.state = IB_CM_SIDR_REQ_RCVD;
        cur_cm_id_priv = cm_find_listen(cm_id->device,
                                        sidr_req_msg->service_id,
                                        sidr_req_msg->private_data);