igb_uio: reset PCI function on process exit
PATCH 1/1 igb_uio: reset PCI function on process exit
re-bind PCI function to igb_uio
after process termination
tested adapters: Intel 10G, Intel 40G
known issues: ENA adapters on AWS I3 instances fail to reset PCI function
Signed-off-by Gregory Etelson <[email protected]>
--- lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +12 -0
@@ -317,6 +317,17 @@ struct rte_uio_pci_dev {return (iom !=0 || iop !=0 ) ? ret : -ENOENT ; } +static int +igbuio_pci_release (struct uio_info *info,struct inode *inode) +{ +struct rte_uio_pci_dev *udev = info->priv; +struct pci_dev *dev = udev->pdev; + +int ret =__pci_reset_function (dev); +dev_info (&udev->pdev->dev,"PCI reset %s\n" , !ret ?"done" :"failed" ); +return 0 ; +} +#if LINUX_VERSION_CODE <KERNEL_VERSION (3 ,8 ,0 ) static int __devinit#else
@@ -372,6 +383,7 @@ struct rte_uio_pci_dev { udev->info.version ="0.1" ; udev->info.handler = igbuio_pci_irqhandler; udev->info.irqcontrol = igbuio_pci_irqcontrol; + udev->info.release = igbuio_pci_release;#ifdef CONFIG_XEN_DOM0 /* check if the driver run on Xen Dom0 */ if (xen_initial_domain ())
Signature · 1 line
1.7.1
Quoted 6 lines · Gregory Etelson
re-bind PCI function to
igb_uio
after process termination
tested adapters: Intel 10G, Intel 40G
known issues: ENA adapters on AWS I3 instances fail to reset PCI functionSigned-off-by Gregory Etelson <[email protected]>
Shijith's patch [1] applied in 17.08 superseded this patch, updating it in patchwork.
[1]
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")