[MTHCA] remove macro HCA_PRINT_EXIT (no implementation in WPP)
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 7 Feb 2007 13:56:47 +0000 (13:56 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 7 Feb 2007 13:56:47 +0000 (13:56 +0000)
fix some cosmetics issues in prints

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

hw/mthca/kernel/SOURCES
hw/mthca/kernel/hca_debug.h
hw/mthca/kernel/hca_direct.c
hw/mthca/kernel/hca_mcast.c
hw/mthca/kernel/hca_memory.c
hw/mthca/kernel/hca_verbs.c
hw/mthca/kernel/mt_verbs.c

index f3b1a99..bff6b39 100644 (file)
@@ -77,8 +77,7 @@ TARGETLIBS= \
 C_DEFINES = $(C_DEFINES) -DEVENT_TRACING\r
 RUN_WPP= $(SOURCES) -km -ext: .c .h .C .H \\r
        -scan:hca_debug.h \\r
-       -func:HCA_PRINT(LEVEL,FLAGS,(MSG,...)) \\r
-       -func:HCA_PRINT_EXIT(LEVEL,FLAGS,(MSG,...)) \r
+       -func:HCA_PRINT(LEVEL,FLAGS,(MSG,...)) \r
 !ENDIF\r
 \r
 #      -func:HCA_PRINT_EV(LEVEL,FLAGS,(MSG,...)) \\r
index 31a48ca..18dba8f 100644 (file)
@@ -77,14 +77,17 @@ static void _build_str( const char *        format, ... )
        WPP_DEFINE_BIT( HCA_DBG_INIT) \\r
        WPP_DEFINE_BIT( HCA_DBG_MAD) \\r
        WPP_DEFINE_BIT( HCA_DBG_PO) \\r
+       WPP_DEFINE_BIT( HCA_DBG_PD)\\r
        WPP_DEFINE_BIT( HCA_DBG_CQ) \\r
        WPP_DEFINE_BIT( HCA_DBG_QP) \\r
        WPP_DEFINE_BIT( HCA_DBG_MEMORY) \\r
        WPP_DEFINE_BIT( HCA_DBG_AV) \\r
        WPP_DEFINE_BIT( HCA_DBG_SRQ) \\r
+       WPP_DEFINE_BIT( HCA_DBG_MCAST) \\r
        WPP_DEFINE_BIT( HCA_DBG_LOW) \\r
        WPP_DEFINE_BIT( HCA_DBG_SHIM))\r
 \r
+\r
 #define WPP_GLOBALLOGGER\r
 \r
 \r
@@ -100,11 +103,10 @@ static void _build_str( const char *      format, ... )
 // USEPREFIX(HCA_PRINT, "%!STDPREFIX! [MTHCA] :%!FUNC!() :");\r
 // USESUFFIX(HCA_ENTER, " [MTHCA] :%!FUNC!()[");\r
 // USESUFFIX(HCA_EXIT, " [MTHCA] :%!FUNC!()]");\r
-// USEPREFIX(HCA_PRINT_EXIT, "%!STDPREFIX! [MTHCA] :%!FUNC!() :");\r
-// USESUFFIX(HCA_PRINT_EXIT, "[MTHCA] :%!FUNC!():]");\r
 // end_wpp\r
 \r
 \r
