[IBAL] Handle race between sending RTU and receiving REJ.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 8 Dec 2005 21:56:50 +0000 (21:56 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 8 Dec 2005 21:56:50 +0000 (21:56 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@201 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/al_cm_qp.c

index bc2c95c..518284f 100644 (file)
@@ -1496,7 +1496,7 @@ ib_cm_rtu(
 \r
        status = al_cep_rtu( h_cm_rep.h_al, h_cm_rep.cid,\r
                p_cm_rtu->p_rtu_pdata, p_cm_rtu->rtu_length );\r
-       if( status != IB_SUCCESS )\r
+       if( status != IB_SUCCESS && status != IB_INVALID_STATE )\r
        {\r
 err:\r
                /* Reject and abort the connection. */\r
@@ -1508,13 +1508,16 @@ err:
                cid = cl_atomic_xchg(\r
                        &((al_conn_qp_t*)h_cm_rep.h_qp)->cid, AL_INVALID_CID );\r
 \r
-               CL_ASSERT( cid == h_cm_rep.cid );\r
-\r
-               ref_al_obj( &h_cm_rep.h_qp->obj );\r
-               if( al_destroy_cep(\r
-                       h_cm_rep.h_al, h_cm_rep.cid, deref_al_obj ) != IB_SUCCESS )\r
+               if( cid != AL_INVALID_CID )\r
                {\r
-                       deref_al_obj( &h_cm_rep.h_qp->obj );\r
+                       CL_ASSERT( cid == h_cm_rep.cid );\r
+\r
+                       ref_al_obj( &h_cm_rep.h_qp->obj );\r
+                       if( al_destroy_cep(\r
+                               h_cm_rep.h_al, h_cm_rep.cid, deref_al_obj ) != IB_SUCCESS )\r
+                       {\r
+                               deref_al_obj( &h_cm_rep.h_qp->obj );\r
+                       }\r
                }\r
 \r
                AL_TRACE_EXIT( AL_DBG_ERROR,\r