From 7961de43413e7f818f7499bf8518909beb59c82f Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Thu, 26 Dec 2019 22:19:47 +0800 Subject: [PATCH] lib/ioat: Fix the error message when enabling ioat during application shutdown. The printed error message could be the folowing example. Device 0000:00:04.0 is still attached at shutdown! Device 0000:00:04.1 is still attached at shutdown! Device 0000:00:04.2 is still attached at shutdown! Device 0000:00:04.3 is still attached at shutdown! Device 0000:00:04.4 is still attached at shutdown! Device 0000:00:04.5 is still attached at shutdown! Device 0000:00:04.6 is still attached at shutdown! Device 0000:00:04.7 is still attached at shutdown! Device 0000:80:04.0 is still attached at shutdown! Device 0000:80:04.1 is still attached at shutdown! Device 0000:80:04.2 is still attached at shutdown! Device 0000:80:04.3 is still attached at shutdown! Device 0000:80:04.4 is still attached at shutdown! Device 0000:80:04.5 is still attached at shutdown! Device 0000:80:04.6 is still attached at shutdown! Device 0000:80:04.7 is still attached at shutdown! I think this issue exists a long time in our CI pool. And the root cause is: "spdk_pci_device_detach" function is not called in "ioat_channel_destruct". This patch should solve this issue. Change-Id: I47b3f1104a407c5b8390c9389c2f231ae018d16a Signed-off-by: Ziye Yang Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478837 Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker Community-CI: SPDK CI Jenkins Tested-by: SPDK CI Jenkins --- lib/ioat/ioat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ioat/ioat.c b/lib/ioat/ioat.c index a3e9b0bcf..ed7914267 100644 --- a/lib/ioat/ioat.c +++ b/lib/ioat/ioat.c @@ -370,6 +370,8 @@ ioat_channel_destruct(struct spdk_ioat_chan *ioat) spdk_free((void *)ioat->comp_update); ioat->comp_update = NULL; } + + spdk_pci_device_detach(ioat->device); } static int