From 113798376d1386d581dc535794c4bff9bc33b312 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 15 Jan 2019 10:35:09 +0900 Subject: [PATCH] nvme_perf: Check completion status for each IO Perf tool had checked status of each NVMe IO command submission but had not checked completion status of each NVMe IO command processing. This patch checks the completion status of each NVMe IO command processing and prints error if found. No error handling is not implemented yet but this addtion will be of any help for subsequent DIF patches. Change-Id: I8da52d97584d7688cff04092efee658556cf7d86 Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/c/439966 Reviewed-by: Changpeng Liu Reviewed-by: wuzhouhui Reviewed-by: Paul Luse Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- examples/nvme/perf/perf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index b60774625..04c4e6f58 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -619,7 +619,7 @@ task_extended_lba_pi_verify(struct ns_entry *entry, struct perf_task *task, } } -static void io_complete(void *ctx, const struct spdk_nvme_cpl *completion); +static void io_complete(void *ctx, const struct spdk_nvme_cpl *cpl); static __thread unsigned int seed = 0; @@ -738,9 +738,17 @@ task_complete(struct perf_task *task) } static void -io_complete(void *ctx, const struct spdk_nvme_cpl *completion) +io_complete(void *ctx, const struct spdk_nvme_cpl *cpl) { - task_complete((struct perf_task *)ctx); + struct perf_task *task = ctx; + + if (spdk_nvme_cpl_is_error(cpl)) { + fprintf(stderr, "%s completed with error (sct=%d, sc=%d)\n", + task->is_read ? "Read" : "Write", + cpl->status.sct, cpl->status.sc); + } + + task_complete(task); } static void