+\r
 #define HCA_PRINT_EV(_level_,_flag_,_msg_)  \\r
     { \\r
            HCA_PRINT_EV_MDEV(_level_,_flag_,_msg_) \\r
@@ -125,14 +127,16 @@ static void _build_str( const char *      format, ... )
 #define HCA_DBG_PNP    (1<<1)\r
 #define HCA_DBG_INIT   (1 << 2)\r
 #define HCA_DBG_MAD    (1 << 3)\r
-#define HCA_DBG_PO     (1 << 4)\r
-#define HCA_DBG_QP     (1 << 5)\r
-#define HCA_DBG_CQ     (1 << 6)\r
-#define HCA_DBG_MEMORY (1 << 7)\r
-#define HCA_DBG_AV     (1<<8)\r
-#define HCA_DBG_SRQ    (1 << 9)\r
-#define HCA_DBG_LOW    (1 << 10)\r
-#define HCA_DBG_SHIM   (1 << 11)\r
+#define HCA_DBG_PO             (1 << 4)\r
+#define HCA_DBG_PD             (1<<5)\r
+#define HCA_DBG_QP             (1 << 6)\r
+#define HCA_DBG_CQ             (1 << 7)\r
+#define HCA_DBG_MEMORY (1 << 8)\r
+#define HCA_DBG_AV             (1<<9)\r
+#define HCA_DBG_SRQ    (1 << 10)\r
+#define HCA_DBG_MCAST  (1<<11)\r
+#define HCA_DBG_LOW    (1 << 12)\r
+#define HCA_DBG_SHIM   (1 << 13)\r
 \r
 \r
 #if DBG\r
@@ -168,14 +172,6 @@ static void _build_str( const char *       format, ... )
        HCA_PRINT(TRACE_LEVEL_VERBOSE, flags, ("]\n" ));\r
 \r
 \r
-#define HCA_PRINT_EXIT(_level_,_flag_,_msg_)   \\r
-       {\\r
-               if (status != IB_SUCCESS) {\\r
-                       HCA_PRINT(_level_,_flag_,_msg_);\\r
-               }\\r
-               HCA_EXIT(_flag_);\\r
-       }\r
-\r
 #endif //EVENT_TRACING\r
 \r
 \r
index 1ef67a6..69e9135 100644 (file)
@@ -81,8 +81,12 @@ mlnx_post_send (
        status = IB_SUCCESS;\r
                \r
 err_post_send: \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_QP,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+               if (status != IB_SUCCESS) \r
+               {\r
+                       HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_QP,\r
+                               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+               }\r
+               HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
                                                                                                                                                        \r
 }\r
@@ -115,8 +119,12 @@ mlnx_post_recv (
        status = IB_SUCCESS;\r
                \r
 err_post_recv: \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_QP,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+               if (status != IB_SUCCESS) \r
+               {\r
+                       HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_QP,\r
+                               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+               }\r
+               HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
                                                                                                                                                        \r
 }\r
@@ -132,11 +140,11 @@ mlnx_post_srq_recv (
        struct ib_srq *ib_srq_p = (struct ib_srq *)h_srq;\r
        struct ib_device *ib_dev = ib_srq_p->device;\r
        \r
-       HCA_ENTER(HCA_DBG_QP);\r
+       HCA_ENTER(HCA_DBG_SRQ);\r
 \r
        err = ib_dev->post_srq_recv(ib_srq_p, p_recv_wr, pp_failed );\r
        if (err) {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR  ,HCA_DBG_QP,\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SRQ,\r
                        ("post_srq_recv failed (%d)\n", err));\r
                if (err == -ENOMEM)\r
                        status = IB_INSUFFICIENT_RESOURCES;\r
@@ -148,8 +156,12 @@ mlnx_post_srq_recv (
        status = IB_SUCCESS;\r
                \r
 err_post_recv: \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_QP,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SRQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SRQ);\r
        return status;\r
                                                                                                                                                        \r
 }\r
@@ -198,11 +210,12 @@ mlnx_poll_cq (
                status = IB_NOT_FOUND;\r
                \r
 err_invalid_params:    \r
-       if (status != IB_NOT_FOUND){\r
-               HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_CQ,\r
+       if (status != IB_SUCCESS && status  != IB_NOT_FOUND)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,\r
                        ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
-       }else\r
-               HCA_EXIT(HCA_DBG_CQ);\r
+       }\r
+       HCA_EXIT(HCA_DBG_CQ);\r
        return status;\r
                                                                                                                                                        \r
 }\r
