]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
dapl: release completion channels
authorSean Hefty <sean.hefty@intel.com>
Thu, 4 Feb 2010 01:03:47 +0000 (17:03 -0800)
committerSean Hefty <sean.hefty@intel.com>
Thu, 4 Feb 2010 01:03:47 +0000 (17:03 -0800)
Cleanup allocated completion channels.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
trunk/ulp/dapl2/dapl/openib_cma/device.c
trunk/ulp/dapl2/dapl/openib_scm/device.c
trunk/ulp/dapl2/dapl/openib_ucm/device.c

index 32090fbef3c7bf97b695130a848a1de680394f71..c9d3756d71fc65b5af25680c96714e5e93f60855 100644 (file)
@@ -502,6 +502,16 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HCA * hca_ptr)
                dapl_os_sleep_usec(1000);\r
        }\r
 bail:\r
+       if (hca_ptr->ib_trans.ib_cq)\r
+               ibv_destroy_comp_channel(hca_ptr->ib_trans.ib_cq);\r
+\r
+       if (hca_ptr->ib_trans.ib_cq_empty) {\r
+               struct ibv_comp_channel *channel;\r
+               channel = hca_ptr->ib_trans.ib_cq_empty->channel;\r
+               ibv_destroy_cq(hca_ptr->ib_trans.ib_cq_empty);\r
+               ibv_destroy_comp_channel(channel);\r
+       }\r
+\r
        if (hca_ptr->ib_hca_handle != IB_INVALID_HANDLE) {\r
                if (rdma_destroy_id(hca_ptr->ib_trans.cm_id))\r
                        return (dapl_convert_errno(errno, "ib_close_device"));\r
index bb3893a72c3de5ade7fb323216f2f4a75e1f1872..04e992a8ef86dbb1bd317dfeb9da5c41a16d6b4e 100644 (file)
@@ -504,6 +504,16 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HCA * hca_ptr)
        }\r
 \r
 out:\r
+       if (hca_ptr->ib_trans.ib_cq)\r
+               ibv_destroy_comp_channel(hca_ptr->ib_trans.ib_cq);\r
+\r
+       if (hca_ptr->ib_trans.ib_cq_empty) {\r
+               struct ibv_comp_channel *channel;\r
+               channel = hca_ptr->ib_trans.ib_cq_empty->channel;\r
+               ibv_destroy_cq(hca_ptr->ib_trans.ib_cq_empty);\r
+               ibv_destroy_comp_channel(channel);\r
+       }\r
+\r
        if (hca_ptr->ib_hca_handle != IB_INVALID_HANDLE) {\r
                if (ibv_close_device(hca_ptr->ib_hca_handle))\r
                        return (dapl_convert_errno(errno, "ib_close_device"));\r
index e890eefff056d73325c51858f05e0d4e82543b9f..a9cec73e91204719e28afaa16fcdc9037d94af6e 100644 (file)
@@ -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)\r
+               ibv_destroy_comp_channel(hca_ptr->ib_trans.ib_cq);\r
+\r
+       if (hca_ptr->ib_trans.ib_cq_empty) {\r
+               struct ibv_comp_channel *channel;\r
+               channel = hca_ptr->ib_trans.ib_cq_empty->channel;\r
+               ibv_destroy_cq(hca_ptr->ib_trans.ib_cq_empty);\r
+               ibv_destroy_comp_channel(channel);\r
+       }\r
+
        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"));