summaryrefslogtreecommitdiffstats
path: root/transport/ib-verbs/src/ib-verbs.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@del.gluster.com>2009-03-17 18:15:19 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-03-18 08:23:20 +0530
commitb947dc7161427b8c84f47b0a97861a36557f5748 (patch)
tree00dbfc53dd01b62ecee878883f1831aa0f6b4c14 /transport/ib-verbs/src/ib-verbs.c
parent0a7f4cfc1c516da573949a9521248744ce97c4e9 (diff)
ib-verbs recv-size and send-size argument takes SIZET arguments now.
With this patch, to specify recv-size and send-size of ib-verbs to <n>KB, we need not give the option as integer value of 'n * 1024' value. This is neater to do deployments. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'transport/ib-verbs/src/ib-verbs.c')
-rw-r--r--transport/ib-verbs/src/ib-verbs.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/transport/ib-verbs/src/ib-verbs.c b/transport/ib-verbs/src/ib-verbs.c
index b0ac22563..9a21b8a8f 100644
--- a/transport/ib-verbs/src/ib-verbs.c
+++ b/transport/ib-verbs/src/ib-verbs.c
@@ -268,8 +268,8 @@ __ib_verbs_ioq_churn_entry (ib_verbs_peer_t *peer, ib_verbs_ioq_t *entry)
if (len >= (options->send_size + 2048)) {
gf_log ("transport/ib-verbs", GF_LOG_CRITICAL,
"increase value of option 'transport.ib-verbs."
- "work-request-send-size' (given=> %d) to send "
- "bigger (%d) messages",
+ "work-request-send-size' (given=> %"PRId64") "
+ "to send bigger (%d) messages",
(options->send_size + 2048), len);
return -1;
}
@@ -1251,11 +1251,12 @@ ib_verbs_options_init (transport_t *this)
ib_verbs_options_t *options = &priv->options;
int32_t mtu;
data_t *temp;
+ int ret = 0;
/* TODO: validate arguments from options below */
- options->send_size = 1048576;
- options->recv_size = 1048576;
+ options->send_size = 1048576; /* 1 MB */
+ options->recv_size = 1048576; /* 1 MB */
options->send_count = 16;
options->recv_count = 16;
@@ -1271,13 +1272,29 @@ ib_verbs_options_init (transport_t *this)
temp = dict_get (this->xl->options,
"transport.ib-verbs.work-request-send-size");
- if (temp)
- options->send_size = data_to_int32 (temp);
+ if (temp) {
+ ret = gf_string2bytesize (temp->data, &options->send_size);
+ if (ret != 0) {
+ gf_log ("ib-verbs", GF_LOG_ERROR,
+ "invalid number format \"%s\" of "
+ "\"option request-send-size\"",
+ temp->data);
+ options->send_size = 1 * GF_UNIT_MB;
+ }
+ }
temp = dict_get (this->xl->options,
"transport.ib-verbs.work-request-recv-size");
- if (temp)
- options->recv_size = data_to_int32 (temp);
+ if (temp) {
+ ret = gf_string2bytesize (temp->data, &options->recv_size);
+ if (ret != 0) {
+ gf_log ("ib-verbs", GF_LOG_ERROR,
+ "invalid number format \"%s\" of "
+ "\"option request-recv-size\"",
+ temp->data);
+ options->recv_size = 1 * GF_UNIT_MB;
+ }
+ }
options->port = 1;
temp = dict_get (this->xl->options,
@@ -2351,11 +2368,11 @@ struct volume_options options[] = {
},
{ .key = {"transport.ib-verbs.work-request-send-size",
"ib-verbs-work-request-send-size"},
- .type = GF_OPTION_TYPE_INT,
+ .type = GF_OPTION_TYPE_SIZET,
},
{ .key = {"transport.ib-verbs.work-request-recv-size",
"ib-verbs-work-request-recv-size"},
- .type = GF_OPTION_TYPE_INT,
+ .type = GF_OPTION_TYPE_SIZET,
},
{ .key = {"transport.ib-verbs.work-request-send-count",
"ib-verbs-work-request-send-count"},