From 127f74755321deb90d6212881751b0e4e6479fa1 Mon Sep 17 00:00:00 2001 From: ftillier Date: Thu, 8 Dec 2005 21:56:50 +0000 Subject: [PATCH] [IBAL] Handle race between sending RTU and receiving REJ. git-svn-id: svn://openib.tc.cornell.edu/gen1@201 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/al/al_cm_qp.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/trunk/core/al/al_cm_qp.c b/trunk/core/al/al_cm_qp.c index bc2c95c6..518284f3 100644 --- a/trunk/core/al/al_cm_qp.c +++ b/trunk/core/al/al_cm_qp.c @@ -1496,7 +1496,7 @@ ib_cm_rtu( status = al_cep_rtu( h_cm_rep.h_al, h_cm_rep.cid, p_cm_rtu->p_rtu_pdata, p_cm_rtu->rtu_length ); - if( status != IB_SUCCESS ) + if( status != IB_SUCCESS && status != IB_INVALID_STATE ) { err: /* Reject and abort the connection. */ @@ -1508,13 +1508,16 @@ err: cid = cl_atomic_xchg( &((al_conn_qp_t*)h_cm_rep.h_qp)->cid, AL_INVALID_CID ); - CL_ASSERT( cid == h_cm_rep.cid ); - - ref_al_obj( &h_cm_rep.h_qp->obj ); - if( al_destroy_cep( - h_cm_rep.h_al, h_cm_rep.cid, deref_al_obj ) != IB_SUCCESS ) + if( cid != AL_INVALID_CID ) { - deref_al_obj( &h_cm_rep.h_qp->obj ); + CL_ASSERT( cid == h_cm_rep.cid ); + + ref_al_obj( &h_cm_rep.h_qp->obj ); + if( al_destroy_cep( + h_cm_rep.h_al, h_cm_rep.cid, deref_al_obj ) != IB_SUCCESS ) + { + deref_al_obj( &h_cm_rep.h_qp->obj ); + } } AL_TRACE_EXIT( AL_DBG_ERROR, -- 2.41.0