From: Sean Hefty Date: Mon, 28 May 2012 08:12:08 +0000 (-0700) Subject: rename X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=606d91e2fa101943c3c7878ed4bdb9792a99c8dd;p=~shefty%2Flibrdmacm.git rename --- diff --git a/meta b/meta index daa6fdc4..d4184830 100644 --- a/meta +++ b/meta @@ -1,5 +1,5 @@ Version: 1 -Previous: b0a91d937d95855fcfe9c0be758e9ec0977ffd18 +Previous: cf24202b0d4d097c71bf258045f16c8af9912671 Head: 666fa02d8f18ac2e98008cd3d57a90a864203548 Applied: destroy_cqs: 66410c265b2661e16b7f6126bcc4ea5c7e1af1bd @@ -12,7 +12,7 @@ Applied: rstream-bufsize: 76a7691690cd14c123b4a3125598134edd567e1f rs-def-qpsize: 6895cd6a4d77d7f0c212af73ff4741c5c251b9e6 acm-sock: dbc1a8fd27cad76749a228f01b8bf708832cdae0 - rs-with-acm: 666fa02d8f18ac2e98008cd3d57a90a864203548 + acm-init: 666fa02d8f18ac2e98008cd3d57a90a864203548 Unapplied: rs-1sge: 85e4c4a0da0b501b60a1035d7a003ee20a749511 rs-def-inline: 6ad70d3b80178e40fea97f662a6b31e51cddc0af diff --git a/patches/acm-init b/patches/acm-init new file mode 100644 index 00000000..f5cd118f --- /dev/null +++ b/patches/acm-init @@ -0,0 +1,89 @@ +Bottom: f9da4f0a214d84797e29c62aa0628a78b3d890bd +Top: ed5b3cf23ac01acbc57d249c7083577a19d344ce +Author: Sean Hefty +Date: 2012-05-25 10:48:47 -0700 + +librdmacm: Delay ACM connection until resolving an address + +Avoid creating a connection to the ACM service when +it's not needed. For example, if the user of the librdmacm +is a server application, it will not use ACM services. + +Signed-off-by: Sean Hefty + + +--- + +diff --git a/src/acm.c b/src/acm.c +index 9c65919..5bdeb88 100755 +--- a/src/acm.c ++++ b/src/acm.c +@@ -89,26 +89,30 @@ static void ucma_set_server_port(void) + void ucma_ib_init(void) + { + struct sockaddr_in addr; ++ static int init; + int ret; + ++ if (init) ++ return; ++ ++ pthread_mutex_lock(&acm_lock); + ucma_set_server_port(); + sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (sock < 0) +- return; ++ goto out; + + memset(&addr, 0, sizeof addr); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + addr.sin_port = htons(server_port); + ret = connect(sock, (struct sockaddr *) &addr, sizeof(addr)); +- if (ret) +- goto err; +- +- return; +- +-err: +- close(sock); +- sock = -1; ++ if (ret) { ++ close(sock); ++ sock = -1; ++ } ++out: ++ init = 1; ++ pthread_mutex_unlock(&acm_lock); + } + + void ucma_ib_cleanup(void) +diff --git a/src/cma.c b/src/cma.c +index 753612c..f688c4c 100755 +--- a/src/cma.c ++++ b/src/cma.c +@@ -274,8 +274,6 @@ int ucma_init(void) + ib += (cma_dev->verbs->device->transport_type == IBV_TRANSPORT_IB); + } + +- if (ib) +- ucma_ib_init(); + cma_dev_cnt = dev_cnt; + ucma_set_af_ib_support(); + pthread_mutex_unlock(&mut); +diff --git a/src/cma.h b/src/cma.h +index 2f5215c..2ee4767 100644 +--- a/src/cma.h ++++ b/src/cma.h +@@ -119,11 +119,9 @@ extern int af_ib_support; + #define RAI_ROUTEONLY 0x01000000 + + #ifdef USE_IB_ACM +-void ucma_ib_init(); + void ucma_ib_cleanup(); + void ucma_ib_resolve(struct rdma_addrinfo **rai, struct rdma_addrinfo *hints); + #else +-#define ucma_ib_init() + #define ucma_ib_cleanup() + #define ucma_ib_resolve(x, y) + #endif diff --git a/patches/rs-with-acm b/patches/rs-with-acm deleted file mode 100644 index f5cd118f..00000000 --- a/patches/rs-with-acm +++ /dev/null @@ -1,89 +0,0 @@ -Bottom: f9da4f0a214d84797e29c62aa0628a78b3d890bd -Top: ed5b3cf23ac01acbc57d249c7083577a19d344ce -Author: Sean Hefty -Date: 2012-05-25 10:48:47 -0700 - -librdmacm: Delay ACM connection until resolving an address - -Avoid creating a connection to the ACM service when -it's not needed. For example, if the user of the librdmacm -is a server application, it will not use ACM services. - -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index 9c65919..5bdeb88 100755 ---- a/src/acm.c -+++ b/src/acm.c -@@ -89,26 +89,30 @@ static void ucma_set_server_port(void) - void ucma_ib_init(void) - { - struct sockaddr_in addr; -+ static int init; - int ret; - -+ if (init) -+ return; -+ -+ pthread_mutex_lock(&acm_lock); - ucma_set_server_port(); - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (sock < 0) -- return; -+ goto out; - - memset(&addr, 0, sizeof addr); - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - addr.sin_port = htons(server_port); - ret = connect(sock, (struct sockaddr *) &addr, sizeof(addr)); -- if (ret) -- goto err; -- -- return; -- --err: -- close(sock); -- sock = -1; -+ if (ret) { -+ close(sock); -+ sock = -1; -+ } -+out: -+ init = 1; -+ pthread_mutex_unlock(&acm_lock); - } - - void ucma_ib_cleanup(void) -diff --git a/src/cma.c b/src/cma.c -index 753612c..f688c4c 100755 ---- a/src/cma.c -+++ b/src/cma.c -@@ -274,8 +274,6 @@ int ucma_init(void) - ib += (cma_dev->verbs->device->transport_type == IBV_TRANSPORT_IB); - } - -- if (ib) -- ucma_ib_init(); - cma_dev_cnt = dev_cnt; - ucma_set_af_ib_support(); - pthread_mutex_unlock(&mut); -diff --git a/src/cma.h b/src/cma.h -index 2f5215c..2ee4767 100644 ---- a/src/cma.h -+++ b/src/cma.h -@@ -119,11 +119,9 @@ extern int af_ib_support; - #define RAI_ROUTEONLY 0x01000000 - - #ifdef USE_IB_ACM --void ucma_ib_init(); - void ucma_ib_cleanup(); - void ucma_ib_resolve(struct rdma_addrinfo **rai, struct rdma_addrinfo *hints); - #else --#define ucma_ib_init() - #define ucma_ib_cleanup() - #define ucma_ib_resolve(x, y) - #endif