[ofw] DAPL2 - patch
Stan C. Smith
stan.smith at intel.com
Thu Jun 12 17:35:39 PDT 2008
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 for wr_id,
even with suppressed completions, to handle events during errors.
Signed-off by: Stan Smith stan.smith at intel.com
--- C:\openib-windows-svn\1207\gen1\trunk\ulp\dapl2\dapl\ibal\dapl_ibal_extensions.c 2007-10-16 17:05:06.000000000
-0700
+++ C:\Documents and Settings\scsmith\My
Documents\openIB-windows\SVN\gen1\trunk\ulp\dapl2\dapl\ibal\dapl_ibal_extensions.c 2008-06-04 14:18:22.921875000
-0700
@@ -172,7 +172,7 @@
{
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 @@
/*
* 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 @@
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:
More information about the ofw
mailing list