[IBAL] This patch changes when the private data is stored to when the CM MAD is recei...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Jul 2008 10:24:10 +0000 (10:24 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Jul 2008 10:24:10 +0000 (10:24 +0000)
Signed-off-by: Fab Tillier <ftillier@microsoft.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1318 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/al_cm_cep.h
core/al/kernel/al_cm_cep.c
core/al/kernel/al_ndi_cm.c

index 4656234..4dc4fec 100644 (file)
@@ -287,13 +287,6 @@ al_cep_get_pdata(
        IN      OUT                     uint8_t                                         *p_psize,\r
                OUT                     uint8_t*                                        pdata );\r
 \r
-ib_api_status_t\r
-al_cep_set_pdata(\r
-       IN                              ib_al_handle_t FUNC_PTR64                               h_al,\r
-       IN                              net32_t                                         cid,\r
-       IN                              uint8_t                                         psize,\r
-       IN                              uint8_t*                                        pdata );\r
-\r
 #endif /* CL_KERNEL */\r
 \r
 \r
index 29041d4..8360950 100644 (file)
@@ -847,6 +847,10 @@ __save_wire_req(
        /* TODO: Do need to support CM handoff? */\r
        //p_cep->mads.req = *p_req;\r
 \r
+    /* Cache the private data. */\r
+       p_cep->psize = IB_REQ_PDATA_SIZE;\r
+       memcpy( p_cep->pdata, p_req->pdata, IB_REQ_PDATA_SIZE );\r
+\r
        AL_EXIT( AL_DBG_CM );\r
 }\r
 \r
@@ -978,6 +982,10 @@ err1:
                return IB_NO_MATCH;\r
        }\r
 \r
+    /* Cache the private data. */\r
+       p_cep->psize = IB_REJ_PDATA_SIZE;\r
+       memcpy( p_cep->pdata, p_rej->pdata, IB_REJ_PDATA_SIZE );\r
+\r
        status = __cep_queue_mad( p_cep, p_mad );\r
 \r
        AL_EXIT( AL_DBG_CM );\r
@@ -1264,6 +1272,10 @@ __save_wire_rep(
 \r
        p_cep->sq_psn = conn_rep_get_starting_psn( p_rep );\r
 \r
+    /* Cache the private data. */\r
+       p_cep->psize = IB_REP_PDATA_SIZE;\r
+       memcpy( p_cep->pdata, p_rep->pdata, IB_REP_PDATA_SIZE );\r
+\r
        AL_EXIT( AL_DBG_CM );\r
 }\r
 \r
@@ -3380,36 +3392,6 @@ __complete_ndi_irp(
        ib_put_mad( p_mad );\r
 }\r
 \r
