summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-11-09 14:40:02 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-15 23:32:59 -0800
commit62088ee6a8d2413c828409dec09e31d600987110 (patch)
tree21e02926aac578456acf176905700093066c6072 /rpc
parent5e14417b478520620bb5990eda41e3ad3e9af09c (diff)
rpc-transport/rdma: send correct vector count when both rpc-header and program-header are received through rdma-reads.
Change-Id: I1b0b91eb7216f32a5748325d6dda37f3998302c7 BUG: 3754 Reviewed-on: http://review.gluster.com/697 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index b88b884..a3f6e3f 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -3415,8 +3415,9 @@ rdma_handle_failed_send_completion (rdma_peer_t *peer, struct ibv_wc *wc)
void
rdma_handle_successful_send_completion (rdma_peer_t *peer, struct ibv_wc *wc)
{
- rdma_post_t *post = NULL;
- int reads = 0, ret = 0;
+ rdma_post_t *post = NULL;
+ int reads = 0, ret = 0;
+ rdma_header_t *header = NULL;
if (wc->opcode != IBV_WC_RDMA_READ) {
goto out;
@@ -3435,6 +3436,13 @@ rdma_handle_successful_send_completion (rdma_peer_t *peer, struct ibv_wc *wc)
goto out;
}
+ header = (rdma_header_t *)post->buf;
+
+ if (header->rm_type == RDMA_NOMSG) {
+ post->ctx.count = 1;
+ post->ctx.vector[0].iov_len += post->ctx.vector[1].iov_len;
+ }
+
ret = rdma_pollin_notify (peer, post);
if ((ret == -1) && (peer != NULL)) {
rpc_transport_disconnect (peer->trans);