blob: f15e4aab8da7b9f2a70e7c7022f31f3cc80a035b [file] [log] [blame]
Todd Foggoa1d8dd702016-02-05 11:38:25 -05001From 68d23609ec0c42773043383ff2939a30830e8069 Mon Sep 17 00:00:00 2001
2From: Bud Grise <griseb@cisco.com>
3Date: Tue, 2 Feb 2016 12:45:44 -0800
4Subject: [PATCH 6/8] Fix a crash in igb_uio driver when the device is removed.
5
6This crash happens because the device still has MSI configured,
7the fix is to free the IRQ.
8
9Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
10---
11 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 6 ++++++
12 1 file changed, 6 insertions(+)
13
14diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
15index f5617d2..23a5cfa 100644
16--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
17+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
18@@ -571,6 +571,12 @@ igbuio_pci_remove(struct pci_dev *dev)
19 udev = info->priv;
20
21 sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp);
22+
23+ if (info->irq && (info->irq != UIO_IRQ_CUSTOM)){
24+ free_irq(info->irq, info->uio_dev);
25+ info->irq = UIO_IRQ_NONE;
26+ }
27+
28 uio_unregister_device(info);
29 igbuio_pci_release_iomem(info);
30 if (udev->mode == RTE_INTR_MODE_MSIX)
31--
322.2.1
33