Commit 6b2fb186 authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/428729


Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 3fe0db6c
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -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