As we may know that the process of hotplug is different between igb_uio and vfio. For igb_uio, it could use uevent notification and memory failure handle mechanism for hotplug. But for vfio, when device is be hotplug-out, the uevent can not be detected immediately, because of the vfio kernel module will use a special mechanism to guaranty the pci device would not be deleted until the user space release the resources, so it will use another event “req notifier” at first to notify user space to release resources for hotplug.
This patch will add a new interrupt type of req notifier in eal interrupt, and add the new interrupt handler in pci device to handle the req device event. When the req notifier be detected, it can trigger the device event callback process to process for hotplug. With this mechanism, hotplug could be enable in vfio. Jeff Guo (5): eal: add a new req notifier to eal interrupt eal: add a new req event to device event eal: modify device event callback process func pci: add req handler field to generic pci device vfio: enable vfio hotplug by req notifier handler drivers/bus/pci/linux/pci_vfio.c | 104 +++++++++++++++++++++ drivers/bus/pci/pci_common.c | 10 ++ drivers/bus/pci/rte_bus_pci.h | 1 + lib/librte_eal/common/eal_common_dev.c | 5 +- lib/librte_eal/common/eal_private.h | 12 --- lib/librte_eal/common/include/rte_dev.h | 20 +++- lib/librte_eal/common/include/rte_eal_interrupts.h | 1 + lib/librte_eal/linuxapp/eal/eal_dev.c | 2 +- lib/librte_eal/linuxapp/eal/eal_interrupts.c | 71 ++++++++++++++ lib/librte_ethdev/rte_ethdev.c | 3 +- 10 files changed, 212 insertions(+), 17 deletions(-) -- 2.7.4