[MTHCA] 1. bugfix: get down to the kernel in destroy_av to release resources.
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 17 Apr 2006 13:27:29 +0000 (13:27 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 17 Apr 2006 13:27:29 +0000 (13:27 +0000)
2. cosmetics

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@311 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/mt_verbs.c
hw/mthca/user/mlnx_ual_av.c
hw/mthca/user/mlnx_ual_cq.c

index 739af0d..afac235 100644 (file)
@@ -110,7 +110,7 @@ struct ib_pd *ibv_alloc_pd(struct ib_device *device,
                pd->device  = device;
                pd->ucontext = context;
                atomic_set(&pd->usecnt, 0);
-               HCA_PRINT(TRACE_LEVEL_INFORMATION  ,HCA_DBG_SHIM        ,("PD%d use cnt %d, pd_handle %p, ctx %p \n", 
+               HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_CQ ,("PD%d use cnt %d, pd_handle %p, ctx %p \n", 
                        ((struct mthca_pd*)pd)->pd_num, pd->usecnt, pd, pd->ucontext));
        }
 
@@ -120,11 +120,11 @@ struct ib_pd *ibv_alloc_pd(struct ib_device *device,
 int ibv_dealloc_pd(struct ib_pd *pd)
 {
        if (atomic_read(&pd->usecnt)) {
-               HCA_PRINT(TRACE_LEVEL_ERROR  ,HCA_DBG_SHIM      ,("resources are not released (cnt %d)\n", pd->usecnt));
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_CQ,("resources are not released (cnt %d)\n", pd->usecnt));
                return -EBUSY;
        }               
 
-       HCA_PRINT(TRACE_LEVEL_INFORMATION  ,HCA_DBG_SHIM        ,("PD%d use cnt %d, pd_handle %p, ctx %p \n", 
+       HCA_PRINT(TRACE_LEVEL_INFORMATION ,HCA_DBG_CQ ,("PD%d use cnt %d, pd_handle %p, ctx %p \n", 
                ((struct mthca_pd*)pd)->pd_num, pd->usecnt, pd, pd->ucontext));
        return pd->device->dealloc_pd(pd);
 }
@@ -267,6 +267,7 @@ int ibv_destroy_ah(struct ib_ah *ah)
        struct ib_ucontext      *ucontext;
        struct ib_mr * ib_mr;
 
+       HCA_ENTER(HCA_DBG_AV);
        pd = ah->pd;
        ucontext = ah->ucontext;
        ib_mr = ah->ib_mr;
@@ -278,7 +279,7 @@ int ibv_destroy_ah(struct ib_ah *ah)
                        ((struct mthca_pd*)pd)->pd_num, pd->usecnt, pd, pd->ucontext));
        }
        release_user_cq_qp_resources(ucontext, ib_mr);
-
+       HCA_EXIT(HCA_DBG_AV);
        return ret;
 }
 
index fe55440..71ebbe3 100644 (file)
@@ -349,9 +349,9 @@ ib_api_status_t
 mlnx_pre_destroy_av (\r
     IN         const ib_av_handle_t            h_uvp_av)\r
 {\r
-    UVP_ENTER(UVP_DBG_AV);\r
-    UVP_EXIT(UVP_DBG_AV);\r
-    return IB_VERBS_PROCESSING_DONE;\r
+       UVP_ENTER(UVP_DBG_AV);\r
+       UVP_EXIT(UVP_DBG_AV);\r
+       return IB_SUCCESS;\r
 }\r
 \r
 void\r
