diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2014-12-22 11:04:50 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-03-27 04:33:11 -0700 |
commit | 692f1c6c92152fb592b0c35c0faa1610dbecaad5 (patch) | |
tree | 89fcf9b60ee254325de34a86ce811afb3608c09a | |
parent | 73835a06e87f685354816fb6c2ca4a9918f5e314 (diff) |
rdma : agregate a vectored read as one
Back port of : http://review.gluster.org/9321
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: 1202212
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>
Reviewed-on: http://review.gluster.org/9886
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r-- | rpc/rpc-transport/rdma/src/rdma.c | 10 |
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)) { |