[DAPL2] Request extensions didn't allocate a cookie if the completion was suppressed...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 13 Jun 2008 00:00:03 +0000 (00:00 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 13 Jun 2008 00:00:03 +0000 (00:00 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1264 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/dapl2/dapl/ibal/dapl_ibal_extensions.c

index b2231f9..f6c3bba 100644 (file)
@@ -172,7 +172,7 @@ dapli_post_ext( IN       DAT_EP_HANDLE              ep_handle,
 {\r
        DAPL_EP         *ep_ptr;\r
        ib_qp_handle_t  qp_ptr;\r
-       DAPL_COOKIE     *cookie;\r
+       DAPL_COOKIE     *cookie=NULL;\r
        DAT_RETURN      dat_status = DAT_SUCCESS;\r
 \r
        dapl_dbg_log(DAPL_DBG_TYPE_API,\r
@@ -194,32 +194,27 @@ dapli_post_ext( IN       DAT_EP_HANDLE            ep_handle,
        /*\r
         * Synchronization ok since this buffer is only used for send\r
         * requests, which aren't allowed to race with each other.\r
-        * only if completion is expected\r
         */\r
-       if (!(DAT_COMPLETION_SUPPRESS_FLAG & flags)) {\r
+       dat_status = dapls_dto_cookie_alloc(\r
+                                       &ep_ptr->req_buffer,\r
+                                       DAPL_DTO_TYPE_EXTENSION,\r
+                                       user_cookie,\r
+                                       &cookie );\r
 \r
-               dat_status = dapls_dto_cookie_alloc(\r
-                                               &ep_ptr->req_buffer,\r
-                                               DAPL_DTO_TYPE_EXTENSION,\r
-                                               user_cookie,\r
-                                               &cookie );\r
-\r
-               if ( dat_status != DAT_SUCCESS )\r
-               {\r
+       if ( dat_status != DAT_SUCCESS )\r
+       {\r
 #ifdef DAPL_DBG\r
-                       dapl_dbg_log(DAPL_DBG_TYPE_ERR,\r
-                                       "%s() cookie alloc faulure %x\n",\r
-                                       __FUNCTION__,dat_status);\r
+               dapl_dbg_log(DAPL_DBG_TYPE_ERR,"%s() cookie alloc faulure %x\n",\r
+                               __FUNCTION__,dat_status);\r
 #endif\r
-                       goto bail;\r
-               }\r
-               \r
-               /*\r
-                * Take reference before posting to avoid race conditions with\r
-                * completions\r
-                */\r
-               dapl_os_atomic_inc(&ep_ptr->req_count);\r
+               goto bail;\r
        }\r
+               \r
+       /*\r
+        * Take reference before posting to avoid race conditions with\r
+        * completions\r
+        */\r
+       dapl_os_atomic_inc(&ep_ptr->req_count);\r
 \r
        /*\r
         * Invoke provider specific routine to post DTO\r
@@ -237,16 +232,13 @@ dapli_post_ext( IN       DAT_EP_HANDLE            ep_handle,
 \r
        if (dat_status != DAT_SUCCESS)\r
        {\r
-               if ( cookie != NULL )\r
-               {\r
-                       dapl_os_atomic_dec(&ep_ptr->req_count);\r
-                       dapls_cookie_dealloc(&ep_ptr->req_buffer, cookie);\r
+               dapl_os_atomic_dec(&ep_ptr->req_count);\r
+               dapls_cookie_dealloc(&ep_ptr->req_buffer, cookie);\r
 #ifdef DAPL_DBG\r
-                       dapl_dbg_log(DAPL_DBG_TYPE_ERR,\r
-                                       "%s() post_ex_send err %d @ line %d\n",\r
-                                       __FUNCTION__,dat_status,__LINE__);\r
+               dapl_dbg_log(DAPL_DBG_TYPE_ERR,\r
+                               "%s() post_ex_send err %d @ line %d\n",\r
+                               __FUNCTION__,dat_status,__LINE__);\r
 #endif\r
-               }\r
        }\r
 \r
 bail:\r