From f6b9f295043d6a7f69e39fde0979b786471e6f92 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Thu, 30 Oct 2014 11:46:56 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9005 Tested-by: Gluster Build System Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- rpc/rpc-transport/rdma/src/rdma.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'rpc/rpc-transport/rdma/src/rdma.c') 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, -- cgit