nvmf: remove zcopy phase checks from IO functions
The code should never reach these functions for requests using zero-copy. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: If9f30e05a43b340a982604d5b985242d63ce252b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10782 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
594ccf5a0f
commit
7d23ac8657
@ -306,11 +306,6 @@ nvmf_bdev_ctrlr_read_cmd(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc,
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
if (req->zcopy_phase == NVMF_ZCOPY_PHASE_EXECUTE) {
|
||||
/* Return here after checking the lba etc */
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
assert(!spdk_nvmf_request_using_zcopy(req));
|
||||
|
||||
rc = spdk_bdev_readv_blocks(desc, ch, req->iov, req->iovcnt, start_lba, num_blocks,
|
||||
@ -357,11 +352,6 @@ nvmf_bdev_ctrlr_write_cmd(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc,
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
if (req->zcopy_phase == NVMF_ZCOPY_PHASE_EXECUTE) {
|
||||
/* Return here after checking the lba etc */
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
assert(!spdk_nvmf_request_using_zcopy(req));
|
||||
|
||||
rc = spdk_bdev_writev_blocks(desc, ch, req->iov, req->iovcnt, start_lba, num_blocks,
|
||||
|
@ -752,20 +752,6 @@ test_nvmf_bdev_ctrlr_read_write_cmd(void)
|
||||
rc = nvmf_bdev_ctrlr_read_cmd(&bdev, NULL, NULL, &req);
|
||||
CU_ASSERT(rc == SPDK_NVMF_REQUEST_EXEC_STATUS_ASYNCHRONOUS);
|
||||
|
||||
/* Execute zero copy */
|
||||
req.zcopy_phase = NVMF_ZCOPY_PHASE_EXECUTE;
|
||||
|
||||
rc = nvmf_bdev_ctrlr_read_cmd(&bdev, NULL, NULL, &req);
|
||||
CU_ASSERT(rc == SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE);
|
||||
|
||||
/* Read cmd request length invalid */
|
||||
req.length = 4096;
|
||||
|
||||
rc = nvmf_bdev_ctrlr_read_cmd(&bdev, NULL, NULL, &req);
|
||||
CU_ASSERT(rc == SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE);
|
||||
CU_ASSERT(rsp.nvme_cpl.status.sct == SPDK_NVME_SCT_GENERIC);
|
||||
CU_ASSERT(rsp.nvme_cpl.status.sc == SPDK_NVME_SC_DATA_SGL_LENGTH_INVALID);
|
||||
|
||||
/* Write two blocks, block size 4096 */
|
||||
cmd.nvme_cmd.cdw12 = 1;
|
||||
bdev.blockcnt = 100;
|
||||
@ -775,20 +761,6 @@ test_nvmf_bdev_ctrlr_read_write_cmd(void)
|
||||
|
||||
rc = nvmf_bdev_ctrlr_write_cmd(&bdev, NULL, NULL, &req);
|
||||
CU_ASSERT(rc == SPDK_NVMF_REQUEST_EXEC_STATUS_ASYNCHRONOUS);
|
||||
|
||||
/* Execute zero copy */
|
||||
req.zcopy_phase = NVMF_ZCOPY_PHASE_EXECUTE;
|
||||
|
||||
rc = nvmf_bdev_ctrlr_write_cmd(&bdev, NULL, NULL, &req);
|
||||
CU_ASSERT(rc == SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE);
|
||||
|
||||
/* Write cmd request length invalid */
|
||||
req.length = 4096;
|
||||
|
||||
rc = nvmf_bdev_ctrlr_read_cmd(&bdev, NULL, NULL, &req);
|
||||
CU_ASSERT(rc == SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE);
|
||||
CU_ASSERT(rsp.nvme_cpl.status.sct == SPDK_NVME_SCT_GENERIC);
|
||||
CU_ASSERT(rsp.nvme_cpl.status.sc == SPDK_NVME_SC_DATA_SGL_LENGTH_INVALID);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user