[IBAL] The current ndi_dreq_cm function destroys the CEP after the QP is moved to...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Jul 2008 12:22:39 +0000 (12:22 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Jul 2008 12:22:39 +0000 (12:22 +0000)
Signed-off-by: Fab Tillier <ftillier@microsoft.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1323 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/kernel/al_ndi_cm.c

index e6339fd..438f9f3 100644 (file)
@@ -1539,6 +1539,17 @@ ndi_dreq_cm(
                goto exit;\r
        }\r
 \r
+       cid = cl_atomic_xchg( &((al_conn_qp_t*)h_qp)->cid, AL_INVALID_CID );\r
+\r
+       if( cid != AL_INVALID_CID )\r
+       {\r
+               ref_al_obj( &h_qp->obj );\r
+               if( al_destroy_cep( qp_get_al( h_qp ), cid, deref_al_obj ) != IB_SUCCESS )\r
+               {\r
+                       deref_al_obj( &h_qp->obj );\r
+               }\r
+       }\r
+\r
        /* bring QP to error state */\r
        cl_memclr( &qp_mod, sizeof(qp_mod) );\r
        qp_mod.req_state = IB_QPS_ERROR;\r
@@ -1556,17 +1567,6 @@ ndi_dreq_cm(
        /* Store the timestamp after which the QP exits timewait. */\r
        h_qp->timewait = cl_get_time_stamp() + timewait_us;\r
 \r
-       cid = cl_atomic_xchg( &((al_conn_qp_t*)h_qp)->cid, AL_INVALID_CID );\r
-\r
-       if( cid != AL_INVALID_CID )\r
-       {\r
-               ref_al_obj( &h_qp->obj );\r
-               if( al_destroy_cep( qp_get_al( h_qp ), cid, deref_al_obj ) != IB_SUCCESS )\r
-               {\r
-                       deref_al_obj( &h_qp->obj );\r
-               }\r
-       }\r
-\r
        nt_status = STATUS_SUCCESS;\r
 \r
 exit:\r