nvme: hide the 2MiB memory check in env API
spdk_vtophys() already checks that, so we don't need to check it in the NVMe driver again. Change-Id: I74288ae8cab80e1be34583475fa02a3ae13e090c Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5166 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
4793391448
commit
e1aba43745
@ -2037,7 +2037,7 @@ nvme_pcie_qpair_build_hw_sgl_request(struct spdk_nvme_qpair *qpair, struct nvme_
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
void *virt_addr;
|
void *virt_addr;
|
||||||
uint64_t phys_addr;
|
uint64_t phys_addr, mapping_length;
|
||||||
uint32_t remaining_transfer_len, remaining_user_sge_len, length;
|
uint32_t remaining_transfer_len, remaining_user_sge_len, length;
|
||||||
struct spdk_nvme_sgl_descriptor *sgl;
|
struct spdk_nvme_sgl_descriptor *sgl;
|
||||||
uint32_t nseg = 0;
|
uint32_t nseg = 0;
|
||||||
@ -2109,12 +2109,13 @@ nvme_pcie_qpair_build_hw_sgl_request(struct spdk_nvme_qpair *qpair, struct nvme_
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
phys_addr = spdk_vtophys(virt_addr, NULL);
|
mapping_length = remaining_user_sge_len;
|
||||||
|
phys_addr = spdk_vtophys(virt_addr, &mapping_length);
|
||||||
if (phys_addr == SPDK_VTOPHYS_ERROR) {
|
if (phys_addr == SPDK_VTOPHYS_ERROR) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
length = spdk_min(remaining_user_sge_len, VALUE_2MB - _2MB_OFFSET(virt_addr));
|
length = spdk_min(remaining_user_sge_len, mapping_length);
|
||||||
remaining_user_sge_len -= length;
|
remaining_user_sge_len -= length;
|
||||||
virt_addr += length;
|
virt_addr += length;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user