From f65099d37816f6e8ee49ae1a1354e9f0bef74ac9 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Thu, 2 Dec 2021 14:17:15 +0100 Subject: [PATCH] nvmf: remove zcopy check in spdk_nvmf_request_exec It will make it possible to submit zero-copy requests through spdk_nvmf_request_exec(). Signed-off-by: Konrad Sztyber Change-Id: Ibc14fe77cd477b11ed55d1350a7486caaad81add Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10783 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk Tested-by: SPDK CI Jenkins --- lib/nvmf/ctrlr.c | 6 ++---- test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c | 14 ++------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index b01d5614f0..b8aa3215df 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -4170,10 +4170,8 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req) struct spdk_nvmf_transport *transport = qpair->transport; enum spdk_nvmf_request_exec_status status; - if (!spdk_nvmf_request_using_zcopy(req)) { - if (!nvmf_check_subsystem_active(req)) { - return; - } + if (!nvmf_check_subsystem_active(req)) { + return; } if (SPDK_DEBUGLOG_FLAG_ENABLED("nvmf")) { diff --git a/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c b/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c index 4518522b31..9350f50319 100644 --- a/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c +++ b/test/unit/lib/nvmf/ctrlr.c/ctrlr_ut.c @@ -2579,13 +2579,7 @@ test_zcopy_read(void) CU_ASSERT(req.zcopy_bdev_io == zcopy_start_bdev_io_read); CU_ASSERT(qpair.outstanding.tqh_first == &req); CU_ASSERT(ns_info.io_outstanding == 1); - - /* Execute the request */ - spdk_nvmf_request_exec(&req); CU_ASSERT(nvme_status_success(&rsp.nvme_cpl.status)); - CU_ASSERT(req.zcopy_bdev_io == zcopy_start_bdev_io_read); - CU_ASSERT(qpair.outstanding.tqh_first == &req); - CU_ASSERT(ns_info.io_outstanding == 1); /* Perform the zcopy end */ spdk_nvmf_request_zcopy_end(&req, false); @@ -2593,6 +2587,7 @@ test_zcopy_read(void) CU_ASSERT(req.zcopy_phase == NVMF_ZCOPY_PHASE_COMPLETE); CU_ASSERT(qpair.outstanding.tqh_first == NULL); CU_ASSERT(ns_info.io_outstanding == 0); + CU_ASSERT(nvme_status_success(&rsp.nvme_cpl.status)); } static void @@ -2670,13 +2665,7 @@ test_zcopy_write(void) CU_ASSERT(req.zcopy_bdev_io == zcopy_start_bdev_io_write); CU_ASSERT(qpair.outstanding.tqh_first == &req); CU_ASSERT(ns_info.io_outstanding == 1); - - /* Execute the request */ - spdk_nvmf_request_exec(&req); CU_ASSERT(nvme_status_success(&rsp.nvme_cpl.status)); - CU_ASSERT(req.zcopy_bdev_io == zcopy_start_bdev_io_write); - CU_ASSERT(qpair.outstanding.tqh_first == &req); - CU_ASSERT(ns_info.io_outstanding == 1); /* Perform the zcopy end */ spdk_nvmf_request_zcopy_end(&req, true); @@ -2684,6 +2673,7 @@ test_zcopy_write(void) CU_ASSERT(req.zcopy_phase == NVMF_ZCOPY_PHASE_COMPLETE); CU_ASSERT(qpair.outstanding.tqh_first == NULL); CU_ASSERT(ns_info.io_outstanding == 0); + CU_ASSERT(nvme_status_success(&rsp.nvme_cpl.status)); } static void