-static ib_api_status_t\r
-__cep_set_pdata(\r
-       IN                              ib_al_handle_t FUNC_PTR64                               h_al,\r
-       IN                              net32_t                                         cid,\r
-       IN                              uint8_t                                         psize,\r
-       IN                              uint8_t*                                        pdata )\r
-{\r
-       kcep_t                          *p_cep;\r
-\r
-       AL_ENTER( AL_DBG_CM );\r
-\r
-       CL_ASSERT( h_al );\r
-\r
-       p_cep = __lookup_cep( h_al, cid );\r
-       if( !p_cep )\r
-       {\r
-               AL_EXIT( AL_DBG_CM );\r
-               return IB_INVALID_HANDLE;\r
-       }\r
-       cl_memclr( p_cep->pdata, sizeof(p_cep->pdata) );\r
-       p_cep->psize = min( psize, sizeof(p_cep->pdata) );\r
-       memcpy( p_cep->pdata, pdata, p_cep->psize );\r
-       AL_PRINT(TRACE_LEVEL_INFORMATION ,AL_DBG_CM ,\r
-               ("__cep_set_pdata: set %d of pdata for cid %d, h_al %p, context %p \n", \r
-               p_cep->psize, cid, h_al, p_cep->context ));\r
-\r
-       AL_EXIT( AL_DBG_CM );\r
-       return IB_SUCCESS;\r
-}\r
-\r
 /* Called with the CEP and CEP manager locks held */\r
 static ib_api_status_t\r
 __cep_queue_mad(\r
@@ -3454,15 +3436,6 @@ __cep_queue_mad(
                        // get IRP\r
                        p_list_entry = RemoveHeadList( &p_cep->irp_que );\r
                        p_irp = (PIRP)CONTAINING_RECORD( p_list_entry, IRP, Tail.Overlay.ListEntry );\r
-                       \r
-                       // store REQ private data\r
-                       __cep_set_pdata( \r
-                               (ib_al_handle_t VOID_PTR64)p_irp->Tail.Overlay.DriverContext[1], \r
-                               p_new_cep->cid, sizeof(p_req->pdata), (uint8_t*)p_req->pdata );\r
-                       AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR ,\r
-                               ("set %d of REQ pdata to CEP with cid %d, h_al %p\n", \r
-                               sizeof(p_req->pdata), p_new_cep->cid, \r
-                               (ib_al_handle_t)p_irp->Tail.Overlay.DriverContext[1] ));\r
 \r
                        // complete GetConnectionReq IRP\r
 #pragma warning(push, 3)\r
@@ -6348,7 +6321,6 @@ al_cep_get_cid(
        NTSTATUS nt_status;\r
        KLOCK_QUEUE_HANDLE hdl;\r
        ib_mad_element_t* p_mad = NULL;\r
-       mad_cm_req_t* p_req;\r
 \r
        AL_ENTER( AL_DBG_NDI );\r
        KeAcquireInStackQueuedSpinLock( &gp_cep_mgr->lock, &hdl );\r
@@ -6382,15 +6354,6 @@ al_cep_get_cid(
        p_cep->p_mad_head = p_mad->p_next;\r
        p_mad->p_next = NULL;\r
 \r
-       /* store REQ private data */\r
-       p_req = (mad_cm_req_t*)ib_get_mad_buf( p_mad );\r
-       p_new_cep = (kcep_t*)p_mad->send_context1;\r
-       __cep_set_pdata( h_al, p_new_cep->cid,\r
-               sizeof(p_req->pdata), (uint8_t*)p_req->pdata );\r
-       AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR ,\r
-               ("set %d of REQ pdata to CEP with cid %d, h_al %p\n", \r
-               sizeof(p_req->pdata), p_new_cep->cid, h_al ));\r
-\r
        /* complete the IRP */\r
        __complete_ndi_irp( p_irp, p_mad );\r
        nt_status = STATUS_EVENT_DONE;\r
@@ -6455,25 +6418,3 @@ al_cep_get_pdata(
        AL_EXIT( AL_DBG_CM );\r
        return IB_SUCCESS;\r
 }\r
-\r
-ib_api_status_t\r
-al_cep_set_pdata(\r
-       IN                              ib_al_handle_t FUNC_PTR64                               h_al,\r
-       IN                              net32_t                                         cid,\r
-       IN                              uint8_t                                         psize,\r
-       IN                              uint8_t*                                        pdata )\r
-{\r
-       ib_api_status_t         status;\r
-       KLOCK_QUEUE_HANDLE      hdl;\r
-\r
-       AL_ENTER( AL_DBG_CM );\r
-\r
-       CL_ASSERT( h_al );\r
-\r
-       KeAcquireInStackQueuedSpinLock( &gp_cep_mgr->lock, &hdl );\r
-       status = __cep_set_pdata( h_al, cid, psize, pdata );\r
-       KeReleaseInStackQueuedSpinLock( &hdl );\r
-\r
-       AL_EXIT( AL_DBG_CM );\r
-       return IB_SUCCESS;\r
-}\r
index 38a6161..e6339fd 100644 (file)
@@ -571,10 +571,6 @@ __ndi_proc_rej(
        switch (p_ndi_csq->state)\r
        {\r
        case NDI_CM_CONNECTING_REQ_SENT:\r
-               al_cep_set_pdata( p_cm->h_al, p_cm->cid, IB_REJ_PDATA_SIZE, (uint8_t*)p_rej->pdata );\r
-               AL_PRINT(TRACE_LEVEL_INFORMATION, AL_DBG_NDI ,\r
-                       ("set %d of REQ pdata to CEP with cid %d, h_al %p\n", \r
-                       IB_REJ_PDATA_SIZE, p_cm->cid, p_cm->h_al ));\r
                status = (p_rej->reason == IB_REJ_TIMEOUT) ? STATUS_TIMEOUT : STATUS_CONNECTION_REFUSED;\r
                __ndi_complete_irp_ex( h_qp, status, NDI_CM_CONNECTING_REJ_RCVD );\r
                break;\r
@@ -643,6 +639,8 @@ __ndi_proc_rep(
 \r
        AL_ENTER( AL_DBG_NDI );\r
 \r
+    UNREFERENCED_PARAMETER( p_rep );\r
+\r
        AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI ,("h_qp = 0x%p\n", p_cm->h_qp));\r
 \r
        if ( p_ndi_csq->state  != NDI_CM_CONNECTING_REQ_SENT) \r
@@ -654,12 +652,6 @@ __ndi_proc_rep(
                goto exit;\r
        }\r
 \r
-       /* fill the rej data */\r
-       al_cep_set_pdata( p_cm->h_al, p_cm->cid, IB_REJ_PDATA_SIZE, p_rep->pdata );\r
-       AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR ,\r
-               ("set %d of REQ pdata to CEP with cid %d, h_al %p\n", \r
-               IB_REJ_PDATA_SIZE, p_cm->cid, p_cm->h_al ));\r
-\r
        __ndi_complete_irp_ex( p_cm->h_qp, STATUS_SUCCESS, NDI_CM_CONNECTING_REP_RCVD );\r
 \r
 exit:  \r