summaryrefslogtreecommitdiff
path: root/drivers/bus/pci/private.h
diff options
context:
space:
mode:
authorJeff Guo <jia.guo@intel.com>2018-10-15 19:27:22 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-10-15 22:16:48 +0200
commitb01dc3da88454cf8bb3f7a364595c94c137f2463 (patch)
tree19b71e526b3696f372bc0a75258a474d128005f0 /drivers/bus/pci/private.h
parenta8a279da63d1dde2e66b3fdb47a80bb96c3dd98c (diff)
downloaddpdk-b01dc3da88454cf8bb3f7a364595c94c137f2463.zip
dpdk-b01dc3da88454cf8bb3f7a364595c94c137f2463.tar.gz
dpdk-b01dc3da88454cf8bb3f7a364595c94c137f2463.tar.xz
bus/pci: support hot-unplug handler
This patch implements the ops to handle hot-unplug on the PCI bus. For UIO PCI, it could avoids BARs read/write errors by creating a new dummy memory to remap the memory where the failure is. For VFIO or other kernel driver, it could specific implement function to handle hot-unplug case by case. Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Shaopeng He <shaopeng.he@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'drivers/bus/pci/private.h')
-rw-r--r--drivers/bus/pci/private.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h
index 04bffa6..13c3324 100644
--- a/drivers/bus/pci/private.h
+++ b/drivers/bus/pci/private.h
@@ -127,6 +127,18 @@ void pci_uio_free_resource(struct rte_pci_device *dev,
struct mapped_pci_resource *uio_res);
/**
+ * Remap the PCI resource of a PCI device in anonymous virtual memory.
+ *
+ * @param dev
+ * Point to the struct rte pci device.
+ * @return
+ * - On success, zero.
+ * - On failure, a negative value.
+ */
+int
+pci_uio_remap_resource(struct rte_pci_device *dev);
+
+/**
* Map device memory to uio resource
*
* This function is private to EAL.