summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2014-10-30 11:46:56 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-01-06 01:36:23 -0800
commit707ef16edcf4b14f46bb515b3464fa4368ce9b7c (patch)
tree4f546a6c9179e6ca348aaf4810745cc05036e5cc
parentfa7a3e0b39692b392d325d009386d4d2ad0306f5 (diff)
rdma:setting rdma REUSEADDR flag to rdma id.
Backport of http://review.gluster.org/9005 When we restart the process, it will go TIME_WAIT state to make sure that all the data in the transport is successfully delivered. REUSEADDR allows server to bind to an address which is in TIME_WAIT state. Change-Id: Ifb191967930d23bac31ceef1b1745d6b9fb0007b BUG: 1166515 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9005 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/9175 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index e65713a4893..3ceb197f2a3 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -4397,6 +4397,7 @@ gf_rdma_listen (rpc_transport_t *this)
int ret = 0;
gf_rdma_ctx_t *rdma_ctx = NULL;
char service[NI_MAXSERV], host[NI_MAXHOST];
+ int optval = 2;
priv = this->private;
peer = &priv->peer;
@@ -4438,6 +4439,15 @@ gf_rdma_listen (rpc_transport_t *this)
sprintf (this->myinfo.identifier, "%s:%s", host, service);
+ ret = rdma_set_option(peer->cm_id, RDMA_OPTION_ID,
+ RDMA_OPTION_ID_REUSEADDR,
+ (void *)&optval, sizeof(optval));
+ if (ret != 0) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "rdma option set failed (%s)", strerror (errno));
+ goto err;
+ }
+
ret = rdma_bind_addr (peer->cm_id, &sock_union.sa);
if (ret != 0) {
gf_log (this->name, GF_LOG_WARNING,