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 <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463893
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: <jiandong.zheng@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Seth Howell 2019-08-01 03:49:32 -07:00 committed by Darek Stojaczyk
parent 32e5d08393
commit 59a3afa0ff

View File

@ -1558,10 +1558,10 @@ nvmf_rdma_fill_buffers(struct spdk_nvmf_rdma_transport *rtransport,
if (!g_nvmf_hooks.get_rkey) { if (!g_nvmf_hooks.get_rkey) {
wr->sg_list[i].lkey = ((struct ibv_mr *)spdk_mem_map_translate(device->map, 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 { } else {
wr->sg_list[i].lkey = spdk_mem_map_translate(device->map, 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; remaining_length -= rdma_req->req.iov[iovcnt].iov_len;