From 6b2fb186f6da00c9273670c227ecfd66a1b31391 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 10 Oct 2018 11:19:33 -0700 Subject: [PATCH] nvme: Make it clearer which RDMA sgl element is being filled out While more verbose, this makes it much more obvious that an array of SGL elements is being filled out. Change-Id: I98b8e5d46af32c5d7dbb990e267fdfd594942081 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/428729 Reviewed-by: Seth Howell Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System --- lib/nvme/nvme_rdma.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index 507ea82a8..08ca7ffc6 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -860,7 +860,6 @@ static int nvme_rdma_build_contig_inline_request(struct nvme_rdma_qpair *rqpair, struct spdk_nvme_rdma_req *rdma_req) { - struct ibv_sge *sge_inline = &rdma_req->send_sgl[1]; struct nvme_request *req = rdma_req->req; struct ibv_mr *mr; void *payload; @@ -884,9 +883,9 @@ nvme_rdma_build_contig_inline_request(struct nvme_rdma_qpair *rqpair, * the NVMe command. */ rdma_req->send_sgl[0].length = sizeof(struct spdk_nvme_cmd); - sge_inline->addr = (uint64_t)payload; - sge_inline->length = (uint32_t)req->payload_size; - sge_inline->lkey = mr->lkey; + rdma_req->send_sgl[1].addr = (uint64_t)payload; + rdma_req->send_sgl[1].length = (uint32_t)req->payload_size; + rdma_req->send_sgl[1].lkey = mr->lkey; /* The RDMA SGL contains two elements. The first describes * the NVMe command and the second describes the data @@ -1048,7 +1047,6 @@ static int nvme_rdma_build_sgl_inline_request(struct nvme_rdma_qpair *rqpair, struct spdk_nvme_rdma_req *rdma_req) { - struct ibv_sge *sge_inline = &rdma_req->send_sgl[1]; struct nvme_request *req = rdma_req->req; struct ibv_mr *mr; uint32_t length; @@ -1086,9 +1084,9 @@ nvme_rdma_build_sgl_inline_request(struct nvme_rdma_qpair *rqpair, * the NVMe command. */ rdma_req->send_sgl[0].length = sizeof(struct spdk_nvme_cmd); - sge_inline->addr = (uint64_t)virt_addr; - sge_inline->length = (uint32_t)req->payload_size; - sge_inline->lkey = mr->lkey; + rdma_req->send_sgl[1].addr = (uint64_t)virt_addr; + rdma_req->send_sgl[1].length = (uint32_t)req->payload_size; + rdma_req->send_sgl[1].lkey = mr->lkey; /* The RDMA SGL contains two elements. The first describes * the NVMe command and the second describes the data