From: Arlin Davis Date: Mon, 12 Jun 2006 15:42:50 +0000 (+0000) Subject: r7931: Report the proper error and timeout events. X-Git-Tag: libdapl-1.2.1~34 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=6cb854cd72d9492ddc1c5da01dbfb24b3f30af83;p=~ardavis%2Fdapl.git r7931: Report the proper error and timeout events. Signed-off-by: Arlin Davis Signed-off-by: James Lentini --- diff --git a/dapl/openib_cma/dapl_ib_cm.c b/dapl/openib_cma/dapl_ib_cm.c index 3a4bc23..4b73d55 100644 --- a/dapl/openib_cma/dapl_ib_cm.c +++ b/dapl/openib_cma/dapl_ib_cm.c @@ -330,17 +330,24 @@ static void dapli_cm_active_cb(struct dapl_cm_id *conn, switch (event->event) { case RDMA_CM_EVENT_UNREACHABLE: case RDMA_CM_EVENT_CONNECT_ERROR: + { + ib_cm_events_t cm_event; dapl_dbg_log( DAPL_DBG_TYPE_WARN, " dapli_cm_active_handler: CONN_ERR " " event=0x%x status=%d %s\n", event->event, event->status, - (event->status == -110)?"TIMEOUT":"" ); + (event->status == -ETIMEDOUT)?"TIMEOUT":"" ); - dapl_evd_connection_callback(conn, - IB_CME_DESTINATION_UNREACHABLE, - NULL, conn->ep); + /* no device type specified so assume IB for now */ + if (event->status == -ETIMEDOUT) /* IB timeout */ + cm_event = IB_CME_TIMEOUT; + else + cm_event = IB_CME_DESTINATION_UNREACHABLE; + + dapl_evd_connection_callback(conn, cm_event, NULL, conn->ep); break; + } case RDMA_CM_EVENT_REJECTED: { ib_cm_events_t cm_event; @@ -357,7 +364,6 @@ static void dapli_cm_active_cb(struct dapl_cm_id *conn, event->status); dapl_evd_connection_callback(conn, cm_event, NULL, conn->ep); - break; } case RDMA_CM_EVENT_ESTABLISHED: @@ -1026,9 +1032,9 @@ int dapls_ib_private_data_size(IN DAPL_PRIVATE *prd_ptr, } /* - * Map all socket CM event codes to the DAT equivelent. + * Map all CMA event codes to the DAT equivelent. */ -#define DAPL_IB_EVENT_CNT 12 +#define DAPL_IB_EVENT_CNT 13 static struct ib_cm_event_map { @@ -1058,7 +1064,9 @@ static struct ib_cm_event_map /* 10 */ { IB_CME_LOCAL_FAILURE, DAT_CONNECTION_EVENT_BROKEN}, /* 11 */ { IB_CME_BROKEN, - DAT_CONNECTION_EVENT_BROKEN} + DAT_CONNECTION_EVENT_BROKEN}, + /* 12 */ { IB_CME_TIMEOUT, + DAT_CONNECTION_EVENT_TIMED_OUT}, }; /* @@ -1164,7 +1172,7 @@ void dapli_cma_event_cb(void) case RDMA_CM_EVENT_ADDR_ERROR: case RDMA_CM_EVENT_ROUTE_ERROR: dapl_evd_connection_callback(conn, - IB_CME_LOCAL_FAILURE, + IB_CME_DESTINATION_UNREACHABLE, NULL, conn->ep); break; case RDMA_CM_EVENT_DEVICE_REMOVAL: diff --git a/dapl/openib_cma/dapl_ib_util.h b/dapl/openib_cma/dapl_ib_util.h index 5686ddf..3e1f411 100644 --- a/dapl/openib_cma/dapl_ib_util.h +++ b/dapl/openib_cma/dapl_ib_util.h @@ -86,7 +86,8 @@ typedef enum { IB_CME_DESTINATION_UNREACHABLE, IB_CME_TOO_MANY_CONNECTION_REQUESTS, IB_CME_LOCAL_FAILURE, - IB_CME_BROKEN + IB_CME_BROKEN, + IB_CME_TIMEOUT } ib_cm_events_t; /* CQ notifications */