summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/rdma/src
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2014-12-22 11:04:50 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-02-12 04:44:24 -0800
commit60361d84a03048b0882935fb92c19ac3b68f9325 (patch)
tree5e9b04fde9f29c4401810339e67ff41e27e2741a /rpc/rpc-transport/rdma/src
parentfe73f12f6ef2deb402b622747cad5e82b11e57af (diff)
rdma : agregate a vectored read as one
For a vectored read with payload count>1 will make two read requests and to hold that a single contiguous memory is allocated. So after completing the read request, instead of sending as vector we will aggregate all the reads one. Change-Id: I15e7d7bddc1a62d5097a39392575f47cfff3d3a8 BUG: 1164079 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9321 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/rpc-transport/rdma/src')
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c10
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 a1c86228ae6..599003ea9a7 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -3990,6 +3990,16 @@ gf_rdma_handle_successful_send_completion (gf_rdma_peer_t *peer,
post->ctx.count = 1;
post->ctx.vector[0].iov_len += post->ctx.vector[1].iov_len;
}
+ /*
+ * if reads performed as vectored, then all the buffers are actually
+ * contiguous memory, so that we can use it as single vector, instead
+ * of multiple.
+ */
+ while (post->ctx.count > 2) {
+ post->ctx.vector[1].iov_len +=
+ post->ctx.vector[post->ctx.count-1].iov_len;
+ post->ctx.count--;
+ }
ret = gf_rdma_pollin_notify (peer, post);
if ((ret == -1) && (peer != NULL)) {