diff options
-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)) { |