From 59a3afa0ff492ba6959d2b85c3c8cc655d85bd10 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 1 Aug 2019 03:49:32 -0700 Subject: [PATCH] nvmf/rdma: pass iov_base to spdk_mem_map_translate We should be checking directly against the base of the iov when doing memory map translations. The current behavior is to check against the starting address of the buffer which is a close address, but not exactly the same. Change-Id: I7f65224a6836a814708438f2866d84ae22882216 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463893 Reviewed-by: Broadcom SPDK FC-NVMe CI Reviewed-by: Reviewed-by: Changpeng Liu Reviewed-by: Darek Stojaczyk Tested-by: SPDK CI Jenkins --- lib/nvmf/rdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 509f70bbd..56f74dccd 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -1558,10 +1558,10 @@ nvmf_rdma_fill_buffers(struct spdk_nvmf_rdma_transport *rtransport, if (!g_nvmf_hooks.get_rkey) { wr->sg_list[i].lkey = ((struct ibv_mr *)spdk_mem_map_translate(device->map, - (uint64_t)rdma_req->buffers[iovcnt], &translation_len))->lkey; + (uint64_t)rdma_req->req.iov[iovcnt].iov_base, &translation_len))->lkey; } else { wr->sg_list[i].lkey = spdk_mem_map_translate(device->map, - (uint64_t)rdma_req->buffers[iovcnt], &translation_len); + (uint64_t)rdma_req->req.iov[iovcnt].iov_base, &translation_len); } remaining_length -= rdma_req->req.iov[iovcnt].iov_len;