nvmf: rename zcopy operations to zcopy_(start|end)

It makes their names consistent with the bdev API.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I314051f0980b46959d6560aa25885f13b4c28f2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10786
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: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Konrad Sztyber 2021-12-06 13:52:40 +01:00 committed by Jim Harris
parent 71cbc22960
commit 0e09df57dd
6 changed files with 21 additions and 21 deletions

View File

@ -3769,7 +3769,7 @@ spdk_nvmf_request_zcopy_start(struct spdk_nvmf_request *req)
*/
req->iovcnt = NVMF_REQ_MAX_BUFFERS;
TAILQ_INSERT_TAIL(&qpair->outstanding, req, link);
rc = nvmf_bdev_ctrlr_start_zcopy(bdev, desc, ch, req);
rc = nvmf_bdev_ctrlr_zcopy_start(bdev, desc, ch, req);
if (rc == 0) {
ns_info->io_outstanding++;
return 0;
@ -3788,7 +3788,7 @@ int
spdk_nvmf_request_zcopy_end(struct spdk_nvmf_request *req, bool commit)
{
req->zcopy_phase = NVMF_ZCOPY_PHASE_END_PENDING;
return nvmf_bdev_ctrlr_end_zcopy(req, commit);
return nvmf_bdev_ctrlr_zcopy_end(req, commit);
}
int
@ -3875,7 +3875,7 @@ nvmf_ctrlr_process_io_cmd(struct spdk_nvmf_request *req)
if (spdk_nvmf_request_using_zcopy(req)) {
assert(req->zcopy_phase == NVMF_ZCOPY_PHASE_INIT);
return nvmf_bdev_ctrlr_start_zcopy(bdev, desc, ch, req);
return nvmf_bdev_ctrlr_zcopy_start(bdev, desc, ch, req);
} else {
switch (cmd->opc) {
case SPDK_NVME_OPC_READ:

View File

@ -792,7 +792,7 @@ nvmf_bdev_ctrlr_get_dif_ctx(struct spdk_bdev *bdev, struct spdk_nvme_cmd *cmd,
}
static void
nvmf_bdev_ctrlr_start_zcopy_complete(struct spdk_bdev_io *bdev_io, bool success,
nvmf_bdev_ctrlr_zcopy_start_complete(struct spdk_bdev_io *bdev_io, bool success,
void *cb_arg)
{
struct spdk_nvmf_request *req = cb_arg;
@ -833,7 +833,7 @@ nvmf_bdev_ctrlr_start_zcopy_complete(struct spdk_bdev_io *bdev_io, bool success,
}
int
nvmf_bdev_ctrlr_start_zcopy(struct spdk_bdev *bdev,
nvmf_bdev_ctrlr_zcopy_start(struct spdk_bdev *bdev,
struct spdk_bdev_desc *desc,
struct spdk_io_channel *ch,
struct spdk_nvmf_request *req)
@ -859,11 +859,11 @@ nvmf_bdev_ctrlr_start_zcopy(struct spdk_bdev *bdev,
bool populate = (req->cmd->nvme_cmd.opc == SPDK_NVME_OPC_READ) ? true : false;
return spdk_bdev_zcopy_start(desc, ch, req->iov, req->iovcnt, start_lba,
num_blocks, populate, nvmf_bdev_ctrlr_start_zcopy_complete, req);
num_blocks, populate, nvmf_bdev_ctrlr_zcopy_start_complete, req);
}
static void
nvmf_bdev_ctrlr_end_zcopy_complete(struct spdk_bdev_io *bdev_io, bool success,
nvmf_bdev_ctrlr_zcopy_end_complete(struct spdk_bdev_io *bdev_io, bool success,
void *cb_arg)
{
struct spdk_nvmf_request *req = cb_arg;
@ -885,7 +885,7 @@ nvmf_bdev_ctrlr_end_zcopy_complete(struct spdk_bdev_io *bdev_io, bool success,
}
int
nvmf_bdev_ctrlr_end_zcopy(struct spdk_nvmf_request *req, bool commit)
nvmf_bdev_ctrlr_zcopy_end(struct spdk_nvmf_request *req, bool commit)
{
return spdk_bdev_zcopy_end(req->zcopy_bdev_io, commit, nvmf_bdev_ctrlr_end_zcopy_complete, req);
return spdk_bdev_zcopy_end(req->zcopy_bdev_io, commit, nvmf_bdev_ctrlr_zcopy_end_complete, req);
}

View File

@ -486,7 +486,7 @@ nvmf_qpair_is_admin_queue(struct spdk_nvmf_qpair *qpair)
* \return 0 upon success
* \return <0 if the zcopy operation could not be started
*/
int nvmf_bdev_ctrlr_start_zcopy(struct spdk_bdev *bdev,
int nvmf_bdev_ctrlr_zcopy_start(struct spdk_bdev *bdev,
struct spdk_bdev_desc *desc,
struct spdk_io_channel *ch,
struct spdk_nvmf_request *req);
@ -500,6 +500,6 @@ int nvmf_bdev_ctrlr_start_zcopy(struct spdk_bdev *bdev,
* \return 0 upon success
* \return <0 on error
*/
int nvmf_bdev_ctrlr_end_zcopy(struct spdk_nvmf_request *req, bool commit);
int nvmf_bdev_ctrlr_zcopy_end(struct spdk_nvmf_request *req, bool commit);
#endif /* __NVMF_INTERNAL_H__ */

View File

@ -264,7 +264,7 @@ nvmf_bdev_zcopy_enabled(struct spdk_bdev *bdev)
}
int
nvmf_bdev_ctrlr_start_zcopy(struct spdk_bdev *bdev,
nvmf_bdev_ctrlr_zcopy_start(struct spdk_bdev *bdev,
struct spdk_bdev_desc *desc,
struct spdk_io_channel *ch,
struct spdk_nvmf_request *req)
@ -293,7 +293,7 @@ nvmf_bdev_ctrlr_start_zcopy(struct spdk_bdev *bdev,
}
int
nvmf_bdev_ctrlr_end_zcopy(struct spdk_nvmf_request *req, bool commit)
nvmf_bdev_ctrlr_zcopy_end(struct spdk_nvmf_request *req, bool commit)
{
req->zcopy_bdev_io = NULL;
spdk_nvmf_request_complete(req);
@ -2486,7 +2486,7 @@ test_spdk_nvmf_request_zcopy_start(void)
CU_ASSERT(req.zcopy_phase == NVMF_ZCOPY_PHASE_NONE);
qpair.state = SPDK_NVMF_QPAIR_ACTIVE;
/* Fail because nvmf_bdev_ctrlr_start_zcopy fails */
/* Fail because nvmf_bdev_ctrlr_zcopy_start fails */
CU_ASSERT(nvmf_ctrlr_use_zcopy(&req));
CU_ASSERT(req.zcopy_phase == NVMF_ZCOPY_PHASE_INIT);
cmd.cdw10 = bdev.blockcnt; /* SLBA: CDW10 and CDW11 */

View File

@ -548,7 +548,7 @@ test_nvmf_bdev_ctrlr_identify_ns(void)
}
static void
test_nvmf_bdev_ctrlr_start_zcopy(void)
test_nvmf_bdev_ctrlr_zcopy_start(void)
{
int rc;
struct spdk_bdev bdev = {};
@ -604,7 +604,7 @@ test_nvmf_bdev_ctrlr_start_zcopy(void)
write_cmd.cdw12 = 1; /* NLB: CDW12 bits 15:00, 0's based */
write_req.length = (write_cmd.cdw12 + 1) * bdev.blocklen;
rc = nvmf_bdev_ctrlr_start_zcopy(&bdev, desc, &ch, &write_req);
rc = nvmf_bdev_ctrlr_zcopy_start(&bdev, desc, &ch, &write_req);
CU_ASSERT(rc == 0);
@ -613,7 +613,7 @@ test_nvmf_bdev_ctrlr_start_zcopy(void)
write_cmd.cdw12 = 100; /* NLB: CDW12 bits 15:00, 0's based */
write_req.length = (write_cmd.cdw12 + 1) * bdev.blocklen;
rc = nvmf_bdev_ctrlr_start_zcopy(&bdev, desc, &ch, &write_req);
rc = nvmf_bdev_ctrlr_zcopy_start(&bdev, desc, &ch, &write_req);
CU_ASSERT(rc < 0);
@ -622,7 +622,7 @@ test_nvmf_bdev_ctrlr_start_zcopy(void)
write_cmd.cdw12 = 1; /* NLB: CDW12 bits 15:00, 0's based */
write_req.length = (write_cmd.cdw12 + 1) * bdev.blocklen - 1;
rc = nvmf_bdev_ctrlr_start_zcopy(&bdev, desc, &ch, &write_req);
rc = nvmf_bdev_ctrlr_zcopy_start(&bdev, desc, &ch, &write_req);
CU_ASSERT(rc < 0);
}
@ -881,7 +881,7 @@ int main(int argc, char **argv)
CU_ADD_TEST(suite, test_get_dif_ctx);
CU_ADD_TEST(suite, test_nvmf_bdev_ctrlr_identify_ns);
CU_ADD_TEST(suite, test_spdk_nvmf_bdev_ctrlr_compare_and_write_cmd);
CU_ADD_TEST(suite, test_nvmf_bdev_ctrlr_start_zcopy);
CU_ADD_TEST(suite, test_nvmf_bdev_ctrlr_zcopy_start);
CU_ADD_TEST(suite, test_nvmf_bdev_ctrlr_cmd);
CU_ADD_TEST(suite, test_nvmf_bdev_ctrlr_read_write_cmd);
CU_ADD_TEST(suite, test_nvmf_bdev_ctrlr_nvme_passthru);

View File

@ -192,13 +192,13 @@ DEFINE_STUB(nvmf_bdev_zcopy_enabled,
(struct spdk_bdev *bdev),
false);
DEFINE_STUB(nvmf_bdev_ctrlr_start_zcopy,
DEFINE_STUB(nvmf_bdev_ctrlr_zcopy_start,
int,
(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
struct spdk_nvmf_request *req),
0);
DEFINE_STUB(nvmf_bdev_ctrlr_end_zcopy,
DEFINE_STUB(nvmf_bdev_ctrlr_zcopy_end,
int,
(struct spdk_nvmf_request *req, bool commit),
0);