[openib-general] [PATCH] uDAPL: fix uCMA provider event types and dapl_ep_create segv bug
Arlin Davis
arlin.r.davis at intel.com
Wed May 17 12:17:03 PDT 2006
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>
Index: dapl/common/dapl_ep_create.c
===================================================================
--- dapl/common/dapl_ep_create.c (revision 7140)
+++ 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 7140)
+++ dapl/openib_cma/dapl_ib_cm.c (working copy)
@@ -285,14 +285,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,
@@ -381,6 +391,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,
@@ -395,10 +413,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);
+
+ dapl_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