Commit 594ccf5a authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

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: default avatarKonrad 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: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent aa1d0398
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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.
 *
+2 −2
Original line number Diff line number Diff line
@@ -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;
		}
+2 −2
Original line number Diff line number Diff line
@@ -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);