+43
−22
+5
−0
Loading
This patch is the first of the patch series to make spdk_nvme_detach() asynchronous. We have lengthy shutdown notification, i.e., we have to wait a long time until shutdown processing is completed, in some SSDs. If the running system has many such SSDs, we see large intolerable delay. SPDK provides a controller option, no_shn_notification as a workaround. We can use the workaround if the use case of the detach is to switch to the next application without system reboot. However, we cannot use the workaround if we want to do system reboot after detach. To mitigate such lengthy shutdown notification, we need to parallelize detachment among SSDs. Hence the patch series will introduce an asynchronous detach API and will use the API to parallelize detachment. This patch adds the following changes. Introduce a context structure and separate nvme_ctrlr_shutdown() itno nvme_ctrlr_shutdown_async() and nvme_ctrlr_shutdown_poll_async() using the context structure. Name the context structure as nvme_ctrlr_detach_ctx because it will be used only in internal APIs. The upcoming public APIs will support multiple detachment and will have the contest structure named as spdk_nvme_detach_ctx. Use TSC instead of counter because polling interval will be controlled by the caller. Use the convenient macro, SPDK_CEIL_DIV(), to round off the time value in milliseconds. Signed-off-by:Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I9e2355fd24b6d6a4d6c1813577d53822304d4f33 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4414 Reviewed-by:
Jacek Kalwas <jacek.kalwas@intel.com> Reviewed-by:
Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by:
Jim Harris <james.r.harris@intel.com> Reviewed-by:
Ben Walker <benjamin.walker@intel.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>