[openib-general] RE: [PATCH2] uDAPL: fix uCMA provider event types and dapl_ep_create segv bug

Arlin Davis arlin.r.davis at intel.com
Wed May 17 14:16:02 PDT 2006


>-----Original Message-----
>From: Arlin Davis [mailto:arlin.r.davis at intel.com]
>Sent: Wednesday, May 17, 2006 12:17 PM
>To: 'James Lentini'
>Cc: openib-general
>Subject: [PATCH] uDAPL: fix uCMA provider event types and dapl_ep_create segv bug
>
>James,
>
>Fix for uCMA provider to return the correct event as a result of rejects. Also, ran into a segv bug
>with dapl_ep_create when creating without a conn_evd.
>
>Thanks,
>
>-arlin
>
> Signed-off by: Arlin Davis <ardavis at ichips.intel.com>


Sorry, the last patch was wrong. Try again...

-arlin


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


Index: dapl/common/dapl_ep_create.c
===================================================================
--- dapl/common/dapl_ep_create.c	(revision 7299)
+++ dapl/common/dapl_ep_create.c	(working copy)
@@ -310,7 +310,10 @@ dapl_ep_create (
      *
      * N.B. This should really be done by a util routine.
      */
-    dapl_os_atomic_inc (& ((DAPL_EVD *)connect_evd_handle)->evd_ref_count);
+    if (connect_evd_handle != DAT_HANDLE_NULL)
+    {
+	dapl_os_atomic_inc (& ((DAPL_EVD *)connect_evd_handle)->evd_ref_count);
+    }
     /* Optional handles */
     if (recv_evd_handle != DAT_HANDLE_NULL)
     {
Index: dapl/openib_cma/dapl_ib_cm.c
===================================================================
--- dapl/openib_cma/dapl_ib_cm.c	(revision 7299)
+++ dapl/openib_cma/dapl_ib_cm.c	(working copy)
@@ -287,14 +287,24 @@ static void dapli_cm_active_cb(struct da
 					     NULL, conn->ep);
 		break;
 	case RDMA_CM_EVENT_REJECTED:
+	{
+		ib_cm_events_t cm_event;
+
+		/* no device type specified so assume IB for now */
+		if (event->status == 28) /* IB_CM_REJ_CONSUMER_DEFINED */
+			cm_event = IB_CME_DESTINATION_REJECT_PRIVATE_DATA;
+		else 
+			cm_event = IB_CME_DESTINATION_REJECT;
+
 		dapl_dbg_log(
 			DAPL_DBG_TYPE_WARN,
 			" dapli_cm_active_handler: REJECTED reason=%d\n",	
 			event->status);
-		dapl_evd_connection_callback(conn, IB_CME_DESTINATION_REJECT,
-					     NULL, conn->ep);
+		
+		dapl_evd_connection_callback(conn, cm_event, NULL, conn->ep);
+		
 		break;
-
+	}
 	case RDMA_CM_EVENT_ESTABLISHED:
 			
 		dapl_dbg_log(DAPL_DBG_TYPE_CM, 
@@ -383,6 +393,14 @@ static void dapli_cm_passive_cb(struct d
 		break;
 
 	case RDMA_CM_EVENT_REJECTED:
+	{
+		ib_cm_events_t cm_event;
+
+		/* no device type specified so assume IB for now */
+		if (event->status == 28) /* IB_CM_REJ_CONSUMER_DEFINED */
+			cm_event = IB_CME_DESTINATION_REJECT_PRIVATE_DATA;
+		else 
+			cm_event = IB_CME_DESTINATION_REJECT;
 
 		dapl_dbg_log(
 			DAPL_DBG_TYPE_WARN, 
@@ -397,10 +415,11 @@ static void dapli_cm_passive_cb(struct d
 				&ipaddr->dst_addr)->sin_addr.s_addr),
 			ntohs(((struct sockaddr_in *)
 				&ipaddr->dst_addr)->sin_port));
-
-		dapls_cr_callback(conn, IB_CME_DESTINATION_REJECT, 
-				  NULL, conn->sp);
+		
+		dapls_cr_callback(conn, cm_event, NULL, conn->sp);
+		
 		break;
+	}
 	case RDMA_CM_EVENT_ESTABLISHED:
 		
 		dapl_dbg_log(DAPL_DBG_TYPE_CM, 




More information about the general mailing list