From: sleybo Date: Tue, 28 Nov 2006 07:34:15 +0000 (+0000) Subject: [IBAL] set the h_ci_mcast for user mode detruction X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=19cfe89f0cbcec1be8ce73218f68357c6ec6d450;p=~shefty%2Frdma-win.git [IBAL] set the h_ci_mcast for user mode detruction set the obj.hdl only if ioctl status is IB_SUCCESS git-svn-id: svn://openib.tc.cornell.edu/gen1@551 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/core/al/user/ual_av.c b/trunk/core/al/user/ual_av.c index 1923b31b..1a6729cd 100644 --- a/trunk/core/al/user/ual_av.c +++ b/trunk/core/al/user/ual_av.c @@ -95,10 +95,12 @@ ual_create_av( if( cl_status != CL_SUCCESS || bytes_ret != sizeof(ioctl_buf.out) ) status = IB_ERROR; else + { status = ioctl_buf.out.status; - - h_av->obj.hdl = ioctl_buf.out.h_av; - + if(status == IB_SUCCESS) + h_av->obj.hdl = ioctl_buf.out.h_av; + } + /* Post uvp call */ if( h_pd->h_ci_pd && uvp_intf.post_create_av ) { @@ -124,6 +126,7 @@ ual_pd_alias_create_av( ual_create_av_ioctl_t ioctl_buf; uintn_t bytes_ret; cl_status_t cl_status = CL_ERROR; + ib_api_status_t status = IB_ERROR; AL_ENTER( AL_DBG_AV ); /* Clear the ioctl_buf */ @@ -139,16 +142,19 @@ ual_pd_alias_create_av( if( cl_status != CL_SUCCESS || bytes_ret != sizeof(ioctl_buf.out) ) { - AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR, + AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR, ("UAL_CREATE_AV IOCTL returned %s\n", CL_STATUS_MSG(cl_status)) ); - return IB_ERROR; + status = IB_ERROR; + }else + { + status = ioctl_buf.out.status; + if(status == IB_SUCCESS) + h_av->obj.hdl = ioctl_buf.out.h_av; } - if( ioctl_buf.out.status == IB_SUCCESS ) - h_av->obj.hdl = ioctl_buf.out.h_av; AL_EXIT( AL_DBG_AV ); - return ioctl_buf.out.status; + return status; } diff --git a/trunk/core/al/user/ual_mad.c b/trunk/core/al/user/ual_mad.c index d59cfaf7..a59df935 100644 --- a/trunk/core/al/user/ual_mad.c +++ b/trunk/core/al/user/ual_mad.c @@ -133,6 +133,9 @@ ual_reg_mad_svc( else { status = ioctl_buf.out.status; + if(status == IB_SUCCESS) + h_mad_svc->obj.hdl = ioctl_buf.out.h_mad_svc; + } if( status != IB_SUCCESS ) @@ -142,7 +145,6 @@ ual_reg_mad_svc( return status; } - h_mad_svc->obj.hdl = ioctl_buf.out.h_mad_svc; *ph_mad_svc = h_mad_svc; AL_EXIT( AL_DBG_MAD ); @@ -325,10 +327,11 @@ ual_create_reg_mad_pool( IN const ib_pd_handle_t h_pd, IN OUT ib_pool_key_t p_pool_key ) { - ual_reg_mad_pool_ioctl_t ioctl_buf; + ual_reg_mad_pool_ioctl_t ioctl_buf; uintn_t bytes_ret; cl_status_t cl_status; - + ib_api_status_t status = IB_ERROR; + AL_ENTER( AL_DBG_MAD ); /*TODO: Can h_pool be removed as a param? */ @@ -345,17 +348,23 @@ ual_create_reg_mad_pool( if( cl_status != CL_SUCCESS || bytes_ret != sizeof(ioctl_buf.out) ) { - AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR, + AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR, ("UAL_REG_MAD_POOL IOCTL returned %s.\n", CL_STATUS_MSG(cl_status)) ); - return IB_ERROR; + status = IB_ERROR; + } + else + { + status = ioctl_buf.out.status; + if(status == IB_SUCCESS ) + p_pool_key->obj.hdl = ioctl_buf.out.pool_key; } if( ioctl_buf.out.status == IB_SUCCESS ) p_pool_key->obj.hdl = ioctl_buf.out.pool_key; AL_EXIT( AL_DBG_MAD ); - return ioctl_buf.out.status; + return status; } diff --git a/trunk/core/al/user/ual_mcast.c b/trunk/core/al/user/ual_mcast.c index 0da173a1..6f05f3db 100644 --- a/trunk/core/al/user/ual_mcast.c +++ b/trunk/core/al/user/ual_mcast.c @@ -51,7 +51,7 @@ ual_attach_mcast( ual_attach_mcast_ioctl_t ioctl_buf; uintn_t bytes_ret; cl_status_t cl_status; - ib_api_status_t status; + ib_api_status_t status = IB_ERROR; ib_qp_handle_t h_qp; uvp_interface_t uvp_intf; @@ -96,8 +96,10 @@ ual_attach_mcast( else { status = ioctl_buf.out.status; - if( status == IB_SUCCESS ) + if( status == IB_SUCCESS ){ h_mcast->obj.hdl = ioctl_buf.out.h_attach; + h_mcast->h_ci_mcast = (ib_mcast_handle_t)ioctl_buf.out.h_attach; + } } /* Post uvp call */ diff --git a/trunk/core/al/user/ual_mr.c b/trunk/core/al/user/ual_mr.c index 0af1c36d..c137c7a7 100644 --- a/trunk/core/al/user/ual_mr.c +++ b/trunk/core/al/user/ual_mr.c @@ -60,6 +60,7 @@ ual_reg_mem( ual_reg_mem_ioctl_t mr_ioctl; uintn_t bytes_ret; cl_status_t cl_status; + ib_api_status_t status = IB_ERROR; AL_ENTER( AL_DBG_MR ); @@ -75,21 +76,24 @@ ual_reg_mem( if( cl_status != CL_SUCCESS || bytes_ret != sizeof(mr_ioctl.out) ) { - AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR, + AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR, ("UAL_REG_MR IOCTL returned %s.\n", CL_STATUS_MSG(cl_status)) ); - return IB_ERROR; + status = IB_ERROR; } - - if( mr_ioctl.out.status == IB_SUCCESS ) + else { - h_mr->obj.hdl = mr_ioctl.out.h_mr; - *p_lkey = mr_ioctl.out.lkey; - *p_rkey = mr_ioctl.out.rkey; + status = mr_ioctl.out.status; + if( status == IB_SUCCESS ) + { + h_mr->obj.hdl = mr_ioctl.out.h_mr; + *p_lkey = mr_ioctl.out.lkey; + *p_rkey = mr_ioctl.out.rkey; + } } AL_EXIT( AL_DBG_MR ); - return mr_ioctl.out.status; + return status; } diff --git a/trunk/core/al/user/ual_mw.c b/trunk/core/al/user/ual_mw.c index 65e9c939..3fefe0e0 100644 --- a/trunk/core/al/user/ual_mw.c +++ b/trunk/core/al/user/ual_mw.c @@ -93,6 +93,11 @@ ual_create_mw( else { status = mw_ioctl.out.status; + if( status == IB_SUCCESS ) + { + h_mw->obj.hdl = mw_ioctl.out.h_mw; + *p_rkey = mw_ioctl.out.rkey; + } } /* Post uvp call */ @@ -103,11 +108,7 @@ ual_create_mw( &mw_ioctl.out.umv_buf ); } - if( status == IB_SUCCESS ) - { - h_mw->obj.hdl = mw_ioctl.out.h_mw; - *p_rkey = mw_ioctl.out.rkey; - } + AL_EXIT( AL_DBG_MW ); return status; diff --git a/trunk/core/al/user/ual_pd.c b/trunk/core/al/user/ual_pd.c index 3d47dbf4..b069591b 100644 --- a/trunk/core/al/user/ual_pd.c +++ b/trunk/core/al/user/ual_pd.c @@ -95,9 +95,12 @@ ual_allocate_pd( else { status = pd_ioctl.out.status; + if( status == IB_SUCCESS ) + h_pd->obj.hdl = pd_ioctl.out.h_pd; + } - h_pd->obj.hdl = pd_ioctl.out.h_pd; + /* Post uvp call */ if( pd_type != IB_PDT_ALIAS && h_uvp_ca && uvp_intf.post_allocate_pd )