nvmf: rename spdk_nvmf_using_zcopy to spdk_nvmf_request_using_zcopy

It's more descriptive that way, as it's clear the function works on a
single request. Also, passing a request instead of zcopy_phase makes it
more convient to use.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If4d7b087511e128f3590ac7b3b5adcb8ace12003
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10781
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Konrad Sztyber 2021-11-29 16:05:10 +01:00 committed by Jim Harris
parent aa1d039836
commit 594ccf5a0f
3 changed files with 10 additions and 10 deletions

View File

@ -89,12 +89,6 @@ enum spdk_nvmf_zcopy_phase {
NVMF_ZCOPY_PHASE_INIT_FAILED /* Failed to get the buffers */
};
static inline bool
spdk_nvmf_using_zcopy(enum spdk_nvmf_zcopy_phase phase)
{
return (phase != NVMF_ZCOPY_PHASE_NONE);
}
struct spdk_nvmf_request {
struct spdk_nvmf_qpair *qpair;
uint32_t length;
@ -457,6 +451,12 @@ int spdk_nvmf_request_complete(struct spdk_nvmf_request *req);
int spdk_nvmf_request_zcopy_start(struct spdk_nvmf_request *req);
int spdk_nvmf_request_zcopy_end(struct spdk_nvmf_request *req, bool commit);
static inline bool
spdk_nvmf_request_using_zcopy(const struct spdk_nvmf_request *req)
{
return req->zcopy_phase != NVMF_ZCOPY_PHASE_NONE;
}
/**
* Remove the given qpair from the poll group.
*

View File

@ -801,7 +801,7 @@ nvmf_subsystem_pg_from_connect_cmd(struct spdk_nvmf_request *req)
static void
nvmf_add_to_outstanding_queue(struct spdk_nvmf_request *req)
{
if (!spdk_nvmf_using_zcopy(req->zcopy_phase)) {
if (!spdk_nvmf_request_using_zcopy(req)) {
/* if using zcopy then request has been added when the start zcopy was actioned */
struct spdk_nvmf_qpair *qpair = req->qpair;
TAILQ_INSERT_TAIL(&qpair->outstanding, req, link);
@ -4170,7 +4170,7 @@ 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_using_zcopy(req->zcopy_phase)) {
if (!spdk_nvmf_request_using_zcopy(req)) {
if (!nvmf_check_subsystem_active(req)) {
return;
}

View File

@ -311,7 +311,7 @@ nvmf_bdev_ctrlr_read_cmd(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc,
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
}
assert(!spdk_nvmf_using_zcopy(req->zcopy_phase));
assert(!spdk_nvmf_request_using_zcopy(req));
rc = spdk_bdev_readv_blocks(desc, ch, req->iov, req->iovcnt, start_lba, num_blocks,
nvmf_bdev_ctrlr_complete_cmd, req);
@ -362,7 +362,7 @@ nvmf_bdev_ctrlr_write_cmd(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc,
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
}
assert(!spdk_nvmf_using_zcopy(req->zcopy_phase));
assert(!spdk_nvmf_request_using_zcopy(req));
rc = spdk_bdev_writev_blocks(desc, ch, req->iov, req->iovcnt, start_lba, num_blocks,
nvmf_bdev_ctrlr_complete_cmd, req);