nvme: print NVMe command and response when enable nvme log flag
Fix issue #2010. Change-Id: I9ffc77ddfececce1e6bdac49939d616d9e7bb3c0 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8493 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
bb8102b1ff
commit
15beaa20bf
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user