numam-spdk/lib/env_dpdk
Darek Stojaczyk c049304a95 env: add spdk_pci_device_unclaim()
spdk_pci_device_claim() could create a file on the
filesystem that couldn't be deleted programatically.
It could only be overwritten - e.g. by another spdk
instance - but this didn't really work if that
another instance had less privileges and hence no
access to the previous file.

This is exactly the case we're seeing on our CI when
running SPDK as non-root. In general it's a good idea
not to leave any leftover files, so now we'll delete
the pci claim file when the spdk process exits.

spdk_pci_device_claim() used to return a file descriptor
that could be simply closed to "un-claim" the device.
It'll now return only a return code. The fd will be
stored inside spdk_pci_device and will be closed either
when user calls the newly introduced spdk_pci_device_unclaim(),
or when the device is detached.

We'll still need to clean up those files somewhere in
our test scripts (probably ./setup.sh cleanup) to
clean up after crashed processes or so - but we don't
necessarily want to run such scripts inside the autotest
whenever a non-root spdk is about to be started.

Change-Id: I797e079417bb56491013cc5b92f0f0d14f451d18
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467107
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-18 20:34:39 +00:00
..
env_internal.h env/dpdk: add spdk_pci_fini() 2019-03-28 14:50:46 +00:00
env.c env_dpdk: upgrade to C11 atomics 2019-08-05 23:56:32 +00:00
env.mk mk: use the env shared lib when linking apps 2019-08-12 21:12:16 +00:00
init.c env_dpdk: fix compatibility with DPDK 17.11 2019-09-10 17:50:03 +00:00
Makefile lib/env_dpdk: Added VMD PCI driver object 2019-05-29 20:35:11 +00:00
memory.c env_dpdk/memory: aggregate adjacent vfio mappings 2019-08-30 19:41:49 +00:00
pci_ioat.c ioat: add device IDs for new CB-DMA engines 2019-02-26 06:50:52 +00:00
pci_nvme.c pci: remove nvme-specific attach functions 2018-12-07 17:24:19 +00:00
pci_virtio.c pci: remove virtio-specific attach functions 2018-12-07 17:24:19 +00:00
pci_vmd.c lib/env_dpdk: Added VMD PCI driver object 2019-05-29 20:35:11 +00:00
pci.c env: add spdk_pci_device_unclaim() 2019-09-18 20:34:39 +00:00
threads.c env: drop DPDK 16.07 support 2018-11-30 19:59:34 +00:00