The librdmacm will try to connect port 6125 if ibacm.port is
not found. The problem is that some other service or application
could be using that port and respond with garbage. Rather
than falling back to a hard coded port number, if ibacm.port
is not found, simply disable ACM support.
This has the effect of removing support for older versions
of ibacm, unless the port file is created manually.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
static pthread_mutex_t acm_lock = PTHREAD_MUTEX_INITIALIZER;
static int sock = -1;
-static short server_port = 6125;
+static short server_port;
struct ib_connect_hdr {
uint8_t cma_version;
#define cma_dst_ip6 dst_addr[0]
};
-static void ucma_set_server_port(void)
+static int ucma_set_server_port(void)
{
FILE *f;
fscanf(f, "%hu", (unsigned short *) &server_port);
fclose(f);
}
+ return server_port;
}
void ucma_ib_init(void)
return;
pthread_mutex_lock(&acm_lock);
- ucma_set_server_port();
+ if (!ucma_set_server_port())
+ goto out;
+
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0)
goto out;