From a36e94da91fa4d60e8cde1dff1067e7654a52805 Mon Sep 17 00:00:00 2001 From: stansmith Date: Fri, 13 Jun 2008 00:00:03 +0000 Subject: [PATCH] [DAPL2] Request extensions didn't allocate a cookie if the completion was suppressed, which resulted in segfault during provider post call. Provider's expect a *cookie in wr_id, even with surpressed completions, needed to handle events during errors. git-svn-id: svn://openib.tc.cornell.edu/gen1@1264 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- .../dapl2/dapl/ibal/dapl_ibal_extensions.c | 52 ++++++++----------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/trunk/ulp/dapl2/dapl/ibal/dapl_ibal_extensions.c b/trunk/ulp/dapl2/dapl/ibal/dapl_ibal_extensions.c index b2231f96..f6c3bba1 100644 --- a/trunk/ulp/dapl2/dapl/ibal/dapl_ibal_extensions.c +++ b/trunk/ulp/dapl2/dapl/ibal/dapl_ibal_extensions.c @@ -172,7 +172,7 @@ dapli_post_ext( IN DAT_EP_HANDLE ep_handle, { DAPL_EP *ep_ptr; ib_qp_handle_t qp_ptr; - DAPL_COOKIE *cookie; + DAPL_COOKIE *cookie=NULL; DAT_RETURN dat_status = DAT_SUCCESS; dapl_dbg_log(DAPL_DBG_TYPE_API, @@ -194,32 +194,27 @@ dapli_post_ext( IN DAT_EP_HANDLE ep_handle, /* * Synchronization ok since this buffer is only used for send * requests, which aren't allowed to race with each other. - * only if completion is expected */ - if (!(DAT_COMPLETION_SUPPRESS_FLAG & flags)) { + dat_status = dapls_dto_cookie_alloc( + &ep_ptr->req_buffer, + DAPL_DTO_TYPE_EXTENSION, + user_cookie, + &cookie ); - dat_status = dapls_dto_cookie_alloc( - &ep_ptr->req_buffer, - DAPL_DTO_TYPE_EXTENSION, - user_cookie, - &cookie ); - - if ( dat_status != DAT_SUCCESS ) - { + if ( dat_status != DAT_SUCCESS ) + { #ifdef DAPL_DBG - dapl_dbg_log(DAPL_DBG_TYPE_ERR, - "%s() cookie alloc faulure %x\n", - __FUNCTION__,dat_status); + dapl_dbg_log(DAPL_DBG_TYPE_ERR,"%s() cookie alloc faulure %x\n", + __FUNCTION__,dat_status); #endif - goto bail; - } - - /* - * Take reference before posting to avoid race conditions with - * completions - */ - dapl_os_atomic_inc(&ep_ptr->req_count); + goto bail; } + + /* + * Take reference before posting to avoid race conditions with + * completions + */ + dapl_os_atomic_inc(&ep_ptr->req_count); /* * Invoke provider specific routine to post DTO @@ -237,16 +232,13 @@ dapli_post_ext( IN DAT_EP_HANDLE ep_handle, if (dat_status != DAT_SUCCESS) { - if ( cookie != NULL ) - { - dapl_os_atomic_dec(&ep_ptr->req_count); - dapls_cookie_dealloc(&ep_ptr->req_buffer, cookie); + dapl_os_atomic_dec(&ep_ptr->req_count); + dapls_cookie_dealloc(&ep_ptr->req_buffer, cookie); #ifdef DAPL_DBG - dapl_dbg_log(DAPL_DBG_TYPE_ERR, - "%s() post_ex_send err %d @ line %d\n", - __FUNCTION__,dat_status,__LINE__); + dapl_dbg_log(DAPL_DBG_TYPE_ERR, + "%s() post_ex_send err %d @ line %d\n", + __FUNCTION__,dat_status,__LINE__); #endif - } } bail: -- 2.41.0