@@ -217,18 +230,22 @@ mlnx_enable_cq_notify (
        struct ib_cq *ib_cq_p = (struct ib_cq *)h_cq;\r
        PREP_IBDEV_FOR_PRINT(ib_cq_p->device);\r
 \r
-       HCA_ENTER(HCA_DBG_SHIM);\r
+       HCA_ENTER(HCA_DBG_CQ);\r
 \r
        // REARM CQ\r
        err = ib_req_notify_cq(ib_cq_p, (solicited) ? IB_CQ_SOLICITED : IB_CQ_NEXT_COMP );\r
        if (err) {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR   ,HCA_DBG_SHIM,\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,\r
                        ("ib_req_notify_cq failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
        }\r
                \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_CQ);\r
        return status;\r
 }\r
 \r
@@ -242,17 +259,21 @@ mlnx_enable_ncomp_cq_notify (
        struct ib_cq *ib_cq_p = (struct ib_cq *)h_cq;\r
        PREP_IBDEV_FOR_PRINT(ib_cq_p->device);\r
 \r
-       HCA_ENTER(HCA_DBG_SHIM);\r
+       HCA_ENTER(HCA_DBG_CQ);\r
 \r
        err = ib_req_ncomp_notif(ib_cq_p, n_cqes );\r
        if (err) {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR   ,HCA_DBG_SHIM,\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,\r
                        ("ib_req_ncomp_notif failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
        }\r
                \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_CQ);\r
        return status;\r
 }\r
 \r
@@ -267,7 +288,7 @@ mlnx_bind_mw (
        UNREFERENCED_PARAMETER(h_qp);\r
        UNREFERENCED_PARAMETER(p_mw_bind);\r
        UNREFERENCED_PARAMETER(p_rkey);\r
-       HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM  ,("mlnx_bind_mw not implemented\n"));\r
+       HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SHIM,("mlnx_bind_mw not implemented\n"));\r
        return IB_INVALID_CA_HANDLE;\r
 }\r
 \r
