nvme/rdma: allow for sge length > payload_size

Requests may need to be split in which case a child
request may have a size smaller than the SGE that
contains the child request's payload.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6c7ab76104d56fa9dde168cfdddb6320c7157f98

Reviewed-on: https://review.gerrithub.io/372347
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2017-08-02 11:13:18 -07:00
parent 5f05513bf1
commit 75a1b39fcc

View File

@ -850,7 +850,7 @@ nvme_rdma_build_sgl_request(struct nvme_rdma_qpair *rqpair, struct nvme_request
return -1;
}
if (length != req->payload_size) {
if (length < req->payload_size) {
SPDK_ERRLOG("multi-element SGL currently not supported for RDMA\n");
return -1;
}
@ -863,7 +863,7 @@ nvme_rdma_build_sgl_request(struct nvme_rdma_qpair *rqpair, struct nvme_request
req->cmd.psdt = SPDK_NVME_PSDT_SGL_MPTR_CONTIG;
req->cmd.dptr.sgl1.keyed.type = SPDK_NVME_SGL_TYPE_KEYED_DATA_BLOCK;
req->cmd.dptr.sgl1.keyed.subtype = SPDK_NVME_SGL_SUBTYPE_ADDRESS;
req->cmd.dptr.sgl1.keyed.length = length;
req->cmd.dptr.sgl1.keyed.length = req->payload_size;
req->cmd.dptr.sgl1.keyed.key = mr->rkey;
req->cmd.dptr.sgl1.address = (uint64_t)virt_addr;