[dpdk-dev] [PATCH V8 2/3] igb_uio: fix device removal issuse for hotplug

Jeff Guo jia.guo at intel.com
Wed Jan 10 04:30:36 CET 2018


when the hot plug out of the device, the uio resource have been
invalid, so to avoid the system hung, no need to do the invalid
operation in igb_uio pci release function.

Signed-off-by: Jeff Guo <jia.guo at intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index a3a98c1..d0e07b4 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -354,6 +354,12 @@ igbuio_pci_release(struct uio_info *info, struct inode *inode)
 	struct rte_uio_pci_dev *udev = info->priv;
 	struct pci_dev *dev = udev->pdev;
 
+	/* check if device have been remove before release */
+	if ((&dev->dev.kobj)->state_remove_uevent_sent == 1) {
+		pr_info("The device have been removed\n");
+		return -1;
+	}
+
 	/* disable interrupts */
 	igbuio_pci_disable_interrupts(udev);
 
-- 
2.7.4



More information about the dev mailing list