diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2014-10-30 11:46:56 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2014-11-13 21:57:41 -0800 |
commit | f6b9f295043d6a7f69e39fde0979b786471e6f92 (patch) | |
tree | 372be60a2c49a5115a943d872ac3457da37def37 /rpc | |
parent | f3f7f2a2048359db67875a54a96dbf5a46f7bff3 (diff) |
rdma:setting rdma REUSEADDR flag to rdma id.
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: Ic7deb0d7442c29494fe088598ffe9c87977c04ff
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>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-transport/rdma/src/rdma.c | 10 |
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 4837a17532e..4c01c14a927 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -4389,6 +4389,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; @@ -4430,6 +4431,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, |