[ofw] [PATCH] dapl 2.0: scm, ucm: set RAI_NOROUTE flag with rdma_getaddrinfo() call to avoid blocking.

Davis, Arlin R arlin.r.davis at intel.com
Fri Dec 10 13:58:46 PST 2010


if path is not returned, print warning message and use default SL.

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/openib_common/qp.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/dapl/openib_common/qp.c b/dapl/openib_common/qp.c
index 8db6f8e..1e5b6d4 100644
--- a/dapl/openib_common/qp.c
+++ b/dapl/openib_common/qp.c
@@ -374,6 +374,9 @@ void dapls_ib_reinit_ep(IN DAPL_EP * ep_ptr)
 #endif				// _WIN32 || _WIN64
 
 #if DAPL_USE_IBACM
+#ifndef RAI_NOROUTE 
+#define RAI_NOROUTE 0
+#endif
 uint8_t dapls_get_sl(DAPL_HCA *hca_ptr, uint16_t dlid)
 {
 	struct rdma_addrinfo hint, *res;
@@ -387,6 +390,7 @@ uint8_t dapls_get_sl(DAPL_HCA *hca_ptr, uint16_t dlid)
 	path.dlid = dlid;
 
 	memset(&hint, 0, sizeof hint);
+	hint.ai_flags = RAI_NOROUTE;
 	hint.ai_route = &path;
 	hint.ai_route_len = sizeof(path);
 
@@ -397,6 +401,10 @@ uint8_t dapls_get_sl(DAPL_HCA *hca_ptr, uint16_t dlid)
 	if (res->ai_route_len)
 		sl = ntohs(((struct ibv_path_record *) res->ai_route)->
 			   qosclass_sl) & 0xF;
+	else 
+		dapl_log(DAPL_DBG_TYPE_CM_WARNING,
+			" dapls_get_sl: Warning, route miss 0x%x -> 0x%x\n",
+			slid, dlid);
 
 	rdma_freeaddrinfo(res);
 out:	
-- 
1.7.3






More information about the ofw mailing list