[openib-general] [PATCH] uDAPL openib_cma, cleanup reported CM error events, add TIMEOUT

Arlin Davis arlin.r.davis at intel.com
Fri Jun 9 15:37:34 PDT 2006


James,

I cleaned up the connection error events to report the proper events during address resolution
errors and timeouts. It was returning incorrect DAT event codes.

-arlin


Signed-off by: Arlin Davis <ardavis at ichips.intel.com>


Index: dapl_ib_cm.c
===================================================================
--- dapl_ib_cm.c	(revision 7839)
+++ dapl_ib_cm.c	(working copy)
@@ -330,6 +330,8 @@ static void dapli_cm_active_cb(struct da
 	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 "
@@ -337,10 +339,15 @@ static void dapli_cm_active_cb(struct da
                         event->event, event->status,
                         (event->status == -110)?"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 == -110) /* 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 da
 			event->status);
 		
 		dapl_evd_connection_callback(conn, cm_event, NULL, conn->ep);
-		
 		break;
 	}
 	case RDMA_CM_EVENT_ESTABLISHED:
@@ -1028,7 +1034,7 @@ int dapls_ib_private_data_size(IN DAPL_P
 /*
  * Map all socket CM 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:
Index: dapl_ib_util.h
===================================================================
--- dapl_ib_util.h	(revision 7839)
+++ dapl_ib_util.h	(working copy)
@@ -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 */





More information about the general mailing list