DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] i40e igb_uio: reset pci on process exit
@ 2017-05-24 11:22 Gregory Etelson
  2017-05-25 18:42 ` Stephen Hemminger
  0 siblings, 1 reply; 42+ messages in thread
From: Gregory Etelson @ 2017-05-24 11:22 UTC (permalink / raw)
  To: dev; +Cc: Ferruh Yigit, Qi Zhang, Wenzhuo Lu

Hello,

My tests show 
if DPDK process attached to i40e VF through igb_uio 
exists without calling rte_eth_dev_close() 
then new instance attached to that VF could experience IO failures.
I came up with the following patch to ensure igb_uio will always reset PCI on process exit.
However, I would like to hear experts opinion to be sure __pci_reset_function
resets i40e VF properly.

Thank you.
Regards,
Gregory 


diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index b9d427c..7d7ff9d 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -170,6 +170,19 @@ struct rte_uio_pci_dev {
        return IRQ_HANDLED;
 }
 
+static int
+igbuio_pci_release(struct uio_info *info, struct inode *inode)
+{
+       int ret;
+       struct rte_uio_pci_dev *udev = info->priv;
+       struct pci_dev *dev = udev->pdev;
+       ret = __pci_reset_function(dev);
+       dev_info(&dev->dev, "pci_reset_function %s \n",
+                 ret == 0 ? "succeded" : "failed");
+       return 0;
+}
+
+
 #ifdef CONFIG_XEN_DOM0
 static int
 igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma)
@@ -372,6 +385,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())

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2017-07-20 22:36 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24 11:22 [dpdk-dev] i40e igb_uio: reset pci on process exit Gregory Etelson
2017-05-25 18:42 ` Stephen Hemminger
2017-05-26  4:30   ` Gregory Etelson
2017-05-26  6:05     ` Shijith Thotton
2017-05-26  6:17       ` Gregory Etelson
2017-05-26 15:53         ` Stephen Hemminger
2017-05-26 16:14           ` Gregory Etelson
2017-05-29  9:48             ` Shijith Thotton
2017-05-29 10:01               ` Gregory Etelson
2017-05-29 11:01                 ` Shijith Thotton
2017-05-29 11:21                   ` Gregory Etelson
2017-05-31 11:09                     ` [dpdk-dev] [RFC PATCH] igb_uio: issue FLR during open and release of device file Shijith Thotton
2017-05-31 12:20                       ` Ferruh Yigit
2017-05-31 15:30                         ` Stephen Hemminger
2017-05-31 17:11                           ` Ferruh Yigit
2017-06-01 11:35                             ` Shijith Thotton
2017-06-01 11:14                         ` Gregory Etelson
2017-06-04  7:22                         ` Gregory Etelson
2017-06-05  2:29                           ` Tan, Jianfeng
2017-06-05  5:57                             ` Gregory Etelson
2017-05-31 15:29                       ` Stephen Hemminger
2017-06-12  9:38                       ` [dpdk-dev] [PATCH] " Shijith Thotton
2017-07-05 23:42                         ` Thomas Monjalon
2017-07-06 16:41                         ` Ferruh Yigit
2017-07-06 17:27                           ` Gregory Etelson
2017-07-07 10:03                             ` Shijith Thotton
2017-07-07 10:16                               ` Ferruh Yigit
2017-07-07 11:13                         ` [dpdk-dev] [PATCH v2] " Shijith Thotton
2017-07-07 15:10                           ` Ferruh Yigit
2017-07-10  3:07                             ` Gregory Etelson
2017-07-11  5:42                               ` Gregory Etelson
2017-07-11 11:36                                 ` Gregory Etelson
2017-07-10  3:38                           ` Tan, Jianfeng
2017-07-10  7:10                             ` Shijith Thotton
2017-07-10  9:00                               ` Tan, Jianfeng
2017-07-10 10:42                                 ` Shijith Thotton
2017-07-12  3:37                                   ` Tan, Jianfeng
2017-07-12  3:40                           ` Tan, Jianfeng
2017-07-16  4:22                             ` Gregory Etelson
2017-07-19 13:32                             ` Ferruh Yigit
2017-07-19 16:19                               ` Gregory Etelson
2017-07-20 22:36                                 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).