From 60361d84a03048b0882935fb92c19ac3b68f9325 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Mon, 22 Dec 2014 11:04:50 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9321 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 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)) { -- cgit