nvme: use spdk_strerror to report CQ transport errors

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I910c5a63e1f35fa76dfb7c296361fb1af7209e6b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8569
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2021-06-30 20:18:49 +00:00 committed by Tomasz Zawadzki
parent 01bbf5d183
commit e8e2b469ec

View File

@ -33,6 +33,7 @@
#include "nvme_internal.h" #include "nvme_internal.h"
#include "spdk/nvme_ocssd.h" #include "spdk/nvme_ocssd.h"
#include "spdk/string.h"
#define NVME_CMD_DPTR_STR_SIZE 256 #define NVME_CMD_DPTR_STR_SIZE 256
@ -716,7 +717,7 @@ spdk_nvme_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
qpair->in_completion_context = 1; qpair->in_completion_context = 1;
ret = nvme_transport_qpair_process_completions(qpair, max_completions); ret = nvme_transport_qpair_process_completions(qpair, max_completions);
if (ret < 0) { if (ret < 0) {
SPDK_ERRLOG("CQ transport error %d on qpair id %hu\n", ret, qpair->id); SPDK_ERRLOG("CQ transport error %d (%s) on qpair id %hu\n", ret, spdk_strerror(-ret), qpair->id);
if (nvme_qpair_is_admin_queue(qpair)) { if (nvme_qpair_is_admin_queue(qpair)) {
nvme_ctrlr_fail(qpair->ctrlr, false); nvme_ctrlr_fail(qpair->ctrlr, false);
} }