From: Arlin Davis Date: Thu, 4 Feb 2010 00:21:30 +0000 (-0800) Subject: destroy verbs completion channels created via ia_open or ep_create. X-Git-Tag: dapl-2.0.27-1~7 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=855a8e4aa83fa2e4f7847122415106f49286f4ca;p=~ardavis%2Fdapl.git destroy verbs completion channels created via ia_open or ep_create. Completion channels are created with ia_open for CNO events and with ep_create in cases where DAT allows EP(qp) to be created with no EVD(cq) and IB doesn't. These completion channels need to be destroyed at close along with a CQ for the EP without CQ case. Signed-off-by: Arlin Davis --- diff --git a/dapl/openib_cma/device.c b/dapl/openib_cma/device.c index 7ab05aa..12593cf 100644 --- a/dapl/openib_cma/device.c +++ b/dapl/openib_cma/device.c @@ -502,6 +502,17 @@ 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/dapl/openib_scm/device.c b/dapl/openib_scm/device.c index 35d4c45..eb87a85 100644 --- a/dapl/openib_scm/device.c +++ b/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/dapl/openib_ucm/device.c b/dapl/openib_ucm/device.c index e890eef..1f324b3 100644 --- a/dapl/openib_ucm/device.c +++ b/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"));