index 42a17bd..1df61bf 100644 (file)
@@ -61,11 +61,11 @@ mlnx_attach_mcast (
        PREP_IBDEV_FOR_PRINT(ib_qp_p->device);\r
        mlnx_mcast_t *mcast_p;\r
 \r
-       HCA_ENTER(HCA_DBG_SHIM);\r
+       HCA_ENTER(HCA_DBG_MCAST);\r
 \r
        // sanity checks\r
        if( p_umv_buf && p_umv_buf->command ) {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR , HCA_DBG_SHIM,\r
+               HCA_PRINT(TRACE_LEVEL_ERROR , HCA_DBG_MCAST,\r
                        ("User mode is not supported yet\n"));\r
                status = IB_UNSUPPORTED;\r
                goto err_user_unsupported;\r
@@ -95,7 +95,7 @@ mlnx_attach_mcast (
        else {\r
                err = ibv_attach_mcast(ib_qp_p, (union ib_gid *)p_mcast_gid, (u16)mcast_lid);\r
                if (err) {\r
-                       HCA_PRINT(TRACE_LEVEL_ERROR  ,HCA_DBG_SHIM  ,\r
+                       HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_MCAST,\r
                                ("ibv_attach_mcast failed (%d)\n", err));\r
                        status = errno_to_iberr(err);\r
                        goto err_attach;\r
@@ -106,7 +106,8 @@ mlnx_attach_mcast (
        mcast_p->ib_qp_p = ib_qp_p;\r
        mcast_p->mcast_lid = mcast_lid;\r
        RtlCopyMemory(mcast_p->mcast_gid.raw, p_mcast_gid->raw, sizeof *p_mcast_gid);\r
-       HCA_PRINT(TRACE_LEVEL_INFORMATION, HCA_DBG_SHIM, ("mcasth %p, qp_p %p, mlid %hx, mgid %I64x`%I64x\n", \r
+       HCA_PRINT(TRACE_LEVEL_INFORMATION,HCA_DBG_MCAST,\r
+               ("mcasth %p, qp_p %p, mlid %hx, mgid %I64x`%I64x\n", \r
                mcast_p, mcast_p->ib_qp_p, mcast_p->mcast_lid,\r
                cl_ntoh64(*(uint64_t*)&mcast_p->mcast_gid.raw[0]),\r
                cl_ntoh64(*(uint64_t*)&mcast_p->mcast_gid.raw[8] )));\r
@@ -124,8 +125,12 @@ err_invalid_param:
 err_unsupported:       \r
 err_user_unsupported:\r
 end:           \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_MCAST,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MCAST);\r
        return status;\r
 }\r
 \r
@@ -138,10 +143,12 @@ mlnx_detach_mcast (
        mlnx_mcast_t *mcast_p = (mlnx_mcast_t*)h_mcast;\r
        struct ib_device *ib_dev;\r
 \r
+       \r
+       HCA_ENTER(HCA_DBG_MCAST);\r
        // sanity check\r
        if (!mcast_p || !mcast_p->ib_qp_p)\r
        {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR , HCA_DBG_SHIM,\r
+               HCA_PRINT(TRACE_LEVEL_ERROR , HCA_DBG_MCAST,\r
                        ("completes with ERROR status IB_INVALID_PARAMETER\n"));\r
                status =  IB_INVALID_PARAMETER;\r
                goto err_invalid_param;\r
@@ -154,7 +161,8 @@ mlnx_detach_mcast (
        }\r
 \r
 \r
-       HCA_PRINT(TRACE_LEVEL_INFORMATION, HCA_DBG_SHIM,("mcasth %p, qp_p %p, mlid %hx, mgid %I64x`%I64x\n", \r
+       HCA_PRINT(TRACE_LEVEL_INFORMATION,HCA_DBG_MCAST,\r
+               ("mcasth %p, qp_p %p, mlid %hx, mgid %I64x`%I64x\n", \r
                mcast_p, mcast_p->ib_qp_p, mcast_p->mcast_lid,\r
                *(uint64_t*)&mcast_p->mcast_gid.raw[0],\r
                *(uint64_t*)&mcast_p->mcast_gid.raw[8] ));\r
@@ -163,7 +171,8 @@ mlnx_detach_mcast (
        err = ibv_detach_mcast( mcast_p->ib_qp_p, \r
                (union ib_gid *)&mcast_p->mcast_gid, mcast_p->mcast_lid );\r
        if (err) {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR  ,HCA_DBG_SHIM  ,("ibv_detach_mcast failed (%d)\n", err));\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_MCAST,\r
+                       ("ibv_detach_mcast failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
                goto err_detach_mcast;\r
        }\r
@@ -173,9 +182,13 @@ mlnx_detach_mcast (
 err_detach_mcast:\r
        kfree(mcast_p);\r
 err_unsupported:       \r
-       HCA_PRINT(TRACE_LEVEL_ERROR , HCA_DBG_SHIM ,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
 err_invalid_param:\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_MCAST,\r
+                       ("completes with ERROR status %d\n", status));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MCAST);\r
        return status;\r
 }\r
 \r
index 90b4e89..e3fdcd6 100644 (file)
@@ -107,8 +107,12 @@ err_reg_mr:
 err_invalid_access:    \r
 err_invalid_parm:\r
 err_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MEMORY);\r
        return status;\r
 }\r
 \r
@@ -189,8 +193,12 @@ err_reg_phys_mr:
 err_invalid_parm:\r
 err_unsupported:\r
 err_mem:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MEMORY,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MEMORY);\r
        return status;\r
        \r
 }\r
@@ -311,8 +319,12 @@ done:
        \r
 err_dereg_mr:\r
 err_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MEMORY,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MEMORY);\r
        return status;\r
                \r
 }\r
@@ -372,8 +384,12 @@ mlnx_alloc_fmr(
 err_alloc_fmr:\r
 err_invalid_parm:\r
 err_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MEMORY,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MEMORY);\r
        return status;\r
 \r
 }\r
@@ -413,8 +429,12 @@ mlnx_map_phys_fmr (
        status = IB_SUCCESS;\r
        \r
 err_dealloc_fmr:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MEMORY,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MEMORY);\r
        return status;\r
 }\r
 \r
@@ -453,8 +473,12 @@ mlnx_unmap_fmr (
        \r
 err_unmap_fmr:\r
 err_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MEMORY,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MEMORY);\r
        return status;\r
        \r
        \r
@@ -495,8 +519,12 @@ mlnx_dealloc_fmr (
        \r
 err_dealloc_fmr:\r
 err_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MEMORY,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MEMORY);\r
        return status;\r
                \r
 }\r
index 5cc8a2a..5d8f74d 100644 (file)
@@ -74,8 +74,12 @@ mlnx_open_ca (
        // find CA object\r
        p_hca = mlnx_hca_from_guid( ca_guid );\r
        if( !p_hca ) {\r
-               HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
+               if (status != IB_SUCCESS) \r
+               {\r
+                       HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
                        ("completes with ERROR status IB_NOT_FOUND\n"));\r
+               }\r
+               HCA_EXIT(HCA_DBG_SHIM);\r
                return IB_NOT_FOUND;\r
        }\r
 \r
@@ -104,8 +108,12 @@ done:
 \r
 //err_mad_cache:\r
 err_set_cb:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SHIM,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SHIM);\r
        return status;\r
 }\r
 \r
