From e8e2b469ecfce7c7f5b0f707165fd04e15e4365c Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 30 Jun 2021 20:18:49 +0000 Subject: [PATCH] nvme: use spdk_strerror to report CQ transport errors Signed-off-by: Jim Harris Change-Id: I910c5a63e1f35fa76dfb7c296361fb1af7209e6b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8569 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker --- lib/nvme/nvme_qpair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nvme/nvme_qpair.c b/lib/nvme/nvme_qpair.c index d4e9b03464..87c233e501 100644 --- a/lib/nvme/nvme_qpair.c +++ b/lib/nvme/nvme_qpair.c @@ -33,6 +33,7 @@ #include "nvme_internal.h" #include "spdk/nvme_ocssd.h" +#include "spdk/string.h" #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; ret = nvme_transport_qpair_process_completions(qpair, max_completions); 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)) { nvme_ctrlr_fail(qpair->ctrlr, false); }