From: shefty Date: Wed, 23 Jul 2008 21:13:05 +0000 (+0000) Subject: uvp/av: complete all processing in pre_create/destroy_av() calls X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a7112cfb83be6b998d703840e9c50744a8c85102;p=~shefty%2Frdma-win.git uvp/av: complete all processing in pre_create/destroy_av() calls According to the documentation, if a UVP returns IB_VERBS_PROCESSING_DONE from a pre() IOCTL call, then all verbs related processing has completed. The mthca pre_create_av() and pre_destroy_av() uvp implementation can both return IB_VERBS_PROCESSING_DONE, but requires that users still call post_create_av() and post_destroy_av(). Fix the mthca UVP to complete all processing in the pre() IOCTL calls when returning IB_VERBS_PROCESSING_DONE, and update IBAL to remove unnecessary post() IOCTL calls. Signed-off-by: Sean Hefty git-svn-id: svn://openib.tc.cornell.edu/gen1@1442 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/core/al/user/ual_av.c b/trunk/core/al/user/ual_av.c index a97358dd..4d7bb4af 100644 --- a/trunk/core/al/user/ual_av.c +++ b/trunk/core/al/user/ual_av.c @@ -68,21 +68,10 @@ ual_create_av( { status = uvp_intf.pre_create_av( h_pd->h_ci_pd, p_av_attr, &ioctl_buf.in.umv_buf, &h_av->h_ci_av ); - if( status == IB_VERBS_PROCESSING_DONE ) + if( status != IB_SUCCESS ) { - /* Creation is done entirely in user mode. Issue the post call */ - if( uvp_intf.post_create_av ) - { - uvp_intf.post_create_av( h_pd->h_ci_pd, - IB_SUCCESS, &h_av->h_ci_av, &ioctl_buf.in.umv_buf ); - } AL_EXIT( AL_DBG_AV ); - return IB_SUCCESS; - } - else if( status != IB_SUCCESS ) - { - AL_EXIT( AL_DBG_AV ); - return status; + return (status == IB_VERBS_PROCESSING_DONE) ? IB_SUCCESS : status; } } @@ -186,19 +175,10 @@ ual_destroy_av( status = uvp_intf.pre_destroy_av( h_av->h_ci_av ); CL_ASSERT( (status == IB_SUCCESS) || (status == IB_VERBS_PROCESSING_DONE) ); - if( status == IB_VERBS_PROCESSING_DONE ) - { - /* Destruction is done in user mode. Issue the post call */ - if( uvp_intf.post_destroy_av ) - uvp_intf.post_destroy_av( h_av->h_ci_av, IB_SUCCESS ); - - AL_EXIT( AL_DBG_AV ); - return IB_SUCCESS; - } - else if( status != IB_SUCCESS ) + if( status != IB_SUCCESS ) { AL_EXIT( AL_DBG_AV ); - return status; + return (status == IB_VERBS_PROCESSING_DONE) ? IB_SUCCESS : status; } } diff --git a/trunk/hw/mthca/user/mlnx_ual_av.c b/trunk/hw/mthca/user/mlnx_ual_av.c index 25c8ebd9..d3a76fc6 100644 --- a/trunk/hw/mthca/user/mlnx_ual_av.c +++ b/trunk/hw/mthca/user/mlnx_ual_av.c @@ -40,6 +40,13 @@ #include "mlnx_ual_av.tmh" #endif +static void +__post_create_av ( + IN const ib_pd_handle_t h_uvp_pd, + IN ib_api_status_t ioctl_status, + IN OUT ib_av_handle_t *ph_uvp_av, + IN OUT ci_umv_buf_t *p_umv_buf); + uint8_t gid_to_index_lookup ( @@ -192,9 +199,10 @@ __pre_create_av ( p_create_av->mr.access_flags = 0; //local read status = IB_SUCCESS; } - else + else { + __post_create_av(h_uvp_pd, IB_SUCCESS, ph_uvp_av, p_umv_buf); status = IB_VERBS_PROCESSING_DONE; - + } goto end; err_mem: @@ -351,8 +359,11 @@ __pre_destroy_av ( UVP_ENTER(UVP_DBG_AV); if (mthca_ah->in_kernel) status = IB_SUCCESS; - else + else { + mthca_free_av(mthca_ah); + cl_free(mthca_ah); status = IB_VERBS_PROCESSING_DONE; + } UVP_EXIT(UVP_DBG_AV); return status; }