Spdk/lib/nvme
Darek Stojaczyk 81523d9dd2 env/dpdk: register VFIO hotremove callback
This is an attempt to fix device hotremove with VFIO.

A soft device hotremove request through sysfs [1] would
currently just block until the SPDK process manually
releases that device - e.g. upon an RPC request.

VFIO won't get unbound from the device untill userspace
releases all its resources. VFIO can signal a pending
hotremove request by kicking any file descriptor provided
by the userspace - and DPDK does provide such descriptor -
but SPDK does not listen on it.

DPDK does offer handy API to listen and in this patch
we make use of it inside our env/pci layer. Within
a DPDK callback we set an internal per-device hotremove
flag, which upper-layer SPDK drivers can poll with a new
env API - spdk_pci_device_is_removed().

The VFIO hotremove event will be sent to primary
processes only, so that's where we listen.

We make use of this new API in the NVMe hotplug poller,
which will process it just like any other supported
hotremove event.

Fixes #595
Fixes #690

[1] # echo 1 > /sys/bus/pci/devices/<bdf>/remove

Change-Id: I03d88271c2089c740e232056d9340e5a640d442c
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448927
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-18 22:49:30 +00:00
..
Makefile Opal: Add Opal library 2019-04-08 17:04:25 +00:00
nvme_ctrlr_cmd.c nvme: Cache the cb_fn and cb_arg in the tracker 2019-04-10 21:29:03 +00:00
nvme_ctrlr_ocssd_cmd.c ocssd: hold lock when calling nvme_ctrlr_submit_admin_request 2019-02-15 21:27:58 +00:00
nvme_ctrlr.c nvme: remove set_state after nvme_ctrlr_identify_id_desc_namespaces 2019-04-01 09:09:07 +00:00
nvme_fabric.c nvme: introduce probe context data structure and API 2019-02-15 03:14:20 +00:00
nvme_internal.h nvme: Cache the cb_fn and cb_arg in the tracker 2019-04-10 21:29:03 +00:00
nvme_ns_cmd.c nvme: Cache the cb_fn and cb_arg in the tracker 2019-04-10 21:29:03 +00:00
nvme_ns_ocssd_cmd.c vtophys: add length parameter to the vtophys function 2019-01-09 08:24:59 +00:00
nvme_ns.c nvme: make identify NS id descriptors can be executed asynchronously 2018-10-15 17:57:56 +00:00
nvme_opal_internal.h opal: add response parsing functions 2019-04-17 17:34:27 +00:00
nvme_opal.c opal: add response parsing functions 2019-04-17 17:34:27 +00:00
nvme_pcie.c env/dpdk: register VFIO hotremove callback 2019-04-18 22:49:30 +00:00
nvme_qpair.c nvme: Cache the cb_fn and cb_arg in the tracker 2019-04-10 21:29:03 +00:00
nvme_quirks.c nvme: add SHST_COMPLETE quirk for VMWare emulated SSDs 2019-02-27 01:46:32 +00:00
nvme_rdma.c nvme: Cache the cb_fn and cb_arg in the tracker 2019-04-10 21:29:03 +00:00
nvme_tcp.c nvme: Cache the cb_fn and cb_arg in the tracker 2019-04-10 21:29:03 +00:00
nvme_transport.c nvme: introduce probe context data structure and API 2019-02-15 03:14:20 +00:00
nvme_uevent.c util: add spdk_strerror() wrapper with TLS support 2018-01-04 15:00:09 -05:00
nvme_uevent.h nvme: Add support of hotplug for vfio-attached devices. 2017-12-06 17:04:49 -05:00
nvme.c nvme: don't rely on phys_addr retrieved from spdk_malloc() 2019-03-20 01:06:09 +00:00