@@ -306,7 +314,8 @@ err_byte_count:
 err_unsupported:\r
 err_user_unsupported:\r
        if( status != IB_INSUFFICIENT_MEMORY && status != IB_SUCCESS )\r
-               HCA_PRINT(TRACE_LEVEL_ERROR     , HCA_DBG_SHIM  ,("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+               HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_SHIM,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
        HCA_EXIT(HCA_DBG_SHIM);\r
        return status;\r
 }\r
@@ -368,7 +377,12 @@ mlnx_modify_ca (
 err_modify_port:\r
 err_port:\r
 err_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM  ,("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_SHIM,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SHIM);\r
        return status;\r
 }\r
 \r
@@ -482,8 +496,12 @@ err_alloc_ucontext:
 end:\r
        if (p_umv_buf && p_umv_buf->command) \r
                p_umv_buf->status = status;\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS) \r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SHIM,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SHIM);\r
        return status;\r
 }\r
 \r
@@ -532,7 +550,7 @@ mlnx_allocate_pd (
        //TODO: how are we use it ?\r
        UNREFERENCED_PARAMETER(type);\r
        \r
-       HCA_ENTER(HCA_DBG_SHIM);\r
+       HCA_ENTER(HCA_DBG_PD);\r
 \r
        if( p_umv_buf ) {\r
                p_context = (struct ib_ucontext *)h_ca;\r
@@ -548,7 +566,7 @@ mlnx_allocate_pd (
        ib_pd_p = ibv_alloc_pd(ib_dev, p_context, p_umv_buf);\r
        if (IS_ERR(ib_pd_p)) {\r
                err = PTR_ERR(ib_pd_p);\r
-               HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_PD,\r
                        ("ibv_alloc_pd failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
                goto err_alloc_pd;\r
@@ -562,8 +580,12 @@ mlnx_allocate_pd (
 err_alloc_pd:  \r
        if (p_umv_buf && p_umv_buf->command) \r
                p_umv_buf->status = status;\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_PD,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_PD);\r
        return status;\r
 }\r
 \r
@@ -576,15 +598,15 @@ mlnx_deallocate_pd (
        struct ib_pd *ib_pd_p = (struct ib_pd *)h_pd;\r
        PREP_IBDEV_FOR_PRINT(ib_pd_p->device);\r
 \r
-       HCA_ENTER( HCA_DBG_QP);\r
+       HCA_ENTER( HCA_DBG_PD);\r
 \r
-       HCA_PRINT(TRACE_LEVEL_INFORMATION       ,HCA_DBG_SHIM  ,\r
+       HCA_PRINT(TRACE_LEVEL_INFORMATION,HCA_DBG_PD,\r
                ("pcs %p\n", PsGetCurrentProcess()));\r
        \r
        // dealloc pd\r
        err = ibv_dealloc_pd( ib_pd_p );\r
        if (err) {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR  ,HCA_DBG_SHIM\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_PD\r
                        ,("ibv_dealloc_pd failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
                goto err_dealloc_pd;\r
@@ -592,8 +614,12 @@ mlnx_deallocate_pd (
        status = IB_SUCCESS;\r
 \r
 err_dealloc_pd:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM\r
+       if (status != IB_SUCCESS) \r
+       {\r
+                       HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_PD\r
                ,("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_PD);\r
        return status;\r
 }\r
 \r
@@ -652,8 +678,12 @@ err_alloc_av:
 err_inval_params:\r
        if (p_umv_buf && p_umv_buf->command) \r
                p_umv_buf->status = status;\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR ,HCA_DBG_AV,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_AV,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_AV);\r
        return status;\r
 }\r
 \r
@@ -707,8 +737,12 @@ mlnx_query_av (
        \r
 err_conv_mthca_av:\r
 err_user_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_AV,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_AV,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_AV);\r
        return status;\r
 }\r
 \r
@@ -727,7 +761,7 @@ mlnx_modify_av (
 \r
        // sanity checks\r
        if( p_umv_buf && p_umv_buf->command ) {\r
-                       HCA_PRINT(TRACE_LEVEL_ERROR   ,HCA_DBG_AV,\r
+                       HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_AV,\r
                                ("User mode is not supported yet\n"));\r
                        status = IB_UNSUPPORTED;\r
                        goto err_user_unsupported;\r
@@ -742,7 +776,7 @@ mlnx_modify_av (
        //TODO: not implemented in low-level driver\r
        err = ibv_modify_ah(ib_ah_p, &ah_attr)\r
        if (err) {\r
-               HCA_PRINT (TRACE_LEVEL_ERROR, HCA_DBG_AV,\r
+               HCA_PRINT (TRACE_LEVEL_ERROR,HCA_DBG_AV,\r
                        ("ibv_query_ah failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
                goto err_query_ah;\r
@@ -753,8 +787,12 @@ mlnx_modify_av (
 #endif\r
 \r
 err_user_unsupported:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_AV,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_AV,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_AV);\r
        return status;\r
 }\r
 \r
@@ -779,8 +817,12 @@ mlnx_destroy_av (
        }\r
 \r
 err_destroy_ah:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_AV,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_AV,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_AV);\r
        return status;\r
 }\r
 \r
@@ -849,8 +891,12 @@ err_create_srq:
 err_inval_params:\r
        if (p_umv_buf && p_umv_buf->command) \r
                p_umv_buf->status = status;\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR ,HCA_DBG_SRQ,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SRQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SRQ);\r
        return status;\r
 }\r
 \r
@@ -878,8 +924,12 @@ mlnx_modify_srq (
                status = errno_to_iberr(err);\r
        }\r
 \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SRQ,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SRQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SRQ);\r
        return status;\r
 }\r
 \r
@@ -894,7 +944,7 @@ mlnx_query_srq (
        struct ib_srq *ib_srq = (struct ib_srq *)h_srq;\r
        struct ib_device *ib_dev = ib_srq->device;\r
        UNUSED_PARAM(p_umv_buf);\r
-    UNUSED_PARAM_WOWPP(ib_dev);\r
+       UNUSED_PARAM_WOWPP(ib_dev);\r
 \r
        HCA_ENTER(HCA_DBG_SRQ);\r
 \r
@@ -905,8 +955,12 @@ mlnx_query_srq (
                status = errno_to_iberr(err);\r
        }\r
 \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SRQ,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SRQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SRQ);\r
        return status;\r
 }\r
 \r
@@ -929,8 +983,12 @@ mlnx_destroy_srq (
                status = errno_to_iberr(err);\r
        }\r
 \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SRQ,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SRQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_SRQ);\r
        return status;\r
 }\r
 \r
@@ -1023,8 +1081,12 @@ err_inval_params:
 end:\r
        if (p_umv_buf && p_umv_buf->command) \r
                p_umv_buf->status = status;\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR ,HCA_DBG_QP ,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_QP,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
 }\r
 \r
@@ -1045,8 +1107,12 @@ mlnx_create_spl_qp (
        status =        _create_qp( h_pd, port_num,\r
                qp_context, p_create_attr, p_qp_attr, ph_qp, NULL );\r
                \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_QP,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
 }\r
 \r
@@ -1072,8 +1138,12 @@ mlnx_create_qp (
        status = _create_qp( h_pd, port_num,\r
                qp_context, p_create_attr, p_qp_attr, ph_qp, p_umv_buf );\r
                \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR ,HCA_DBG_QP,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_QP,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
 }\r
 \r
@@ -1114,7 +1184,8 @@ mlnx_modify_qp (
        // modify QP\r
        err = ibv_modify_qp(ib_qp_p, &qp_attr, qp_attr_mask);\r
        if (err) {\r
-               HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_QP ,("ibv_modify_qp failed (%d)\n", err));\r
+               HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_QP,\r
+                       ("ibv_modify_qp failed (%d)\n", err));\r
                status = errno_to_iberr(err);\r
                goto err_modify_qp;\r
        }\r
@@ -1149,8 +1220,12 @@ err_mode_unsupported:
 err_inval_params:\r
        if (p_umv_buf && p_umv_buf->command) \r
                p_umv_buf->status = status;\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_QP,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
 }\r
 \r
@@ -1163,7 +1238,6 @@ mlnx_query_qp (
        ib_api_status_t         status = IB_SUCCESS;\r
        struct ib_qp *ib_qp_p = (struct ib_qp *)h_qp;\r
        struct mthca_qp *qp_p = (struct mthca_qp *)ib_qp_p;\r
-       PREP_IBDEV_FOR_PRINT(ib_qp_p->device);\r
 \r
        UNREFERENCED_PARAMETER(p_umv_buf);\r
        \r
@@ -1207,8 +1281,7 @@ mlnx_query_qp (
 \r
        status = IB_SUCCESS;\r
 \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR , HCA_DBG_QP,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
 }\r
 \r
@@ -1240,8 +1313,12 @@ mlnx_destroy_qp (
        status = IB_SUCCESS;\r
 \r
 err_destroy_qp:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR ,HCA_DBG_QP,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_QP,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_QP);\r
        return status;\r
 }\r
 \r
@@ -1321,8 +1398,12 @@ err_inval_params:
 err_cqe:\r
        if (p_umv_buf && p_umv_buf->command) \r
                p_umv_buf->status = status;\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR ,HCA_DBG_CQ,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_CQ);\r
        return status;\r
 }\r
 \r
