[dpdk-stable] patch 'igb_uio: issue FLR during open and release of device file' has been queued to LTS release 16.11.9

Luca Boccassi bluca at debian.org
Thu Nov 8 19:01:10 CET 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/10/18. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Luca Boccassi

---
>From 11bb826270d6feb3e810aec77a9252cf65b559a9 Mon Sep 17 00:00:00 2001
From: Shijith Thotton <shijith.thotton at caviumnetworks.com>
Date: Fri, 7 Jul 2017 16:43:51 +0530
Subject: [PATCH] igb_uio: issue FLR during open and release of device file

[ upstream commit b58eedfc7dd57eef6d12e2c654a52c834f36084a ]

Set UIO info device file operations open and release. Call pci reset
function inside open and release to clear device state at start and end.
Copied this behaviour from vfio_pci kernel module code. With this patch,
it is not mandatory to issue FLR by PMD's during init and close.

Bus master enable and disable are added in open and release respectively
to take care of device DMA.

Signed-off-by: Shijith Thotton <shijith.thotton at caviumnetworks.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan at intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Gregory Etelson <gregory at weka.io>
---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 33 +++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index 9f00f07ab..4be89ef86 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -170,6 +170,37 @@ igbuio_pci_irqhandler(int irq, struct uio_info *info)
 	return IRQ_HANDLED;
 }
 
+/**
+ * This gets called while opening uio device file.
+ */
+static int
+igbuio_pci_open(struct uio_info *info, struct inode *inode)
+{
+	struct rte_uio_pci_dev *udev = info->priv;
+	struct pci_dev *dev = udev->pdev;
+
+	pci_reset_function(dev);
+
+	/* set bus master, which was cleared by the reset function */
+	pci_set_master(dev);
+
+	return 0;
+}
+
+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;
+
+	/* stop the device from further DMA */
+	pci_clear_master(dev);
+
+	pci_reset_function(dev);
+
+	return 0;
+}
+
 #ifdef CONFIG_XEN_DOM0
 static int
 igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma)
@@ -370,6 +401,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	udev->info.version = "0.1";
 	udev->info.handler = igbuio_pci_irqhandler;
 	udev->info.irqcontrol = igbuio_pci_irqcontrol;
+	udev->info.open = igbuio_pci_open;
+	udev->info.release = igbuio_pci_release;
 #ifdef CONFIG_XEN_DOM0
 	/* check if the driver run on Xen Dom0 */
 	if (xen_initial_domain())
-- 
2.19.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-08 17:59:30.319286385 +0000
+++ 0014-igb_uio-issue-FLR-during-open-and-release-of-device-.patch	2018-11-08 17:59:30.064751011 +0000
@@ -1,8 +1,10 @@
-From b58eedfc7dd57eef6d12e2c654a52c834f36084a Mon Sep 17 00:00:00 2001
+From 11bb826270d6feb3e810aec77a9252cf65b559a9 Mon Sep 17 00:00:00 2001
 From: Shijith Thotton <shijith.thotton at caviumnetworks.com>
 Date: Fri, 7 Jul 2017 16:43:51 +0530
 Subject: [PATCH] igb_uio: issue FLR during open and release of device file
 
+[ upstream commit b58eedfc7dd57eef6d12e2c654a52c834f36084a ]
+
 Set UIO info device file operations open and release. Call pci reset
 function inside open and release to clear device state at start and end.
 Copied this behaviour from vfio_pci kernel module code. With this patch,
@@ -20,7 +22,7 @@
  1 file changed, 33 insertions(+)
 
 diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
-index b9d427c51..07a19a315 100644
+index 9f00f07ab..4be89ef86 100644
 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
 +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
 @@ -170,6 +170,37 @@ igbuio_pci_irqhandler(int irq, struct uio_info *info)
@@ -61,7 +63,7 @@
  #ifdef CONFIG_XEN_DOM0
  static int
  igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma)
-@@ -372,6 +403,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+@@ -370,6 +401,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
  	udev->info.version = "0.1";
  	udev->info.handler = igbuio_pci_irqhandler;
  	udev->info.irqcontrol = igbuio_pci_irqcontrol;


More information about the stable mailing list