diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index d16d5582fe..c42925dabf 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -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: diff --git a/lib/nvmf/ctrlr_bdev.c b/lib/nvmf/ctrlr_bdev.c index 382cd641c1..b1951403b9 100644 --- a/lib/nvmf/ctrlr_bdev.c +++ b/lib/nvmf/ctrlr_bdev.c @@ -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); } diff --git a/lib/nvmf/nvmf_internal.h b/lib/nvmf/nvmf_internal.h index a9d0957eea..c49e41088d 100644 --- a/lib/nvmf/nvmf_internal.h +++ b/lib/nvmf/nvmf_internal.h @@ -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__ */ diff --git a/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c b/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c index 9350f50319..895d54f7cb 100644 --- a/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c +++ b/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c @@ -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 */ diff --git a/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c b/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c index 9243036992..9601503022 100644 --- a/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c +++ b/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c @@ -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); diff --git a/test/unit/lib/nvmf/tcp.c/tcp_ut.c b/test/unit/lib/nvmf/tcp.c/tcp_ut.c index 205e374144..0744fe0007 100644 --- a/test/unit/lib/nvmf/tcp.c/tcp_ut.c +++ b/test/unit/lib/nvmf/tcp.c/tcp_ut.c @@ -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);