@@ -1337,7 +1418,7 @@ mlnx_resize_cq (
        if (p_umv_buf && p_umv_buf->command) {\r
                p_umv_buf->status = IB_UNSUPPORTED;\r
        }\r
-       HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM  ,("mlnx_resize_cq not implemented\n"));\r
+       HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_CQ,("mlnx_resize_cq not implemented\n"));\r
        return IB_UNSUPPORTED;\r
 }\r
 \r
@@ -1352,7 +1433,7 @@ mlnx_query_cq (
        if (p_umv_buf && p_umv_buf->command) {\r
                p_umv_buf->status = IB_UNSUPPORTED;\r
        }\r
-       HCA_PRINT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM  ,("mlnx_query_cq not implemented\n"));\r
+       HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,("mlnx_query_cq not implemented\n"));\r
        return IB_UNSUPPORTED;\r
 }\r
 \r
@@ -1368,7 +1449,7 @@ mlnx_destroy_cq (
 \r
        HCA_ENTER( HCA_DBG_QP);\r
 \r
-       HCA_PRINT(TRACE_LEVEL_INFORMATION       ,HCA_DBG_SHIM  ,\r
+       HCA_PRINT(TRACE_LEVEL_INFORMATION,HCA_DBG_CQ,\r
                ("cqn %#x, pcs %p\n", ((struct mthca_cq*)ib_cq_p)->cqn, PsGetCurrentProcess()) );\r
 \r
        // destroy CQ\r
@@ -1383,8 +1464,12 @@ mlnx_destroy_cq (
        status = IB_SUCCESS;\r
 \r
 err_destroy_cq:\r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_CQ,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_CQ);\r
        return status;\r
 }\r
 \r
@@ -1498,8 +1583,12 @@ err_grh_alloc:
                cl_free(wc_p);\r
 err_wc_alloc:\r
 err_port_num:  \r
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_MAD,\r
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       if (status != IB_SUCCESS)\r
+       {\r
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_MAD,\r
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
+       }\r
+       HCA_EXIT(HCA_DBG_MAD);\r
        return status;\r
 }\r
        \r
