Commit 15beaa20 authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

nvme: print NVMe command and response when enable nvme log flag



Fix issue #2010.

Change-Id: I9ffc77ddfececce1e6bdac49939d616d9e7bb3c0
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8493


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent bb8102b1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -633,6 +633,7 @@ nvme_pcie_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_trac
	struct nvme_request		*req;
	bool				retry, error;
	bool				req_from_current_proc = true;
	bool				print_error;

	req = tr->req;

@@ -641,9 +642,13 @@ nvme_pcie_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_trac
	error = spdk_nvme_cpl_is_error(cpl);
	retry = error && nvme_completion_is_retry(cpl) &&
		req->retries < pqpair->retry_count;
	print_error = error && print_on_error && !qpair->ctrlr->opts.disable_error_logging;

	if (error && print_on_error && !qpair->ctrlr->opts.disable_error_logging) {
	if (print_error) {
		spdk_nvme_qpair_print_command(qpair, &req->cmd);
	}

	if (print_error || SPDK_DEBUGLOG_FLAG_ENABLED("nvme")) {
		spdk_nvme_qpair_print_completion(qpair, cpl);
	}

+3 −0
Original line number Diff line number Diff line
@@ -936,6 +936,9 @@ _nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *r
	}

	if (spdk_likely(rc == 0)) {
		if (SPDK_DEBUGLOG_FLAG_ENABLED("nvme")) {
			spdk_nvme_print_command(qpair->id, &req->cmd);
		}
		req->queued = false;
		return 0;
	}