nvmf/vfio-user: add copy support in vfio-user
Fix req length issue in supporting copy command in vfio-user. Signed-off-by: Rui Chang <rui.chang@arm.com> Change-Id: If4ec325777e1a1f00d15edb2fea4dc85016b3b95 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17279 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: John Levon <levon@movementarian.org> Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
ed23b2078a
commit
4274fe55c9
@ -5395,6 +5395,11 @@ get_nvmf_io_req_length(struct spdk_nvmf_request *req)
|
||||
return nr * sizeof(struct spdk_nvme_dsm_range);
|
||||
}
|
||||
|
||||
if (cmd->opc == SPDK_NVME_OPC_COPY) {
|
||||
nr = (cmd->cdw12 & 0x000000ffu) + 1;
|
||||
return nr * sizeof(struct spdk_nvme_scc_source_range);
|
||||
}
|
||||
|
||||
nlb = (cmd->cdw12 & 0x0000ffffu) + 1;
|
||||
return nlb * spdk_bdev_get_block_size(ns->bdev);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user