index b6bbcbe..29955e3 100644 (file)
@@ -63,7 +63,7 @@ void ibv_um_close(    struct ib_ucontext * h_um_ca )
        context_p->is_removing = TRUE;
 
        if (atomic_read(&context_p->usecnt)) {
-               HCA_PRINT(TRACE_LEVEL_ERROR  ,HCA_DBG_SHIM,
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SHIM,
                        ("resources are not released (cnt %d)\n", context_p->usecnt));
                status = IB_RESOURCE_BUSY;
                goto err_usage;
@@ -71,20 +71,20 @@ void ibv_um_close(  struct ib_ucontext * h_um_ca )
        
        err = ibv_dealloc_pd( context_p->pd );
        if (err) {
-               HCA_PRINT(TRACE_LEVEL_ERROR  ,HCA_DBG_SHIM,
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SHIM,
                        ("ibv_dealloc_pd failed (%d)\n", err));
                status = errno_to_iberr(err);
        }
 
        err = mthca_dealloc_ucontext(context_p);
        if (err) {
-               HCA_PRINT(TRACE_LEVEL_ERROR   ,HCA_DBG_SHIM,
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SHIM,
                        ("mthca_dealloc_ucontext failed (%d)\n", err));
                status = errno_to_iberr(err);
                goto err_dealloc_ucontext;
        }
 
-       HCA_PRINT(TRACE_LEVEL_INFORMATION       ,HCA_DBG_SHIM,
+       HCA_PRINT(TRACE_LEVEL_INFORMATION,HCA_DBG_SHIM,
                ("pcs %p\n", PsGetCurrentProcess()) );
        status = IB_SUCCESS;
        goto end;
@@ -92,8 +92,12 @@ void ibv_um_close(   struct ib_ucontext * h_um_ca )
 err_dealloc_ucontext: 
 err_usage:
 end:
-       HCA_PRINT_EXIT(TRACE_LEVEL_ERROR  , HCA_DBG_SHIM,
-               ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));
+       if (status != IB_SUCCESS)
+       {
+               HCA_PRINT(TRACE_LEVEL_ERROR,HCA_DBG_SHIM,
+                       ("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));
+       }
+       HCA_EXIT(HCA_DBG_SHIM);
        return;
 }