index 4a916d4..dfcb12f 100644 (file)
@@ -46,7 +46,7 @@ void
 mlnx_get_cq_interface (\r
     IN OUT     uvp_interface_t         *p_uvp )\r
 {\r
-    UVP_ENTER(UVP_DBG_SHIM);\r
+    UVP_ENTER(UVP_DBG_DEV);\r
 \r
     CL_ASSERT(p_uvp);\r
 \r
@@ -65,7 +65,7 @@ mlnx_get_cq_interface (
     p_uvp->pre_destroy_cq  = mlnx_pre_destroy_cq;\r
     p_uvp->post_destroy_cq = mlnx_post_destroy_cq;\r
 \r
-    UVP_EXIT(UVP_DBG_SHIM);\r
+    UVP_EXIT(UVP_DBG_DEV);\r
 }\r
 \r
 ib_api_status_t\r
@@ -81,7 +81,7 @@ ib_api_status_t
        struct ibv_create_cq *p_create_cq;\r
        int err;\r
 \r
-       UVP_ENTER(UVP_DBG_SHIM);\r
+       UVP_ENTER(UVP_DBG_CQ);\r
 \r
        CL_ASSERT(p_umv_buf);\r
 \r
@@ -103,7 +103,7 @@ ib_api_status_t
        ibv_cq = p_hobul->ibv_ctx->ops.create_cq_pre(p_hobul->ibv_ctx, p_size, p_create_cq);\r
        if (IS_ERR(ibv_cq)) {\r
                err = PTR_ERR(ibv_cq);\r
-               UVP_PRINT(TRACE_LEVEL_ERROR ,UVP_DBG_SHIM , ("mthca_alloc_cq_pre failed (%d)\n", err));\r
+               UVP_PRINT(TRACE_LEVEL_ERROR ,UVP_DBG_CQ , ("mthca_alloc_cq_pre failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
                goto err_alloc_cq;\r
        }\r
@@ -114,8 +114,8 @@ err_alloc_cq:
        cl_free(p_umv_buf->p_inout_buf);\r
 err_memory:\r
 end:\r
-               UVP_EXIT(UVP_DBG_SHIM);\r
-               return status;\r
+       UVP_EXIT(UVP_DBG_CQ);\r
+       return status;\r
 }\r
 \r
 \r
@@ -185,11 +185,11 @@ mlnx_pre_query_cq (
 {\r
        mlnx_ual_cq_info_t *p_cq_info = (mlnx_ual_cq_info_t *)((void*) h_uvp_cq);\r
 \r
-       UVP_ENTER(UVP_DBG_SHIM);\r
+       UVP_ENTER(UVP_DBG_CQ);\r
 \r
        *p_size = p_cq_info->cq_size;\r
 \r
-       UVP_EXIT(UVP_DBG_SHIM);\r
+       UVP_EXIT(UVP_DBG_CQ);\r
        return IB_VERBS_PROCESSING_DONE;\r
 }\r
 \r
@@ -198,8 +198,8 @@ ib_api_status_t
 mlnx_pre_destroy_cq (\r
     IN         const ib_cq_handle_t                    h_uvp_cq)\r
 {\r
-    UVP_ENTER(UVP_DBG_SHIM);\r
-    UVP_EXIT(UVP_DBG_SHIM);\r
+    UVP_ENTER(UVP_DBG_CQ);\r
+    UVP_EXIT(UVP_DBG_CQ);\r
     return IB_SUCCESS;\r
 }\r
 \r
@@ -212,16 +212,16 @@ mlnx_post_destroy_cq (
        mlnx_ual_cq_info_t *p_cq_info = (mlnx_ual_cq_info_t *) ((void*)h_uvp_cq);\r
     UNREFERENCED_PARAMETER(ioctl_status);\r
 \r
-    UVP_ENTER(UVP_DBG_SHIM);\r
+    UVP_ENTER(UVP_DBG_CQ);\r
 \r
     CL_ASSERT(p_cq_info || p_cq_info->ibv_cq);\r
 \r
        err = p_cq_info->p_hobul->ibv_ctx->ops.destroy_cq( p_cq_info->ibv_cq );\r
        if (err) \r
-               UVP_PRINT(TRACE_LEVEL_ERROR ,UVP_DBG_SHIM , ("mthca_destroy_cq failed (%d)\n", err));\r
+               UVP_PRINT(TRACE_LEVEL_ERROR ,UVP_DBG_CQ, ("mthca_destroy_cq failed (%d)\n", err));\r
 \r
     cl_free (p_cq_info);\r
-    UVP_EXIT(UVP_DBG_SHIM);\r
+    UVP_EXIT(UVP_DBG_CQ);\r
     return;\r
 }\r
 \r