summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/rdma/src/rdma.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2017-05-29 16:00:24 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-06-08 15:32:30 +0000
commit0a20e56d07de3e467e09da885a6b71cdc165de17 (patch)
tree189ba4075562036bcb0824f247230c5e7e439ecf /rpc/rpc-transport/rdma/src/rdma.c
parent513984ad90531c53fcb7d6f0d581f198a6afcf93 (diff)
protocol/server: make listen backlog value as configurable
problem: When we call listen from protocol/server, we are giving a hard coded valie of 10 if it is not manually given. With multiplexing, especially when glusterd restarts all clients may try to connect to the server at a time. Which will result in overflowing the queue, and kernel will complain about the errors. Solution: This patch will introduce a volume set command to make backlog value as a configurable. This patch also changes the default values for backlog from 10 to 128. This changes is only applicable for sockets listening from protocol. Example: gluster volume set <volname> transport.listen-backlog 1024 Note: 1 Brick has to be restarted to get this value in effect 2 This changes won't be reflected in glusterd, or other xlators which calls listen. If you need, you have to add this option to the volfile. Change-Id: I0c5a2bbf28b5db612f9979e7560e05dd82b41477 BUG: 1456405 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: https://review.gluster.org/17411 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'rpc/rpc-transport/rdma/src/rdma.c')
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index 8d9e6474f3c..01f96c21b5c 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -4499,6 +4499,12 @@ gf_rdma_options_init (rpc_transport_t *this)
options->attr_retry_cnt = GF_RDMA_RETRY_CNT;
options->attr_rnr_retry = GF_RDMA_RNR_RETRY;
+ temp = dict_get (this->options, "transport.listen-backlog");
+ if (temp)
+ options->backlog = data_to_uint32 (temp);
+ else
+ options->backlog = GLUSTERFS_SOCKET_LISTEN_BACKLOG;
+
temp = dict_get (this->options,
"transport.rdma.work-request-send-count");
if (temp)
@@ -4635,6 +4641,7 @@ gf_rdma_init (rpc_transport_t *this)
priv->peer.recv_count = options->recv_count;
priv->peer.send_size = options->send_size;
priv->peer.recv_size = options->recv_size;
+ priv->backlog = options->backlog;
priv->peer.trans = this;
INIT_LIST_HEAD (&priv->peer.ioq);
@@ -4848,7 +4855,8 @@ gf_rdma_listen (rpc_transport_t *this)
goto err;
}
- ret = rdma_listen (peer->cm_id, 10);
+ ret = rdma_listen (peer->cm_id, priv->backlog);
+
if (ret != 0) {
gf_msg (this->name, GF_LOG_WARNING, errno,
RDMA_MSG_LISTEN_FAILED,
@@ -4919,6 +4927,28 @@ init (rpc_transport_t *this)
return 0;
}
+int
+reconfigure (rpc_transport_t *this, dict_t *options)
+{
+ gf_rdma_private_t *priv = NULL;
+ uint32_t backlog = 0;
+ int ret = -1;
+
+ GF_VALIDATE_OR_GOTO ("rdma", this, out);
+ GF_VALIDATE_OR_GOTO ("rdma", this->private, out);
+
+ priv = this->private;
+
+ if (dict_get_uint32 (options, "transport.listen-backlog",
+ &backlog) == 0) {
+ priv->backlog = backlog;
+ gf_log (this->name, GF_LOG_DEBUG, "Reconfigued "
+ "transport.listen-backlog=%d", priv->backlog);
+ }
+ ret = 0;
+out:
+ return ret;
+}
void
fini (struct rpc_transport *this)
{