]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[IBAL] set the h_ci_mcast for user mode detruction
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Nov 2006 07:34:15 +0000 (07:34 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Nov 2006 07:34:15 +0000 (07:34 +0000)
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

trunk/core/al/user/ual_av.c
trunk/core/al/user/ual_mad.c
trunk/core/al/user/ual_mcast.c
trunk/core/al/user/ual_mr.c
trunk/core/al/user/ual_mw.c
trunk/core/al/user/ual_pd.c

index 1923b31b9f42b79a9386937b79d7be7c6b713037..1a6729cdb01c97e01b50043840ebe8968b264ede 100644 (file)
@@ -95,10 +95,12 @@ ual_create_av(
        if( cl_status != CL_SUCCESS || bytes_ret != sizeof(ioctl_buf.out) )\r
                status = IB_ERROR;\r
        else\r
+       {\r
                status = ioctl_buf.out.status;\r
-\r
-       h_av->obj.hdl = ioctl_buf.out.h_av;\r
-\r
+               if(status == IB_SUCCESS)\r
+                       h_av->obj.hdl = ioctl_buf.out.h_av;\r
+       }\r
+       \r
        /* Post uvp call */\r
        if( h_pd->h_ci_pd && uvp_intf.post_create_av )\r
        {\r
@@ -124,6 +126,7 @@ ual_pd_alias_create_av(
        ual_create_av_ioctl_t   ioctl_buf;\r
        uintn_t                                 bytes_ret;\r
        cl_status_t                             cl_status = CL_ERROR;\r
+       ib_api_status_t                 status = IB_ERROR;\r
 \r
        AL_ENTER( AL_DBG_AV );\r
        /* Clear the ioctl_buf */\r
@@ -139,16 +142,19 @@ ual_pd_alias_create_av(
 \r
        if( cl_status != CL_SUCCESS || bytes_ret != sizeof(ioctl_buf.out) )\r
        {\r
-               AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
+               AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
                        ("UAL_CREATE_AV IOCTL returned %s\n", CL_STATUS_MSG(cl_status)) );\r
-               return IB_ERROR;\r
+               status =  IB_ERROR;\r
+       }else\r
+       {\r
+               status = ioctl_buf.out.status;\r
+               if(status == IB_SUCCESS)\r
+                       h_av->obj.hdl = ioctl_buf.out.h_av;\r
        }\r
 \r
-       if( ioctl_buf.out.status == IB_SUCCESS )\r
-               h_av->obj.hdl = ioctl_buf.out.h_av;\r
 \r
        AL_EXIT( AL_DBG_AV );\r
-       return ioctl_buf.out.status;\r
+       return status;\r
 }\r
 \r
 \r
index d59cfaf7a9727e812ed410a905b1bc47f4aa1afe..a59df9355e2943f1739e3247153fe43ec45defff 100644 (file)
@@ -133,6 +133,9 @@ ual_reg_mad_svc(
        else\r
        {\r
                status = ioctl_buf.out.status;\r
+               if(status == IB_SUCCESS)\r
+                       h_mad_svc->obj.hdl = ioctl_buf.out.h_mad_svc;\r
+                       \r
        }\r
 \r
        if( status != IB_SUCCESS )\r
@@ -142,7 +145,6 @@ ual_reg_mad_svc(
                return status;\r
        }\r
 \r
-       h_mad_svc->obj.hdl = ioctl_buf.out.h_mad_svc;\r
        *ph_mad_svc = h_mad_svc;\r
 \r
        AL_EXIT( AL_DBG_MAD );\r
@@ -325,10 +327,11 @@ ual_create_reg_mad_pool(
        IN              const   ib_pd_handle_t                          h_pd,\r
        IN      OUT                     ib_pool_key_t                           p_pool_key )\r
 {\r
-       ual_reg_mad_pool_ioctl_t        ioctl_buf;\r
+       ual_reg_mad_pool_ioctl_t                ioctl_buf;\r
        uintn_t                                         bytes_ret;\r
        cl_status_t                                     cl_status;\r
-\r
+       ib_api_status_t                         status = IB_ERROR;\r
+       \r
        AL_ENTER( AL_DBG_MAD );\r
 \r
        /*TODO: Can h_pool be removed as a param? */\r
@@ -345,17 +348,23 @@ ual_create_reg_mad_pool(
 \r
        if( cl_status != CL_SUCCESS || bytes_ret != sizeof(ioctl_buf.out) )\r
        {\r
-               AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
+               AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
                        ("UAL_REG_MAD_POOL IOCTL returned %s.\n",\r
                        CL_STATUS_MSG(cl_status)) );\r
-               return IB_ERROR;\r
+               status =  IB_ERROR;\r
+       }\r
+       else\r
+       {\r
+               status =  ioctl_buf.out.status;\r
+               if(status == IB_SUCCESS )\r
+                       p_pool_key->obj.hdl = ioctl_buf.out.pool_key;\r
        }\r
 \r
        if( ioctl_buf.out.status == IB_SUCCESS )\r
                p_pool_key->obj.hdl = ioctl_buf.out.pool_key;\r
 \r
        AL_EXIT( AL_DBG_MAD );\r
-       return ioctl_buf.out.status;\r
+       return status;\r
 }\r
 \r
 \r
index 0da173a1ee74faccd018d4ed66561c448920a145..6f05f3dbd986555bdf364c78db309cc8a8bc86cc 100644 (file)
@@ -51,7 +51,7 @@ ual_attach_mcast(
        ual_attach_mcast_ioctl_t        ioctl_buf;\r
        uintn_t                                         bytes_ret;\r
        cl_status_t                                     cl_status;\r
-       ib_api_status_t                         status;\r
+       ib_api_status_t                         status = IB_ERROR;\r
        ib_qp_handle_t                          h_qp;\r
        uvp_interface_t                         uvp_intf;\r
 \r
@@ -96,8 +96,10 @@ ual_attach_mcast(
        else\r
        {\r
                status = ioctl_buf.out.status;\r
-               if( status == IB_SUCCESS )\r
+               if( status == IB_SUCCESS ){\r
                        h_mcast->obj.hdl = ioctl_buf.out.h_attach;\r
+                       h_mcast->h_ci_mcast = (ib_mcast_handle_t)ioctl_buf.out.h_attach;\r
+               }\r
        }\r
 \r
        /* Post uvp call */\r
index 0af1c36d82b52beaa64e6522a3d217ccf931913e..c137c7a7349e52b1f3957d78c5b9ba4206f72e5d 100644 (file)
@@ -60,6 +60,7 @@ ual_reg_mem(
        ual_reg_mem_ioctl_t             mr_ioctl;\r
        uintn_t                                 bytes_ret;\r
        cl_status_t                             cl_status;\r
+       ib_api_status_t                 status = IB_ERROR;\r
 \r
        AL_ENTER( AL_DBG_MR );\r
 \r
@@ -75,21 +76,24 @@ ual_reg_mem(
 \r
        if( cl_status != CL_SUCCESS || bytes_ret != sizeof(mr_ioctl.out) )\r
        {\r
-               AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
+               AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
                        ("UAL_REG_MR IOCTL returned %s.\n",\r
                        CL_STATUS_MSG(cl_status)) );\r
-               return IB_ERROR;\r
+               status = IB_ERROR;\r
        }\r
-\r
-       if( mr_ioctl.out.status == IB_SUCCESS )\r
+       else\r
        {\r
-               h_mr->obj.hdl = mr_ioctl.out.h_mr;\r
-               *p_lkey = mr_ioctl.out.lkey;\r
-               *p_rkey = mr_ioctl.out.rkey;\r
+               status = mr_ioctl.out.status;\r
+               if( status == IB_SUCCESS )\r
+               {\r
+                       h_mr->obj.hdl = mr_ioctl.out.h_mr;\r
+                       *p_lkey = mr_ioctl.out.lkey;\r
+                       *p_rkey = mr_ioctl.out.rkey;\r
+               }\r
        }\r
 \r
        AL_EXIT( AL_DBG_MR );\r
-       return mr_ioctl.out.status;\r
+       return status;\r
 }\r
 \r
 \r
index 65e9c93980866ec299c186b912202e5e1ff56e93..3fefe0e0e509228548bddf3653e3f845731f1780 100644 (file)
@@ -93,6 +93,11 @@ ual_create_mw(
        else\r
        {\r
                status = mw_ioctl.out.status;\r
+               if( status == IB_SUCCESS )\r
+               {\r
+                       h_mw->obj.hdl = mw_ioctl.out.h_mw;\r
+                       *p_rkey = mw_ioctl.out.rkey;\r
+               }\r
        }\r
 \r
        /* Post uvp call */\r
@@ -103,11 +108,7 @@ ual_create_mw(
                        &mw_ioctl.out.umv_buf );\r
        }\r
 \r
-       if( status == IB_SUCCESS )\r
-       {\r
-               h_mw->obj.hdl = mw_ioctl.out.h_mw;\r
-               *p_rkey = mw_ioctl.out.rkey;\r
-       }\r
+       \r
 \r
        AL_EXIT( AL_DBG_MW );\r
        return status;\r
index 3d47dbf48cc2c88859baff9fea5a62983b102f51..b069591b62b96735cf2ec83c85741a5ff6c8e3da 100644 (file)
@@ -95,9 +95,12 @@ ual_allocate_pd(
        else\r
        {\r
                status = pd_ioctl.out.status;\r
+               if( status == IB_SUCCESS )\r
+                       h_pd->obj.hdl = pd_ioctl.out.h_pd;\r
+                       \r
        }\r
 \r
-       h_pd->obj.hdl = pd_ioctl.out.h_pd;\r
+\r
 \r
        /* Post uvp call */\r
        if( pd_type != IB_PDT_ALIAS && h_uvp_ca && uvp_intf.post_allocate_pd )\r