From 00c9dd58797ef2bdc3c86e6d809ad4811d878d7b Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Tue, 11 May 2021 21:14:33 +0800 Subject: [PATCH] accel_engine/ioat: If no ioat devices found, we should return. If no ioat devices are registered, we should return. Change-Id: I03435946716ef653b230515da32e8ccbdf5a188a Signed-off-by: Ziye Yang Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7834 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- module/accel/ioat/accel_engine_ioat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/accel/ioat/accel_engine_ioat.c b/module/accel/ioat/accel_engine_ioat.c index 8d46dde27c..2e50159c0b 100644 --- a/module/accel/ioat/accel_engine_ioat.c +++ b/module/accel/ioat/accel_engine_ioat.c @@ -280,6 +280,11 @@ accel_engine_ioat_init(void) return -1; } + if (TAILQ_EMPTY(&g_devices)) { + SPDK_NOTICELOG("No available ioat devices\n"); + return -1; + } + g_ioat_initialized = true; SPDK_NOTICELOG("Accel engine updated to use IOAT engine.\n"); spdk_accel_hw_engine_register(&ioat_accel_engine);