From f0ed5177c257294793fd49d25678d63270cee080 Mon Sep 17 00:00:00 2001 From: Arlin Davis Date: Fri, 11 Jul 2014 09:11:25 -0700 Subject: [PATCH] ucm: remove duplicate async_event code, use common async event call Signed-off-by: Arlin Davis --- dapl/openib_ucm/cm.c | 2 +- dapl/openib_ucm/dapl_ib_util.h | 2 +- dapl/openib_ucm/device.c | 93 ---------------------------------- 3 files changed, 2 insertions(+), 95 deletions(-) diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c index d6f923e..53422e1 100644 --- a/dapl/openib_ucm/cm.c +++ b/dapl/openib_ucm/cm.c @@ -2227,7 +2227,7 @@ void cm_thread(void *arg) } if (dapl_poll(hca->ib_hca_handle->async_fd, DAPL_FD_READ) == DAPL_FD_READ) { - ucm_async_event(hca); + dapli_async_event_cb(&hca->ib_trans); } if (dapl_poll(hca->ib_trans.ib_cq->fd, DAPL_FD_READ) == DAPL_FD_READ) { diff --git a/dapl/openib_ucm/dapl_ib_util.h b/dapl/openib_ucm/dapl_ib_util.h index cae25ac..49f89fa 100644 --- a/dapl/openib_ucm/dapl_ib_util.h +++ b/dapl/openib_ucm/dapl_ib_util.h @@ -145,7 +145,7 @@ typedef struct _ib_hca_transport /* prototypes */ void cm_thread(void *arg); -void ucm_async_event(struct dapl_hca *hca); +void dapli_async_event_cb(struct _ib_hca_transport *tp); void dapli_cq_event_cb(struct _ib_hca_transport *tp); void dapls_cm_acquire(dp_ib_cm_handle_t cm_ptr); void dapls_cm_release(dp_ib_cm_handle_t cm_ptr); diff --git a/dapl/openib_ucm/device.c b/dapl/openib_ucm/device.c index e21e55d..cdcf033 100644 --- a/dapl/openib_ucm/device.c +++ b/dapl/openib_ucm/device.c @@ -607,96 +607,3 @@ bail: ucm_service_destroy(hca); return -1; } - -void ucm_async_event(struct dapl_hca *hca) -{ - struct ibv_async_event event; - struct _ib_hca_transport *tp = &hca->ib_trans; - - if (!ibv_get_async_event(hca->ib_hca_handle, &event)) { - - switch (event.event_type) { - case IBV_EVENT_CQ_ERR: - { - struct dapl_ep *evd_ptr = - event.element.cq->cq_context; - - dapl_log(DAPL_DBG_TYPE_ERR, - "dapl async_event CQ (%p) ERR %d\n", - evd_ptr, event.event_type); - - /* report up if async callback still setup */ - if (tp->async_cq_error) - tp->async_cq_error(hca->ib_hca_handle, - event.element.cq, - &event, (void *)evd_ptr); - break; - } - case IBV_EVENT_COMM_EST: - { - /* Received msgs on connected QP before RTU */ - dapl_log(DAPL_DBG_TYPE_UTIL, - " async_event COMM_EST(%p) rdata beat RTU\n", - event.element.qp); - - break; - } - case IBV_EVENT_QP_FATAL: - case IBV_EVENT_QP_REQ_ERR: - case IBV_EVENT_QP_ACCESS_ERR: - case IBV_EVENT_QP_LAST_WQE_REACHED: - case IBV_EVENT_SRQ_ERR: - case IBV_EVENT_SRQ_LIMIT_REACHED: - case IBV_EVENT_SQ_DRAINED: - { - struct dapl_ep *ep_ptr = - event.element.qp->qp_context; - - dapl_log(DAPL_DBG_TYPE_ERR, - "dapl async_event QP (%p) ERR %d\n", - ep_ptr, event.event_type); - - /* report up if async callback still setup */ - if (tp->async_qp_error) - tp->async_qp_error(hca->ib_hca_handle, - ep_ptr->qp_handle, - &event, (void *)ep_ptr); - break; - } - case IBV_EVENT_PATH_MIG: - case IBV_EVENT_PATH_MIG_ERR: - case IBV_EVENT_DEVICE_FATAL: - case IBV_EVENT_PORT_ACTIVE: - case IBV_EVENT_PORT_ERR: - case IBV_EVENT_LID_CHANGE: - case IBV_EVENT_PKEY_CHANGE: - case IBV_EVENT_SM_CHANGE: - { - dapl_log(DAPL_DBG_TYPE_WARN, - "dapl async_event: DEV ERR %d\n", - event.event_type); - - /* report up if async callback still setup */ - if (tp->async_unafiliated) - tp->async_unafiliated(hca->ib_hca_handle, - &event, - tp->async_un_ctx); - break; - } - case IBV_EVENT_CLIENT_REREGISTER: - /* no need to report this event this time */ - dapl_log(DAPL_DBG_TYPE_UTIL, - " async_event: IBV_CLIENT_REREGISTER\n"); - break; - - default: - dapl_log(DAPL_DBG_TYPE_WARN, - "dapl async_event: %d UNKNOWN\n", - event.event_type); - break; - - } - ibv_ack_async_event(&event); - } -} - -- 2.41.0