Spdk/test/nvme
Darek Stojaczyk 814072fa4e env_dpdk/pci: delay device initialization on hotplug
A workaround for kernel deadlocks surfaced in #1275.

DPDK basically offers two APIs for hotplugging all PCI devices:
rte_bus_scan() and rte_bus_probe(). Scan iterates through
/sys/bus/pci/devices/* and creates corresponding rte_pci_device-s,
then rte_bus_probe() tries to initialize each device with the
supporting driver.

Previously we did scan and probe together, one after another, now
we'll have an intermediate step. After scanning the bus, we'll
iterate through all rte_pci_device-s and temporarily blacklist any
newly detected devices. We'll use devargs->data field to a store
a timeout value (integer) after which the device can be un-blacklisted
and initialized. devargs->data is documented in DPDK as "Device
string storage" and it's a char*, but it's not referenced anywhere
in DPDK. rte_bus_probe() respects the blacklist and doesn't do
absolutely anything with blacklisted ones.

The timeout value is 2 seconds, which should be plenty enough
for an NVMe device to reset, leave the critical lock sections in
kernel, and let us initialize it safely.

Note that direct attach by BDF doesn't respect the blacklist,
so an NVMe attach RPC won't be delayed in any way, it will continue
to work as it always did. Only the automatic discovery & enumeration
is deferred.

Change-Id: I62b719271bd0755bc2882331ea33f69897b1e5e5
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1733
Community-CI: Mellanox Build Bot
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>
2020-07-23 20:48:47 +00:00
..
aer lib/nvme: add spdk_nvme_transport_available_by_name 2020-01-16 09:10:38 +00:00
cuse test/cuse: wait for device after reset 2020-07-08 07:55:33 +00:00
deallocated_value test/nvme/deallocated_value: switch to spdk_*malloc(). 2019-07-05 03:48:51 +00:00
e2edp test/nvme_dp: return failure correctly when test it in CI 2020-06-12 15:40:22 +00:00
err_injection nvme: replace cdw10 with specific union command 2019-12-06 14:43:41 +00:00
overhead test/nvme: Increment current_queue_depth only if I/O submission succeeded 2020-05-29 14:58:30 +00:00
perf test/nvme_perf: move getopts to main script 2020-07-23 07:28:53 +00:00
reserve test/nvme_reserve: set host identifier at runtime 2020-06-15 15:27:50 +00:00
reset test/nvme: Increment current_queue_depth only if I/O submission succeeded 2020-05-29 14:58:30 +00:00
sgl test/nvme/sgl: switch to spdk_*malloc(). 2019-07-16 10:51:47 +00:00
startup test/nvme: Add nvme startup tool. 2019-10-23 17:03:56 +00:00
hotplug.sh env_dpdk/pci: delay device initialization on hotplug 2020-07-23 20:48:47 +00:00
hw_hotplug.sh hw_hotplug: Fix HW hotplug test 2020-07-21 09:23:09 +00:00
Makefile test/nvme: dynamic nvme cuse devices update test 2020-06-05 09:01:44 +00:00
nvme_opal.sh test/nvme: enable OPAL test 2020-07-16 07:30:36 +00:00
nvme_rpc.sh build: Output executables from the app directory to build/bin 2020-06-15 15:27:16 +00:00
nvme.sh test/nvme.sh: rewrite nvme_fio test to find namespaces using identify 2020-06-18 07:27:51 +00:00
spdk_nvme_cli.sh test/common: move nvme-cli compilation to common script 2020-07-06 23:22:59 +00:00