summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/rpc-transport/socket/src/socket.c106
-rw-r--r--rpc/rpc-transport/socket/src/socket.h12
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c31
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c70
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c6
-rw-r--r--xlators/protocol/client/src/client.c5
-rw-r--r--xlators/protocol/client/src/client.h2
-rw-r--r--xlators/protocol/server/src/server.c5
-rw-r--r--xlators/protocol/server/src/server.h2
9 files changed, 133 insertions, 106 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 120e193dd..615f69f1b 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -2048,30 +2048,24 @@ socket_connect (rpc_transport_t *this, int port)
/* Cant help if setting socket options fails. We can continue
* working nonetheless.
*/
- if (setsockopt (priv->sock, SOL_SOCKET, SO_RCVBUF,
- &priv->windowsize,
- sizeof (priv->windowsize)) < 0) {
- gf_log (this->name, GF_LOG_ERROR,
- "setting receive window size failed: %d: %d: "
- "%s", priv->sock, priv->windowsize,
- strerror (errno));
- }
-
- if (setsockopt (priv->sock, SOL_SOCKET, SO_SNDBUF,
- &priv->windowsize,
- sizeof (priv->windowsize)) < 0) {
- gf_log (this->name, GF_LOG_ERROR,
- "setting send window size failed: %d: %d: "
- "%s", priv->sock, priv->windowsize,
- strerror (errno));
- }
-
+ if (priv->windowsize != 0) {
+ if (setsockopt (priv->sock, SOL_SOCKET, SO_RCVBUF,
+ &priv->windowsize,
+ sizeof (priv->windowsize)) < 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting receive window "
+ "size failed: %d: %d: %s",
+ priv->sock, priv->windowsize,
+ strerror (errno));
+ }
- if (priv->nodelay) {
- ret = __socket_nodelay (priv->sock);
- if (ret == -1) {
+ if (setsockopt (priv->sock, SOL_SOCKET, SO_SNDBUF,
+ &priv->windowsize,
+ sizeof (priv->windowsize)) < 0) {
gf_log (this->name, GF_LOG_ERROR,
- "setsockopt() failed for NODELAY (%s)",
+ "setting send window size "
+ "failed: %d: %d: %s",
+ priv->sock, priv->windowsize,
strerror (errno));
}
}
@@ -2204,22 +2198,26 @@ socket_listen (rpc_transport_t *this)
/* Cant help if setting socket options fails. We can continue
* working nonetheless.
*/
- if (setsockopt (priv->sock, SOL_SOCKET, SO_RCVBUF,
- &priv->windowsize,
- sizeof (priv->windowsize)) < 0) {
- gf_log (this->name, GF_LOG_ERROR,
- "setting receive window size failed: %d: %d: "
- "%s", priv->sock, priv->windowsize,
- strerror (errno));
- }
+ if (priv->windowsize != 0) {
+ if (setsockopt (priv->sock, SOL_SOCKET, SO_RCVBUF,
+ &priv->windowsize,
+ sizeof (priv->windowsize)) < 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting receive window size "
+ "failed: %d: %d: %s", priv->sock,
+ priv->windowsize,
+ strerror (errno));
+ }
- if (setsockopt (priv->sock, SOL_SOCKET, SO_SNDBUF,
- &priv->windowsize,
- sizeof (priv->windowsize)) < 0) {
- gf_log (this->name, GF_LOG_ERROR,
- "setting send window size failed: %d: %d: "
- "%s", priv->sock, priv->windowsize,
- strerror (errno));
+ if (setsockopt (priv->sock, SOL_SOCKET, SO_SNDBUF,
+ &priv->windowsize,
+ sizeof (priv->windowsize)) < 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting send window size failed:"
+ " %d: %d: %s", priv->sock,
+ priv->windowsize,
+ strerror (errno));
+ }
}
if (priv->nodelay) {
@@ -2510,10 +2508,11 @@ struct rpc_transport_ops tops = {
int
reconfigure (rpc_transport_t *this, dict_t *options)
{
- socket_private_t *priv = NULL;
- gf_boolean_t tmp_bool = _gf_false;
- char *optstr = NULL;
- int ret = 0;
+ socket_private_t *priv = NULL;
+ gf_boolean_t tmp_bool = _gf_false;
+ char *optstr = NULL;
+ int ret = 0;
+ uint64_t windowsize = 0;
GF_VALIDATE_OR_GOTO ("socket", this, out);
GF_VALIDATE_OR_GOTO ("socket", this->private, out);
@@ -2541,6 +2540,19 @@ reconfigure (rpc_transport_t *this, dict_t *options)
}
else
priv->keepalive = 1;
+
+ optstr = NULL;
+ if (dict_get_str (this->options, "tcp-window-size",
+ &optstr) == 0) {
+ if (gf_string2bytesize (optstr, &windowsize) != 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "invalid number format: %s", optstr);
+ goto out;
+ }
+ }
+
+ priv->windowsize = (int)windowsize;
+
ret = 0;
out:
return ret;
@@ -2620,9 +2632,8 @@ socket_init (rpc_transport_t *this)
}
}
-
optstr = NULL;
- if (dict_get_str (this->options, "transport.window-size",
+ if (dict_get_str (this->options, "tcp-window-size",
&optstr) == 0) {
if (gf_string2bytesize (optstr, &windowsize) != 0) {
gf_log (this->name, GF_LOG_ERROR,
@@ -2631,8 +2642,9 @@ socket_init (rpc_transport_t *this)
}
}
- optstr = NULL;
+ priv->windowsize = (int)windowsize;
+ optstr = NULL;
/* Enable Keep-alive by default. */
priv->keepalive = 1;
priv->keepaliveintvl = 2;
@@ -2684,7 +2696,7 @@ socket_init (rpc_transport_t *this)
}
}
- priv->windowsize = (int)windowsize;
+ optstr = NULL;
out:
this->private = priv;
@@ -2766,10 +2778,10 @@ struct volume_options options[] = {
{ .key = {"non-blocking-io"},
.type = GF_OPTION_TYPE_BOOL
},
- { .key = {"transport.window-size"},
+ { .key = {"tcp-window-size"},
.type = GF_OPTION_TYPE_SIZET,
.min = GF_MIN_SOCKET_WINDOW_SIZE,
- .max = GF_MAX_SOCKET_WINDOW_SIZE,
+ .max = GF_MAX_SOCKET_WINDOW_SIZE
},
{ .key = {"transport.socket.nodelay"},
.type = GF_OPTION_TYPE_BOOL
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
index 7f0fb6bc3..082977a2a 100644
--- a/rpc/rpc-transport/socket/src/socket.h
+++ b/rpc/rpc-transport/socket/src/socket.h
@@ -41,19 +41,17 @@
#define RPC_MAX_FRAGMENT_SIZE 0x7fffffff
-/* This is the size set through setsockopt for
- * both the TCP receive window size and the
- * send buffer size.
- * Till the time iobuf size becomes configurable, this size is set to include
- * two iobufs + the GlusterFS protocol headers.
+/* The default window size will be 0, indicating not to set
+ * it to any size. Default size of Linux is found to be
+ * performance friendly.
* Linux allows us to over-ride the max values for the system.
* Should we over-ride them? Because if we set a value larger than the default
* setsockopt will fail. Having larger values might be beneficial for
* IB links.
*/
-#define GF_DEFAULT_SOCKET_WINDOW_SIZE (512 * GF_UNIT_KB)
+#define GF_DEFAULT_SOCKET_WINDOW_SIZE (0)
#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
-#define GF_MIN_SOCKET_WINDOW_SIZE (128 * GF_UNIT_KB)
+#define GF_MIN_SOCKET_WINDOW_SIZE (0)
#define GF_USE_DEFAULT_KEEPALIVE (-1)
typedef enum {
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index da1299de0..3c1baa7e6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -252,7 +252,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
int ret = 0;
char *volname = NULL;
int exists = 0;
- char *key = NULL;
+ char *key = NULL;
char *key_fixed = NULL;
char *value = NULL;
char str[100] = {0, };
@@ -279,7 +279,8 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
ret = dict_get_int32 (dict, "count", &dict_count);
if (ret) {
- gf_log ("", GF_LOG_ERROR, "Count(dict),not set in Volume-Set");
+ gf_log (this->name, GF_LOG_ERROR,
+ "Count(dict),not set in Volume-Set");
goto out;
}
@@ -297,14 +298,14 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
goto out;
#else
ret = -1;
- gf_log ("", GF_LOG_ERROR, "libxml not present in the"
- "system");
+ gf_log (this->name, GF_LOG_ERROR,
+ "libxml not present in the system");
*op_errstr = gf_strdup ("Error: xml libraries not "
"present to produce xml-output");
goto out;
#endif
}
- gf_log ("", GF_LOG_ERROR, "No options received ");
+ gf_log (this->name, GF_LOG_ERROR, "No options received ");
*op_errstr = gf_strdup ("Options not specified");
ret = -1;
goto out;
@@ -312,7 +313,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
ret = dict_get_str (dict, "volname", &volname);
if (ret) {
- gf_log ("", GF_LOG_ERROR, "Unable to get volume name");
+ gf_log (this->name, GF_LOG_ERROR, "Unable to get volume name");
goto out;
}
@@ -320,7 +321,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
if (!exists) {
snprintf (errstr, sizeof (errstr), "Volume %s does not exist",
volname);
- gf_log ("", GF_LOG_ERROR, "%s", errstr);
+ gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
*op_errstr = gf_strdup (errstr);
ret = -1;
goto out;
@@ -328,7 +329,8 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
ret = glusterd_volinfo_find (volname, &volinfo);
if (ret) {
- gf_log ("", GF_LOG_ERROR, "Unable to allocate memory");
+ gf_log (this->name, GF_LOG_ERROR,
+ "Unable to allocate memory");
goto out;
}
@@ -347,7 +349,8 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
goto out;
}
if (!exists) {
- gf_log ("", GF_LOG_ERROR, "Option with name: %s "
+ gf_log (this->name, GF_LOG_ERROR,
+ "Option with name: %s "
"does not exist", key);
ret = snprintf (errstr, 2048,
"option : %s does not exist",
@@ -364,7 +367,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
ret = dict_get_str (dict, str, &value);
if (ret) {
- gf_log ("", GF_LOG_ERROR,
+ gf_log (this->name, GF_LOG_ERROR,
"invalid key,value pair in 'volume set'");
ret = -1;
goto out;
@@ -380,7 +383,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
ret = dict_set_str (val_dict, key, value);
if (ret) {
- gf_log ("", GF_LOG_ERROR,
+ gf_log (this->name, GF_LOG_ERROR,
"Unable to set the options in 'volume set'");
ret = -1;
goto out;
@@ -399,7 +402,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
}
if (ret) {
- gf_log ("glusterd", GF_LOG_DEBUG, "Could not create temp "
+ gf_log (this->name, GF_LOG_DEBUG, "Could not create temp "
"volfile, some option failed: %s", *op_errstr);
goto out;
}
@@ -424,11 +427,11 @@ out:
if (ret) {
if (!(*op_errstr)) {
*op_errstr = gf_strdup ("Error, Validation Failed");
- gf_log ("glsuterd", GF_LOG_DEBUG,
+ gf_log (this->name, GF_LOG_DEBUG,
"Error, Cannot Validate option :%s",
*op_errstr);
} else {
- gf_log ("glsuterd", GF_LOG_DEBUG,
+ gf_log (this->name, GF_LOG_DEBUG,
"Error, Cannot Validate option");
}
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index f15f57edc..96df8585f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -109,30 +109,30 @@ struct volopt_map_entry {
static struct volopt_map_entry glusterd_volopt_map[] = {
- {"cluster.lookup-unhashed", "cluster/distribute", NULL, NULL, NO_DOC, 0 },
- {"cluster.min-free-disk", "cluster/distribute", NULL, NULL, NO_DOC, 0 },
- {"cluster.min-free-inodes", "cluster/distribute", NULL, NULL, NO_DOC, 0 },
-
- {"cluster.entry-change-log", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.read-subvolume", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.background-self-heal-count", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.metadata-self-heal", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.data-self-heal", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.entry-self-heal", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.self-heal-daemon", "cluster/replicate", "!self-heal-daemon" , NULL, NO_DOC, 0 },
- {"cluster.strict-readdir", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.self-heal-window-size", "cluster/replicate", "data-self-heal-window-size", NULL, DOC, 0},
- {"cluster.data-change-log", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.metadata-change-log", "cluster/replicate", NULL, NULL, NO_DOC, 0 },
- {"cluster.data-self-heal-algorithm", "cluster/replicate", "data-self-heal-algorithm", NULL,DOC, 0},
+ {"cluster.lookup-unhashed", "cluster/distribute", NULL, NULL, NO_DOC, 0},
+ {"cluster.min-free-disk", "cluster/distribute", NULL, NULL, NO_DOC, 0},
+ {"cluster.min-free-inodes", "cluster/distribute", NULL, NULL, NO_DOC, 0},
+
+ {"cluster.entry-change-log", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.read-subvolume", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.background-self-heal-count", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.metadata-self-heal", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.data-self-heal", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.entry-self-heal", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.self-heal-daemon", "cluster/replicate", "!self-heal-daemon", NULL, NO_DOC, 0},
+ {"cluster.strict-readdir", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.self-heal-window-size", "cluster/replicate", "data-self-heal-window-size", NULL, DOC, 0},
+ {"cluster.data-change-log", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.metadata-change-log", "cluster/replicate", NULL, NULL, NO_DOC, 0},
+ {"cluster.data-self-heal-algorithm", "cluster/replicate", "data-self-heal-algorithm", NULL,DOC, 0},
{"cluster.quorum-type", "cluster/replicate", "quorum-type", NULL, NO_DOC, 0},
{"cluster.quorum-count", "cluster/replicate", "quorum-count", NULL, NO_DOC, 0},
- {"cluster.stripe-block-size", "cluster/stripe", "block-size", NULL, DOC, 0},
+ {"cluster.stripe-block-size", "cluster/stripe", "block-size", NULL, DOC, 0},
- {VKEY_DIAG_LAT_MEASUREMENT, "debug/io-stats", "latency-measurement", "off", NO_DOC, 0 },
- {"diagnostics.dump-fd-stats", "debug/io-stats", NULL, NULL, NO_DOC, 0 },
- {VKEY_DIAG_CNT_FOP_HITS, "debug/io-stats", "count-fop-hits", "off", NO_DOC, 0 },
+ {VKEY_DIAG_LAT_MEASUREMENT, "debug/io-stats", "latency-measurement", "off", NO_DOC, 0},
+ {"diagnostics.dump-fd-stats", "debug/io-stats", NULL, NULL, NO_DOC, 0},
+ {VKEY_DIAG_CNT_FOP_HITS, "debug/io-stats", "count-fop-hits", "off", NO_DOC, 0},
{"diagnostics.brick-log-level", "debug/io-stats", "!brick-log-level", NULL, DOC, 0},
{"diagnostics.client-log-level", "debug/io-stats", "!client-log-level", NULL, DOC, 0},
@@ -143,28 +143,26 @@ static struct volopt_map_entry glusterd_volopt_map[] = {
{"performance.cache-min-file-size", "performance/io-cache", "min-file-size", NULL, DOC, 0},
{"performance.cache-refresh-timeout", "performance/io-cache", "cache-timeout", NULL, DOC, 0},
{"performance.cache-priority", "performance/io-cache", "priority", NULL, DOC, 0},
- {"performance.cache-size", "performance/io-cache", NULL, NULL, NO_DOC, 0 },
- {"performance.cache-size", "performance/quick-read", NULL, NULL, NO_DOC, 0 },
- {"performance.flush-behind", "performance/write-behind", "flush-behind", NULL, DOC, 0},
+ {"performance.cache-size", "performance/io-cache", NULL, NULL, NO_DOC, 0 },
+ {"performance.cache-size", "performance/quick-read", NULL, NULL, NO_DOC, 0 },
+ {"performance.flush-behind", "performance/write-behind", "flush-behind", NULL, DOC, 0},
{"performance.io-thread-count", "performance/io-threads", "thread-count", DOC, 0},
-
- {"performance.disk-usage-limit", "performance/quota", NULL, NULL, NO_DOC, 0 },
- {"performance.min-free-disk-limit", "performance/quota", NULL, NULL, NO_DOC, 0 },
-
+ {"performance.disk-usage-limit", "performance/quota", NULL, NULL, NO_DOC, 0},
+ {"performance.min-free-disk-limit", "performance/quota", NULL, NULL, NO_DOC, 0},
{"performance.write-behind-window-size", "performance/write-behind", "cache-size", NULL, DOC},
+ {"performance.read-ahead-page-count", "performance/read-ahead", "page-count", NULL, DOC},
- {"performance.read-ahead-page-count", "performance/read-ahead", "page-count", NULL, DOC},
-
- {"network.frame-timeout", "protocol/client", NULL, NULL, NO_DOC, 0 },
- {"network.ping-timeout", "protocol/client", NULL, NULL, NO_DOC, 0 },
- {"network.inode-lru-limit", "protocol/server", NULL, NULL, NO_DOC, 0 },
+ {"network.frame-timeout", "protocol/client", NULL, NULL, NO_DOC, 0},
+ {"network.ping-timeout", "protocol/client", NULL, NULL, NO_DOC, 0},
+ {"network.tcp-window-size", "protocol/client", NULL, NULL, NO_DOC, 0},
+ {"network.tcp-window-size", "protocol/server", NULL, NULL, NO_DOC, 0},
+ {"network.inode-lru-limit", "protocol/server", NULL, NULL, NO_DOC, 0},
{"auth.allow", "protocol/server", "!server-auth", "*", DOC, 0},
{"auth.reject", "protocol/server", "!server-auth", NULL, DOC, 0},
-
- {"transport.keepalive", "protocol/server", "transport.socket.keepalive", NULL, NO_DOC, 0},
- {"server.allow-insecure", "protocol/server", "rpc-auth-allow-insecure", NULL, NO_DOC, 0},
+ {"transport.keepalive", "protocol/server", "transport.socket.keepalive", NULL, NO_DOC, 0},
+ {"server.allow-insecure", "protocol/server", "rpc-auth-allow-insecure", NULL, NO_DOC, 0},
{"performance.write-behind", "performance/write-behind", "!perf", "on", NO_DOC, 0},
{"performance.read-ahead", "performance/read-ahead", "!perf", "on", NO_DOC, 0},
@@ -2108,7 +2106,7 @@ volgen_graph_build_clients (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
&client_type);
if (!ret && client_type == GF_CLIENT_TRUSTED) {
-
+ str = NULL;
str = glusterd_auth_get_username (volinfo);
if (str) {
ret = xlator_set_option (xl, "username",
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index f5ec65976..d7912c95f 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -952,12 +952,12 @@ init (xlator_t *this)
conf->valgrind = _gf_false;
ret = dict_get_str (this->options, "brick-with-valgrind", &valgrind_str);
if (ret < 0) {
- gf_log (THIS->name, GF_LOG_ERROR,
+ gf_log (this->name, GF_LOG_DEBUG,
"cannot get brick-with-valgrind value");
}
if (valgrind_str) {
if (gf_string2boolean (valgrind_str, &(conf->valgrind))) {
- gf_log (THIS->name, GF_LOG_WARNING,
+ gf_log (this->name, GF_LOG_WARNING,
"brick-with-valgrind value not a boolean string");
}
}
@@ -1126,8 +1126,10 @@ struct volume_options options[] = {
{ .key = {GEOREP"-log-group"},
.type = GF_OPTION_TYPE_ANY,
},
+#ifdef DEBUG
{ .key = {"brick-with-valgrind"},
.type = GF_OPTION_TYPE_BOOL,
},
+#endif
{ .key = {NULL} },
};
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index d93a99cff..8fadc0400 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2586,5 +2586,10 @@ struct volume_options options[] = {
{ .key = {"grace-timeout"},
.type = GF_OPTION_TYPE_INT
},
+ {.key = {"tcp-window-size"},
+ .type = GF_OPTION_TYPE_SIZET,
+ .min = GF_MIN_SOCKET_WINDOW_SIZE,
+ .max = GF_MAX_SOCKET_WINDOW_SIZE
+ },
{ .key = {NULL} },
};
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index f7267b44a..f5f3aa1fe 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -35,6 +35,8 @@
#define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect"
#define CLIENT_CMD_DISCONNECT "trusted.glusterfs.client-disconnect"
#define CLIENT_DUMP_LOCKS "trusted.glusterfs.clientlk-dump"
+#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
+#define GF_MIN_SOCKET_WINDOW_SIZE (0)
#define CLIENT_GET_REMOTE_FD(conf, fd, remote_fd, op_errno, label) \
do { \
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 0f9195f9e..bfac42a27 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -1100,5 +1100,10 @@ struct volume_options options[] = {
{.key = {"grace-timeout"},
.type = GF_OPTION_TYPE_INT,
},
+ {.key = {"tcp-window-size"},
+ .type = GF_OPTION_TYPE_SIZET,
+ .min = GF_MIN_SOCKET_WINDOW_SIZE,
+ .max = GF_MAX_SOCKET_WINDOW_SIZE
+ },
{ .key = {NULL} },
};
diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h
index 091a02ccb..4c38c1971 100644
--- a/xlators/protocol/server/src/server.h
+++ b/xlators/protocol/server/src/server.h
@@ -32,6 +32,8 @@
#define DEFAULT_BLOCK_SIZE 4194304 /* 4MB */
#define DEFAULT_VOLUME_FILE_PATH CONFDIR "/glusterfs.vol"
+#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
+#define GF_MIN_SOCKET_WINDOW_SIZE (0)
typedef struct _server_state server_state_t;