Spdk/test/unit/lib/nvme
Jim Harris 32bff28a25 nvme: use spdk_pci_device_claim() in nvme_pcie_ctrlr_construct
spdk_pci_device_claim() can be used to ensure only one process
at a time uses any given PCI device.  Previously this was only
used in the bdev_nvme driver - other apps like nvme/perf do
not use spdk_pci_device_claim() and could effectively rip out
the device from a running bdev-based app like the NVMe-oF target.

So instead of modifying all of the nvme apps, put this logic into
the core nvme driver instead so that all applications get the
benefit transparently.  Save the fd when the controller is constructed
and then close it when the controller is destructed to handle the
detach (including hotplug) cases.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5dc48a2e41dc06707800f15a9e1f9141477628c6

Reviewed-on: https://review.gerrithub.io/385524
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-03 18:48:33 -04:00
..
nvme_ctrlr_cmd.c nvme: support meta data on vendor specific commands 2017-09-12 16:14:11 -04:00
nvme_ctrlr.c nvme: add a public API to rename spdk_nvme_ctrlr_opts_set_defaults 2017-10-09 12:31:12 -04:00
nvme_ns_cmd.c nvme: add new spdk_nvme_connect() API to directly attach the ctrlr 2017-10-09 12:31:12 -04:00
nvme_ns.c nvme: add support for NS Optimal IO Boundary 2017-08-16 15:55:29 -04:00
nvme_pcie.c nvme: use spdk_pci_device_claim() in nvme_pcie_ctrlr_construct 2017-11-03 18:48:33 -04:00
nvme_qpair.c test: move NVMe library tests to test/unit 2017-06-21 16:51:12 -04:00
nvme_quirks.c test: move NVMe library tests to test/unit 2017-06-21 16:51:12 -04:00
nvme.c ut/nvme: clean up mutex and mutexattr 2017-10-17 11:34:38 -04:00
Makefile test: move NVMe library tests to test/unit 2017-06-21 16:51:12 -04:00