[ofw] [PATCH] Destroy the CEP sooner in ndi_dreq_cm

Fab Tillier ftillier at windows.microsoft.com
Tue Jul 1 15:10:21 PDT 2008


The current ndi_dreq_cm function destroys the CEP after the QP is moved to the error state.  The CEP should be destroyed first to send the DREQ before changing the QP state.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\kernel\al_ndi_cm.c trunk\core\al\kernel\al_ndi_cm.c
--- old\core\al\kernel\al_ndi_cm.c      Tue Jul 01 15:07:15 2008
+++ trunk\core\al\kernel\al_ndi_cm.c    Tue Jul 01 15:07:30 2008
@@ -1526,6 +1526,17 @@ ndi_dreq_cm(
                goto exit;
        }

+       cid = cl_atomic_xchg( &((al_conn_qp_t*)h_qp)->cid, AL_INVALID_CID );
+
+       if( cid != AL_INVALID_CID )
+       {
+               ref_al_obj( &h_qp->obj );
+               if( al_destroy_cep( qp_get_al( h_qp ), cid, deref_al_obj ) != IB_SUCCESS )
+               {
+                       deref_al_obj( &h_qp->obj );
+               }
+       }
+
        /* bring QP to error state */
        cl_memclr( &qp_mod, sizeof(qp_mod) );
        qp_mod.req_state = IB_QPS_ERROR;
@@ -1542,17 +1553,6 @@ ndi_dreq_cm(

        /* Store the timestamp after which the QP exits timewait. */
        h_qp->timewait = cl_get_time_stamp() + timewait_us;
-
-       cid = cl_atomic_xchg( &((al_conn_qp_t*)h_qp)->cid, AL_INVALID_CID );
-
-       if( cid != AL_INVALID_CID )
-       {
-               ref_al_obj( &h_qp->obj );
-               if( al_destroy_cep( qp_get_al( h_qp ), cid, deref_al_obj ) != IB_SUCCESS )
-               {
-                       deref_al_obj( &h_qp->obj );
-               }
-       }

        nt_status = STATUS_SUCCESS;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ndi_cm_dreq.patch
Type: application/octet-stream
Size: 1149 bytes
Desc: ndi_cm_dreq.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080701/1c542029/attachment.obj>


More information about the ofw mailing list