ucma_set_ib_route will call rdma_getaddrinfo to obtain IB path
information. However, rdma_getaddrinfo will return success,
but not provide routing data if no route can be found (the IB
ACM service is not running). In this case, we can call
rdma_set_option without a valid route. Although the kernel
will trap this and fail, we can detect the error in the library.
This will speed up the connection rate if IB ACM is not in use.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
if (ret)
return ret;
- ret = rdma_set_option(id, RDMA_OPTION_IB, RDMA_OPTION_IB_PATH,
- rai->ai_route, rai->ai_route_len);
+ if (rai->ai_route_len)
+ ret = rdma_set_option(id, RDMA_OPTION_IB, RDMA_OPTION_IB_PATH,
+ rai->ai_route, rai->ai_route_len);
+ else
+ ret = -1;
+
rdma_freeaddrinfo(rai);
return ret;
}