From 6ec94bca1cb1108bd4619f7698b35c48eaffb07d Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 3 Feb 2010 12:03:32 -0800 Subject: [PATCH] debug prints for winverbs --- trunk/core/winverbs/user/SOURCES | 2 +- trunk/core/winverbs/user/wv_base.h | 1 + trunk/core/winverbs/user/wv_main.cpp | 1 + trunk/ulp/dapl2/dapl/openib_cma/device.c | 10 ++++++++++ trunk/ulp/dapl2/dapl/openib_scm/device.c | 10 ++++++++++ trunk/ulp/dapl2/dapl/openib_ucm/device.c | 10 ++++++++++ trunk/ulp/libibverbs/src/device.cpp | 2 +- trunk/ulp/libibverbs/src/ibv_main.cpp | 3 +++ 8 files changed, 37 insertions(+), 2 deletions(-) diff --git a/trunk/core/winverbs/user/SOURCES b/trunk/core/winverbs/user/SOURCES index 6939d1e7..33fa8837 100644 --- a/trunk/core/winverbs/user/SOURCES +++ b/trunk/core/winverbs/user/SOURCES @@ -14,7 +14,7 @@ DLLDEF = $(OBJ_PATH)\$O\wv_exports.def !endif DLLENTRY = DllMain -USE_NTDLL = 1 +USE_MSVCRT = 1 SOURCES = \ winverbs.rc \ diff --git a/trunk/core/winverbs/user/wv_base.h b/trunk/core/winverbs/user/wv_base.h index f37cf96b..d41a5ee1 100644 --- a/trunk/core/winverbs/user/wv_base.h +++ b/trunk/core/winverbs/user/wv_base.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/trunk/core/winverbs/user/wv_main.cpp b/trunk/core/winverbs/user/wv_main.cpp index 32d1aaee..552c8762 100644 --- a/trunk/core/winverbs/user/wv_main.cpp +++ b/trunk/core/winverbs/user/wv_main.cpp @@ -48,6 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) break; case DLL_PROCESS_DETACH: HeapDestroy(heap); +printf("WvRef %d\n", WvRef); break; default: break; diff --git a/trunk/ulp/dapl2/dapl/openib_cma/device.c b/trunk/ulp/dapl2/dapl/openib_cma/device.c index 32090fbe..c9d3756d 100644 --- a/trunk/ulp/dapl2/dapl/openib_cma/device.c +++ b/trunk/ulp/dapl2/dapl/openib_cma/device.c @@ -502,6 +502,16 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HCA * hca_ptr) dapl_os_sleep_usec(1000); } bail: + if (hca_ptr->ib_trans.ib_cq) + ibv_destroy_comp_channel(hca_ptr->ib_trans.ib_cq); + + if (hca_ptr->ib_trans.ib_cq_empty) { + struct ibv_comp_channel *channel; + channel = hca_ptr->ib_trans.ib_cq_empty->channel; + ibv_destroy_cq(hca_ptr->ib_trans.ib_cq_empty); + ibv_destroy_comp_channel(channel); + } + if (hca_ptr->ib_hca_handle != IB_INVALID_HANDLE) { if (rdma_destroy_id(hca_ptr->ib_trans.cm_id)) return (dapl_convert_errno(errno, "ib_close_device")); diff --git a/trunk/ulp/dapl2/dapl/openib_scm/device.c b/trunk/ulp/dapl2/dapl/openib_scm/device.c index bb3893a7..04e992a8 100644 --- a/trunk/ulp/dapl2/dapl/openib_scm/device.c +++ b/trunk/ulp/dapl2/dapl/openib_scm/device.c @@ -504,6 +504,16 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HCA * hca_ptr) } out: + if (hca_ptr->ib_trans.ib_cq) + ibv_destroy_comp_channel(hca_ptr->ib_trans.ib_cq); + + if (hca_ptr->ib_trans.ib_cq_empty) { + struct ibv_comp_channel *channel; + channel = hca_ptr->ib_trans.ib_cq_empty->channel; + ibv_destroy_cq(hca_ptr->ib_trans.ib_cq_empty); + ibv_destroy_comp_channel(channel); + } + if (hca_ptr->ib_hca_handle != IB_INVALID_HANDLE) { if (ibv_close_device(hca_ptr->ib_hca_handle)) return (dapl_convert_errno(errno, "ib_close_device")); diff --git a/trunk/ulp/dapl2/dapl/openib_ucm/device.c b/trunk/ulp/dapl2/dapl/openib_ucm/device.c index e890eeff..c583b40b 100644 --- a/trunk/ulp/dapl2/dapl/openib_ucm/device.c +++ b/trunk/ulp/dapl2/dapl/openib_ucm/device.c @@ -401,6 +401,16 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HCA * hca_ptr) destroy_os_signal(hca_ptr); ucm_service_destroy(hca_ptr); + if (hca_ptr->ib_trans.ib_cq) + ibv_destroy_comp_channel(hca_ptr->ib_trans.ib_cq); + + if (hca_ptr->ib_trans.ib_cq_empty) { + struct ibv_comp_channel *channel; + channel = hca_ptr->ib_trans.ib_cq_empty->channel; + ibv_destroy_cq(hca_ptr->ib_trans.ib_cq_empty); + ibv_destroy_comp_channel(channel); + } + if (hca_ptr->ib_hca_handle != IB_INVALID_HANDLE) { if (ibv_close_device(hca_ptr->ib_hca_handle)) return (dapl_convert_errno(errno, "ib_close_device")); diff --git a/trunk/ulp/libibverbs/src/device.cpp b/trunk/ulp/libibverbs/src/device.cpp index 1b66d3ce..65f7056f 100644 --- a/trunk/ulp/libibverbs/src/device.cpp +++ b/trunk/ulp/libibverbs/src/device.cpp @@ -36,7 +36,7 @@ CRITICAL_SECTION lock; IWVProvider *prov; COMP_MANAGER comp_mgr; -static DWORD ref; +DWORD ref; struct verbs_device { diff --git a/trunk/ulp/libibverbs/src/ibv_main.cpp b/trunk/ulp/libibverbs/src/ibv_main.cpp index 76216e06..d0924bda 100644 --- a/trunk/ulp/libibverbs/src/ibv_main.cpp +++ b/trunk/ulp/libibverbs/src/ibv_main.cpp @@ -28,9 +28,11 @@ */ #include +#include extern CRITICAL_SECTION lock; HANDLE heap; +extern DWORD ref; BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { @@ -46,6 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) InitializeCriticalSection(&lock); break; case DLL_PROCESS_DETACH: +printf("ref %d\n", ref); DeleteCriticalSection(&lock); HeapDestroy(heap); break; -- 2.46.0