From 3979c15f6620a4e2c06864dc69bbed62d03be97a Mon Sep 17 00:00:00 2001 From: Cunyin Chang Date: Fri, 10 Mar 2017 11:42:41 +0800 Subject: [PATCH] doc: Add initial documentation for nvme hotplug. Change-Id: I67303d07aee931d19b3a9ae1e618d22fc6de9f58 Signed-off-by: Cunyin Chang --- doc/Doxyfile | 1 + doc/nvme/hotplug.md | 19 +++++++++++++++++++ doc/nvme/index.md | 1 + 3 files changed, 21 insertions(+) create mode 100644 doc/nvme/hotplug.md diff --git a/doc/Doxyfile b/doc/Doxyfile index 056605917..a09a856a2 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -772,6 +772,7 @@ INPUT = ../include/spdk \ nvme/async_completion.md \ nvme/fabrics.md \ nvme/initialization.md \ + nvme/hotplug.md \ nvme/io_submission.md \ nvme/multi_process.md \ nvmf/index.md \ diff --git a/doc/nvme/hotplug.md b/doc/nvme/hotplug.md new file mode 100644 index 000000000..7a6496503 --- /dev/null +++ b/doc/nvme/hotplug.md @@ -0,0 +1,19 @@ +# NVMe Hotplug {#nvme_hotplug} + +At the NVMe driver level, we provide the following support for Hotplug: + +1. Hotplug events detection: +The user of the NVMe library can call spdk_nvme_probe() periodically to detect +hotplug events. The probe_cb, followed by the attach_cb, will be called for each +new device detected. The user may optionally also provide a remove_cb that will be +called if a previously attached NVMe device is no longer present on the system. +All subsequent I/O to the removed device will return an error. + +2. Hot remove NVMe with IO loads: +When a device is hot removed while I/O is occurring, all access to the PCI BAR will +result in a SIGBUS error. The NVMe driver automatically handles this case by installing +a SIGBUS handler and remapping the PCI BAR to a new, placeholder memory location. +This means I/O in flight during a hot remove will complete with an appropriate error +code and will not crash the application. + +@sa spdk_nvme_probe diff --git a/doc/nvme/index.md b/doc/nvme/index.md index f94a35159..d8c422c96 100644 --- a/doc/nvme/index.md +++ b/doc/nvme/index.md @@ -24,3 +24,4 @@ spdk_nvme_ctrlr_process_admin_completions() | @copybrief spdk_nvme_ctrlr_process - @ref nvme_async_completion - @ref nvme_fabrics_host - @ref nvme_multi_process +- @ref nvme_hotplug