[ofa-general] RE: OMPI over OFA udapl [PATCH]

Arlin Davis arlin.r.davis at intel.com
Tue May 8 16:44:56 PDT 2007



>-----Original Message-----
>From: Steve Wise [mailto:swise at opengridcomputing.com]
>
>Cool!  I'll test this over iWARP when you have something...


Steve,

Can you try this patch? I also included a change to dtest to query. Make sure you have the latest
librdmacm fixes. There was a late breaking fix that just went in that overwrote the port during the
rdma_bind_addr call.

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

diff --git a/dapl/openib_cma/dapl_ib_cm.c b/dapl/openib_cma/dapl_ib_cm.c
index 8bdd0eb..4639f87 100755
--- a/dapl/openib_cma/dapl_ib_cm.c
+++ b/dapl/openib_cma/dapl_ib_cm.c
@@ -891,6 +891,9 @@ dapls_ib_accept_connection(IN DAT_CR_HANDLE cr_handle,
 		goto bail;
 	}
 
+	/* save remote port for ep query */
+	ep_ptr->param.remote_port_qual = rdma_get_dst_port(cr_conn->cm_id);
+
 	return DAT_SUCCESS;
 bail:
 	rdma_reject(cr_conn->cm_id, NULL, 0);
diff --git a/dapl/openib_cma/dapl_ib_qp.c b/dapl/openib_cma/dapl_ib_qp.c
old mode 100644
new mode 100755
index f1e1671..69c49a9
--- a/dapl/openib_cma/dapl_ib_qp.c
+++ b/dapl/openib_cma/dapl_ib_qp.c
@@ -179,14 +179,19 @@ DAT_RETURN dapls_ib_qp_alloc(IN DAPL_IA *ia_ptr,
 	conn->route_retries = dapl_os_get_env_val("DAPL_CM_ROUTE_RETRY_COUNT", 
 						    IB_ROUTE_RETRY_COUNT);
 
+	/* setup up ep->param to reference the bound local address and port */
+	ep_ptr->param.local_ia_address_ptr = &cm_id->route.addr.src_addr;
+	ep_ptr->param.local_port_qual = rdma_get_src_port(cm_id);
+		
 	ep_ptr->qp_handle = conn;
 	ep_ptr->qp_state = IB_QP_STATE_INIT;
 	
 	dapl_dbg_log(DAPL_DBG_TYPE_EP,
-		     " qp_alloc: qpn %p sq %d,%d rq %d,%d\n", 
+		     " qp_alloc: qpn %p sq %d,%d rq %d,%d port=%d\n", 
 		     ep_ptr->qp_handle->cm_id->qp->qp_num,
 		     qp_create.cap.max_send_wr,qp_create.cap.max_send_sge,
-		     qp_create.cap.max_recv_wr,qp_create.cap.max_recv_sge);
+		     qp_create.cap.max_recv_wr,qp_create.cap.max_recv_sge,
+		     ep_ptr->param.local_port_qual);
 	
 	return DAT_SUCCESS;
 bail:
diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c
old mode 100644
new mode 100755
index ec8a82e..68a3cbe
--- a/test/dtest/dtest.c
+++ b/test/dtest/dtest.c
@@ -106,6 +106,7 @@ static DAT_RMR_CONTEXT    rmr_context_send_msg;
 static DAT_VLEN           registered_size_send_msg;
 static DAT_VADDR          registered_addr_send_msg;
 static DAT_EP_ATTR        ep_attr;
+static DAT_EP_PARAM       ep_param;
 char                      hostname[256] = {0};
 char                      provider[256] = DAPL_PROVIDER;
 
@@ -329,6 +330,25 @@ main(int argc, char **argv)
        } else
                LOGPRINTF("%d EP created %p \n", getpid(), h_ep);
 
+       /* query EP for local address information */
+	ret = dat_ep_query( h_ep, DAT_EP_FIELD_ALL, &ep_param );
+	if(ret != DAT_SUCCESS) {
+               fprintf(stderr, "%d Error dat_ep_query: %s\n",
+                       getpid(),DT_RetToString(ret));
+               goto cleanup;
+       } else
+               LOGPRINTF("%d EP queried %p \n", getpid(), h_ep);
+
+       printf("%d Query EP: family %d port %d addr %d.%d.%d.%d (%d)\n", getpid(),
+		((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_family,
+		((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_port,
+		((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_addr.s_addr >> 0 & 0xff,
+		((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_addr.s_addr >> 8 & 0xff,
+		((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_addr.s_addr >> 16 & 0xff,
+		((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_addr.s_addr >> 24 & 0xff,
+		ep_param.local_port_qual); 
+       fflush(stdout);
+            
        /*
         * register message buffers, establish connection, and
         * exchange DMA RMR information info via messages







More information about the general mailing list