Skip to contentSkip to conversation

igb_uio: revert open and release operations

PATCH In review Ferruh Yigit 9 participants 35 messages Oct 17, 2017 – Nov 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igb_uio: revert open and release operations

This reverts commit 6b9ed026a8704b9e5ee5da7997617ef7cc82e114. This reverts commit 5f6ff30dc5075c49069d684bab229aef7ff0fdc3. This reverts commit b58eedfc7dd57eef6d12e2c654a52c834f36084a.

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

Cc Jianfeng Tan <[email protected]>
Cc Jingjing Wu <[email protected]>
Cc Shijith Thotton <[email protected]>
Cc Gregory Etelson <[email protected]>
Cc Harish Patil <[email protected]>
Cc George Prekas <[email protected]>
Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Thanks everyone who spent effort for this, hopefully we can continue to work on next release cycle.

Jingjing, there is a i40e commit, was part of igb_uio fix patchset, is it generic, or needs to be reverted with this patch?
Commit: 8cacf78469a7 ("net/i40e: fix VF initialization error")

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 201 +++++++++++-------------------
 1 file changed, 76 insertions(+), 125 deletions(-)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +76 -125
index f7ef82554..786df68a2 100644
@@ -49,6 +49,7 @@ struct rte_uio_pci_dev {
 
 static char *intr_mode;
 static enum rte_intr_mode igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX;
+
 /* sriov sysfs */
 static ssize_t
 show_max_vfs(struct device *dev, struct device_attribute *attr,
@@ -207,22 +208,80 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state)
  * If yes, disable it here and will be enable later.
  */
 static irqreturn_t
-igbuio_pci_irqhandler(int irq, void *dev_id)
+igbuio_pci_irqhandler(int irq, struct uio_info *info)
 {
-	struct rte_uio_pci_dev *udev = (struct rte_uio_pci_dev *)dev_id;
-	struct uio_info *info = &udev->info;
+	struct rte_uio_pci_dev *udev = info->priv;
 
 	/* Legacy mode need to mask in hardware */
 	if (udev->mode == RTE_INTR_MODE_LEGACY &&
 	    !pci_check_and_mask_intx(udev->pdev))
 		return IRQ_NONE;
 
-	uio_event_notify(info);
-
 	/* Message signal mode, no share IRQ and automasked */
 	return IRQ_HANDLED;
 }
 
+/* Remap pci resources described by bar #pci_bar in uio resource n. */
+static int
+igbuio_pci_setup_iomem(struct pci_dev *dev, struct uio_info *info,
+		       int n, int pci_bar, const char *name)
+{
+	unsigned long addr, len;
+	void *internal_addr;
+
+	if (n >= ARRAY_SIZE(info->mem))
+		return -EINVAL;
+
+	addr = pci_resource_start(dev, pci_bar);
+	len = pci_resource_len(dev, pci_bar);
+	if (addr == 0 || len == 0)
+		return -1;
+	internal_addr = ioremap(addr, len);
+	if (internal_addr == NULL)
+		return -1;
+	info->mem[n].name = name;
+	info->mem[n].addr = addr;
+	info->mem[n].internal_addr = internal_addr;
+	info->mem[n].size = len;
+	info->mem[n].memtype = UIO_MEM_PHYS;
+	return 0;
+}
+
+/* Get pci port io resources described by bar #pci_bar in uio resource n. */
+static int
+igbuio_pci_setup_ioport(struct pci_dev *dev, struct uio_info *info,
+		int n, int pci_bar, const char *name)
+{
+	unsigned long addr, len;
+
+	if (n >= ARRAY_SIZE(info->port))
+		return -EINVAL;
+
+	addr = pci_resource_start(dev, pci_bar);
+	len = pci_resource_len(dev, pci_bar);
+	if (addr == 0 || len == 0)
+		return -EINVAL;
+
+	info->port[n].name = name;
+	info->port[n].start = addr;
+	info->port[n].size = len;
+	info->port[n].porttype = UIO_PORT_X86;
+
+	return 0;
+}
+
+/* Unmap previously ioremap'd resources */
+static void
+igbuio_pci_release_iomem(struct uio_info *info)
+{
+	int i;
+
+	for (i = 0; i < MAX_UIO_MAPS; i++) {
+		if (info->mem[i].internal_addr)
+			iounmap(info->mem[i].internal_addr);
+	}
+}
+
 static int
 igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 {
@@ -252,7 +311,6 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 			break;
 		}
 #endif
-
 	/* fall back to MSI */
 	case RTE_INTR_MODE_MSI:
 #ifndef HAVE_ALLOC_IRQ_VECTORS
@@ -291,28 +349,15 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 	default:
 		dev_err(&udev->pdev->dev, "invalid IRQ mode %u",
 			igbuio_intr_mode_preferred);
-		udev->info.irq = UIO_IRQ_NONE;
 		err = -EINVAL;
 	}
 
-	if (udev->info.irq != UIO_IRQ_NONE)
-		err = request_irq(udev->info.irq, igbuio_pci_irqhandler,
-				  udev->info.irq_flags, udev->info.name,
-				  udev);
-	dev_info(&udev->pdev->dev, "uio device registered with irq %lx\n",
-		 udev->info.irq);
-
 	return err;
 }
 
 static void
 igbuio_pci_disable_interrupts(struct rte_uio_pci_dev *udev)
 {
-	if (udev->info.irq) {
-		free_irq(udev->info.irq, udev);
-		udev->info.irq = 0;
-	}
-
 #ifndef HAVE_ALLOC_IRQ_VECTORS
 	if (udev->mode == RTE_INTR_MODE_MSIX)
 		pci_disable_msix(udev->pdev);
@@ -325,109 +370,6 @@ igbuio_pci_disable_interrupts(struct rte_uio_pci_dev *udev)
 #endif
 }
 
-
-/**
- * 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;
-	int err;
-
-	pci_reset_function(dev);
-
-	/* set bus master, which was cleared by the reset function */
-	pci_set_master(dev);
-
-	/* enable interrupts */
-	err = igbuio_pci_enable_interrupts(udev);
-	if (err) {
-		dev_err(&dev->dev, "Enable interrupt fails\n");
-		return err;
-	}
-	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;
-
-	/* disable interrupts */
-	igbuio_pci_disable_interrupts(udev);
-
-	/* stop the device from further DMA */
-	pci_clear_master(dev);
-
-	pci_reset_function(dev);
-
-	return 0;
-}
-
-/* Remap pci resources described by bar #pci_bar in uio resource n. */
-static int
-igbuio_pci_setup_iomem(struct pci_dev *dev, struct uio_info *info,
-		       int n, int pci_bar, const char *name)
-{
-	unsigned long addr, len;
-	void *internal_addr;
-
-	if (n >= ARRAY_SIZE(info->mem))
-		return -EINVAL;
-
-	addr = pci_resource_start(dev, pci_bar);
-	len = pci_resource_len(dev, pci_bar);
-	if (addr == 0 || len == 0)
-		return -1;
-	internal_addr = ioremap(addr, len);
-	if (internal_addr == NULL)
-		return -1;
-	info->mem[n].name = name;
-	info->mem[n].addr = addr;
-	info->mem[n].internal_addr = internal_addr;
-	info->mem[n].size = len;
-	info->mem[n].memtype = UIO_MEM_PHYS;
-	return 0;
-}
-
-/* Get pci port io resources described by bar #pci_bar in uio resource n. */
-static int
-igbuio_pci_setup_ioport(struct pci_dev *dev, struct uio_info *info,
-		int n, int pci_bar, const char *name)
-{
-	unsigned long addr, len;
-
-	if (n >= ARRAY_SIZE(info->port))
-		return -EINVAL;
-
-	addr = pci_resource_start(dev, pci_bar);
-	len = pci_resource_len(dev, pci_bar);
-	if (addr == 0 || len == 0)
-		return -EINVAL;
-
-	info->port[n].name = name;
-	info->port[n].start = addr;
-	info->port[n].size = len;
-	info->port[n].porttype = UIO_PORT_X86;
-
-	return 0;
-}
-
-/* Unmap previously ioremap'd resources */
-static void
-igbuio_pci_release_iomem(struct uio_info *info)
-{
-	int i;
-
-	for (i = 0; i < MAX_UIO_MAPS; i++) {
-		if (info->mem[i].internal_addr)
-			iounmap(info->mem[i].internal_addr);
-	}
-}
-
 static int
 igbuio_setup_bars(struct pci_dev *dev, struct uio_info *info)
 {
@@ -518,16 +460,19 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	/* fill uio infos */
 	udev->info.name = "igb_uio";
 	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;
 	udev->info.priv = udev;
 	udev->pdev = dev;
 
-	err = sysfs_create_group(&dev->dev.kobj, &dev_attr_grp);
+	err = igbuio_pci_enable_interrupts(udev);
 	if (err != 0)
 		goto fail_release_iomem;
 
+	err = sysfs_create_group(&dev->dev.kobj, &dev_attr_grp);
+	if (err != 0)
+		goto fail_disable_interrupts;
+
 	/* register uio driver */
 	err = uio_register_device(&dev->dev, &udev->info);
 	if (err != 0)
@@ -535,6 +480,9 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	pci_set_drvdata(dev, udev);
 
+	dev_info(&dev->dev, "uio device registered with irq %lx\n",
+		 udev->info.irq);
+
 	/*
 	 * Doing a harmless dma mapping for attaching the device to
 	 * the iommu identity mapping if kernel boots with iommu=pt.
@@ -560,6 +508,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 fail_remove_group:
 	sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp);
+fail_disable_interrupts:
+	igbuio_pci_disable_interrupts(udev);
 fail_release_iomem:
 	igbuio_pci_release_iomem(&udev->info);
 	pci_disable_device(dev);
@@ -576,6 +526,7 @@ igbuio_pci_remove(struct pci_dev *dev)
 
 	sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp);
 	uio_unregister_device(&udev->info);
+	igbuio_pci_disable_interrupts(udev);
 	igbuio_pci_release_iomem(&udev->info);
 	pci_disable_device(dev);
 	pci_set_drvdata(dev, NULL);
Signature · 1 line
2.13.6
#1 lore raw

17/10/2017 22:14, Ferruh Yigit:

Quoted 27 lines

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

[...]

Quoted 4 lines

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

With this revert, we are back to the original issue.
We must really try the proposed solution.
Harish, please describe your issue and think how it could be fixed. Jingjing made it work for i40e.
I know it is less effort to request a simple revert. Please let's try to fix it once for all.

#2 lore raw

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Date: Tuesday, October 17, 2017 at 1:33 PM
To: Ferruh Yigit <[email protected]>, Harish Patil <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 36 lines

17/10/2017 22:14, Ferruh Yigit:

Quoted 29 lines

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

[...]

Quoted 4 lines

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Quoted 6 lines

With this revert, we are back to the original issue.
We must really try the proposed solution.
Harish, please describe your issue and think how it could be fixed. Jingjing made it work for i40e.
I know it is less effort to request a simple revert. Please let's try to fix it once for all.

Hi Ferruh/Thomas,
I’m discussing it internally, so please hold on committing this patch till I revert back to you.

Thanks.

Quoted 1 line
#3 lore raw

-----Original Message-----
From: Harish Patil <[email protected]>
Date: Tuesday, October 17, 2017 at 9:50 PM
To: Thomas Monjalon <[email protected]>, Ferruh Yigit <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 60 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Date: Tuesday, October 17, 2017 at 1:33 PM
To: Ferruh Yigit <[email protected]>, Harish Patil <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 36 lines

17/10/2017 22:14, Ferruh Yigit:

Quoted 29 lines

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

[...]

Quoted 4 lines

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Quoted 6 lines

With this revert, we are back to the original issue.
We must really try the proposed solution.
Harish, please describe your issue and think how it could be fixed. Jingjing made it work for i40e.
I know it is less effort to request a simple revert. Please let's try to fix it once for all.

Hi Ferruh/Thomas,
I’m discussing it internally, so please hold on committing this patch till I revert back to you.

Quoted 7 lines

Thanks.

[Harish]

1) With the introduction of:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file”)

We saw failures with qede PF & SR-IOV VF initialization in PCI passthru
mode.

Quoted 31 lines

PF PCI passthru mode initialization failure was resolved by:
“Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")

SR-IOV VF PCI passthru mode initialization issue is that PCI FLR and related device cleanup is not completed by the time VF driver starts loading. It results in the mbox command failure sent over the HW channel between VF and PF.

Even though pci_reset_function() waits for the stipulated amount of time per standards, VF FLR takes longer than that and pci_reset_function() & igb_uio_open() call returns before FLR completes and VF PMD driver tries to load before FLR completes leading to VF PMD initialization failure.

We can work around this problem by adding driver delay/retry logic since there is no deterministic way of detecting FLR completion. But this is going to increase the driver load time.

2) With the above patch ("igb_uio: issue FLR during open and release of device file), FLR is going to be issued unconditionally on all devices during igb_uio_open. We think it’s an over kill. FLR is required only for previous abnormal app termination. We already handle the abnormal app termination by doing necessary cleanup in the driver during load. This cleanup is more efficient as it is done only when required. So we feel that the drivers/devices needing such cleanup (the two cases listed below) should do it conditionally when required rather than igb_uio_open() unconditionally performing FLR all the time.

Quoted 1 line

e.g.,

- cdb166963cae ("net/liquidio: add API for VF FLR”)

Quoted 3 lines

- http://dpdk.org/ml/archives/dev/2017-May/066317.html

Thanks,
Harish

Quoted 1 line
#4 lore raw
Quoted 72 lines · Harish

-----Original Message-----
From: Harish Patil <[email protected]>
Date: Tuesday, October 17, 2017 at 9:50 PM
To: Thomas Monjalon <[email protected]>, Ferruh Yigit <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 61 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Date: Tuesday, October 17, 2017 at 1:33 PM
To: Ferruh Yigit <[email protected]>, Harish Patil <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 36 lines

17/10/2017 22:14, Ferruh Yigit:

Quoted 29 lines

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

[...]

Quoted 4 lines

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Quoted 6 lines

With this revert, we are back to the original issue.
We must really try the proposed solution.
Harish, please describe your issue and think how it could be fixed. Jingjing made it work for i40e.
I know it is less effort to request a simple revert. Please let's try to fix it once for all.

Hi Ferruh/Thomas,
I’m discussing it internally, so please hold on committing this patch till I revert back to you.

Thanks.

Quoted 12 lines
Quoted 5 lines

[Harish]

1) With the introduction of:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file”)

We saw failures with qede PF & SR-IOV VF initialization in PCI passthru
mode.

Quoted 4 lines

PF PCI passthru mode initialization failure was resolved by:
“Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")

Thank you for the update.

Quoted 5 lines
Quoted 5 lines

SR-IOV VF PCI passthru mode initialization issue is that PCI FLR and related device cleanup is not completed by the time VF driver starts loading. It results in the mbox command failure sent over the HW channel between VF and PF.

This seems same reason why i40e added a check and wait loop.

Quoted 22 lines
Quoted 22 lines

Even though pci_reset_function() waits for the stipulated amount of time per standards, VF FLR takes longer than that and pci_reset_function() & igb_uio_open() call returns before FLR completes and VF PMD driver tries to load before FLR completes leading to VF PMD initialization failure.

We can work around this problem by adding driver delay/retry logic since there is no deterministic way of detecting FLR completion. But this is going to increase the driver load time.

2) With the above patch ("igb_uio: issue FLR during open and release of device file), FLR is going to be issued unconditionally on all devices during igb_uio_open. We think it’s an over kill. FLR is required only for previous abnormal app termination. We already handle the abnormal app termination by doing necessary cleanup in the driver during load. This cleanup is more efficient as it is done only when required. So we feel that the drivers/devices needing such cleanup (the two cases listed below) should do it conditionally when required rather than igb_uio_open() unconditionally performing FLR all the time.

Quoted 2 lines
Quoted 1 line

e.g.,

- cdb166963cae ("net/liquidio: add API for VF FLR”)

Both 1) and 2) related to the pci_reset during open().
But the main functionality we are looking for is the pci_reset in release(). So we can remove reset during open() [1].

Will disabling pci_reset in open() [2] solve your problems?

Jingjing, Jianfeng,
What do you think?

[1]
Perhaps will need to revert or partially revert liquidio patch after this.

[2]
disable line "pci_reset_function(dev);" in the igbuio_pci_open()
http://dpdk.org/browse/dpdk/tree/lib/librte_eal/linuxapp/igb_uio/igb_uio.c#n339

Quoted 8 lines
Quoted 3 lines

- http://dpdk.org/ml/archives/dev/2017-May/066317.html

Thanks,
Harish

Quoted 1 line
#5 lore raw

Hi Ferruh & Harish,

Quoted 109 lines · Ferruh Yigit
Quoted 67 lines · Harish

-----Original Message-----
From: Harish Patil <[email protected]>
Date: Tuesday, October 17, 2017 at 9:50 PM
To: Thomas Monjalon <[email protected]>, Ferruh Yigit <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 57 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Date: Tuesday, October 17, 2017 at 1:33 PM
To: Ferruh Yigit <[email protected]>, Harish Patil <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 35 lines

17/10/2017 22:14, Ferruh Yigit:

Quoted 29 lines

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

[...]

Quoted 4 lines

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Quoted 6 lines

With this revert, we are back to the original issue.
We must really try the proposed solution.
Harish, please describe your issue and think how it could be fixed. Jingjing made it work for i40e.
I know it is less effort to request a simple revert. Please let's try to fix it once for all.

Hi Ferruh/Thomas,
I’m discussing it internally, so please hold on committing this patch till I revert back to you.

Quoted 11 lines
Quoted 5 lines

Thanks.
[Harish]
1) With the introduction of:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file”)

We saw failures with qede PF & SR-IOV VF initialization in PCI passthru
mode.

Quoted 3 lines

PF PCI passthru mode initialization failure was resolved by:
“Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")

Thank you for the update.

Quoted 4 lines
Quoted 4 lines

SR-IOV VF PCI passthru mode initialization issue is that PCI FLR and related device cleanup is not completed by the time VF driver starts loading. It results in the mbox command failure sent over the HW channel between VF and PF.

This seems same reason why i40e added a check and wait loop.

Quoted 20 lines
Quoted 20 lines

Even though pci_reset_function() waits for the stipulated amount of time per standards, VF FLR takes longer than that and pci_reset_function() & igb_uio_open() call returns before FLR completes and VF PMD driver tries to load before FLR completes leading to VF PMD initialization failure.

We can work around this problem by adding driver delay/retry logic since there is no deterministic way of detecting FLR completion. But this is going to increase the driver load time.

2) With the above patch ("igb_uio: issue FLR during open and release of device file), FLR is going to be issued unconditionally on all devices during igb_uio_open. We think it’s an over kill. FLR is required only for previous abnormal app termination. We already handle the abnormal app termination by doing necessary cleanup in the driver during load. This cleanup is more efficient as it is done only when required. So we feel that the drivers/devices needing such cleanup (the two cases listed below) should do it conditionally when required rather than igb_uio_open() unconditionally performing FLR all the time.

Quoted 2 lines
Quoted 1 line

e.g.,

- cdb166963cae ("net/liquidio: add API for VF FLR”)

Quoted 8 lines

Both 1) and 2) related to the pci_reset during open().
But the main functionality we are looking for is the pci_reset in release(). So we can remove reset during open() [1].

Will disabling pci_reset in open() [2] solve your problems?

Jingjing, Jianfeng,
What do you think?

If [2] can work for all drivers, I agree with this option.

Thanks,
Jianfeng

Quoted 9 lines

[1]
Perhaps will need to revert or partially revert liquidio patch after this.

[2]
disable line "pci_reset_function(dev);" in the igbuio_pci_open()
http://dpdk.org/browse/dpdk/tree/lib/librte_eal/linuxapp/igb_uio/igb_uio.c#n339

#6 lore raw
Quoted 117 lines · Jianfeng

Hi Ferruh & Harish,

Quoted 113 lines · Ferruh Yigit
Quoted 67 lines · Harish

-----Original Message-----
From: Harish Patil <[email protected]>
Date: Tuesday, October 17, 2017 at 9:50 PM
To: Thomas Monjalon <[email protected]>, Ferruh Yigit <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 57 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Date: Tuesday, October 17, 2017 at 1:33 PM
To: Ferruh Yigit <[email protected]>, Harish Patil <[email protected]>
Cc: "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, George Prekas <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [PATCH] igb_uio: revert open and release operations

Quoted 35 lines

17/10/2017 22:14, Ferruh Yigit:

Quoted 29 lines

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

[...]

Quoted 4 lines

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Quoted 6 lines

With this revert, we are back to the original issue.
We must really try the proposed solution.
Harish, please describe your issue and think how it could be fixed. Jingjing made it work for i40e.
I know it is less effort to request a simple revert. Please let's try to fix it once for all.

Hi Ferruh/Thomas,
I’m discussing it internally, so please hold on committing this patch till I revert back to you.

Quoted 11 lines
Quoted 5 lines

Thanks.
[Harish]
1) With the introduction of:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file”)

We saw failures with qede PF & SR-IOV VF initialization in PCI passthru
mode.

Quoted 3 lines

PF PCI passthru mode initialization failure was resolved by:
“Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")

Thank you for the update.

Quoted 4 lines
Quoted 4 lines

SR-IOV VF PCI passthru mode initialization issue is that PCI FLR and related device cleanup is not completed by the time VF driver starts loading. It results in the mbox command failure sent over the HW channel between VF and PF.

This seems same reason why i40e added a check and wait loop.

Quoted 20 lines
Quoted 20 lines

Even though pci_reset_function() waits for the stipulated amount of time per standards, VF FLR takes longer than that and pci_reset_function() & igb_uio_open() call returns before FLR completes and VF PMD driver tries to load before FLR completes leading to VF PMD initialization failure.

We can work around this problem by adding driver delay/retry logic since there is no deterministic way of detecting FLR completion. But this is going to increase the driver load time.

2) With the above patch ("igb_uio: issue FLR during open and release of device file), FLR is going to be issued unconditionally on all devices during igb_uio_open. We think it’s an over kill. FLR is required only for previous abnormal app termination. We already handle the abnormal app termination by doing necessary cleanup in the driver during load. This cleanup is more efficient as it is done only when required. So we feel that the drivers/devices needing such cleanup (the two cases listed below) should do it conditionally when required rather than igb_uio_open() unconditionally performing FLR all the time.

Quoted 2 lines
Quoted 1 line

e.g.,

- cdb166963cae ("net/liquidio: add API for VF FLR”)

Both 1) and 2) related to the pci_reset during open().
But the main functionality we are looking for is the pci_reset in release(). So we can remove reset during open() [1].

Quoted 6 lines
Quoted 4 lines

Will disabling pci_reset in open() [2] solve your problems?

Jingjing, Jianfeng,
What do you think?

If [2] can work for all drivers, I agree with this option.

OK, I will send this as a patch to make it easy to test and discuss.

Quoted 14 lines

Thanks,
Jianfeng

Quoted 9 lines

[1]
Perhaps will need to revert or partially revert liquidio patch after this.

[2]
disable line "pci_reset_function(dev);" in the igbuio_pci_open()
http://dpdk.org/browse/dpdk/tree/lib/librte_eal/linuxapp/igb_uio/igb_uio.c#n339

#7 lore raw

PATCH 1/1 igb_uio: remove device reset in open

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

---
Cc: Jianfeng Tan <[email protected]>
Cc: Jingjing Wu <[email protected]>
Cc: Shijith Thotton <[email protected]>
Cc: Gregory Etelson <[email protected]>
Cc: Harish Patil <[email protected]>
Cc: George Prekas <[email protected]>
Cc: Sergio Gonzalez Monroy <[email protected]>

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +0 -2
index f7ef82554..fd320d87d 100644
@@ -336,8 +336,6 @@ igbuio_pci_open(struct uio_info *info, struct inode *inode)
 	struct pci_dev *dev = udev->pdev;
 	int err;
 
-	pci_reset_function(dev);
-
 	/* set bus master, which was cleared by the reset function */
 	pci_set_master(dev);
 
Signature · 1 line
2.13.6
#8 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 8 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

Quoted 7 lines

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

Thanks,
ferruh

Quoted 26 lines

---
Cc: Jianfeng Tan <[email protected]>
Cc: Jingjing Wu <[email protected]>
Cc: Shijith Thotton <[email protected]>
Cc: Gregory Etelson <[email protected]>
Cc: Harish Patil <[email protected]>
Cc: George Prekas <[email protected]>
Cc: Sergio Gonzalez Monroy <[email protected]>

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +0 -2
index f7ef82554..fd320d87d 100644
@@ -336,8 +336,6 @@ igbuio_pci_open(struct uio_info *info, struct inode *inode)
 	struct pci_dev *dev = udev->pdev;
 	int err;
 
-	pci_reset_function(dev);
-
 	/* set bus master, which was cleared by the reset function */
 	pci_set_master(dev);
 
#9 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 19 lines · On Friday, 20 October 2017 19:57:38 IDT Ferruh Yigit wrote:
Quoted 9 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD

initialization error.
Adding delay can solve the issue but will increase driver load time.

Quoted 8 lines

2- Reset will be issues all devices unconditionally, not very efficient

way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device

file") Cc: [email protected]

Quoted 8 lines

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

Thanks,
ferruh

sure.

Quoted 28 lines
Quoted 28 lines

---
Cc: Jianfeng Tan <[email protected]>
Cc: Jingjing Wu <[email protected]>
Cc: Shijith Thotton <[email protected]>
Cc: Gregory Etelson <[email protected]>
Cc: Harish Patil <[email protected]>
Cc: George Prekas <[email protected]>
Cc: Sergio Gonzalez Monroy <[email protected]>
---

 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index f7ef82554..fd320d87d 100644

lib/librte_eal/linuxapp/igb_uio/igb_uio.c +0 -2
@@ -336,8 +336,6 @@ igbuio_pci_open(struct uio_info *info, struct inode
 *inode)> 
 	struct pci_dev *dev = udev->pdev;
 	int err;
 
-	pci_reset_function(dev);
-
 
 	/* set bus master, which was cleared by the reset function */

pci_set_master(dev);

#10 lore raw

Re: [PATCH] igb_uio: remove device reset in open

In reply to Ferruh Yigit

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Date: Friday, October 20, 2017 at 9:57 AM
To: Jingjing Wu <[email protected]>, "Thotton, Shijith" <[email protected]>, Gregory Etelson <[email protected]>, Harish Patil <[email protected]>
Cc: Thomas Monjalon <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, Jianfeng Tan <[email protected]>, George Prekas <[email protected]>, Sergio Gonzalez Monroy <[email protected]>
Subject: Re: [PATCH] igb_uio: remove device reset in open

Quoted 18 lines · Ferruh Yigit
Quoted 8 lines

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

Quoted 8 lines

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of

device file")
Cc: [email protected]

Quoted 8 lines

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

Thanks,
Ferruh

Ferruh,
Sure, will try and get back to you.
Thanks.

Quoted 30 lines
Quoted 29 lines

---
Cc: Jianfeng Tan <[email protected]>
Cc: Jingjing Wu <[email protected]>
Cc: Shijith Thotton <[email protected]>
Cc: Gregory Etelson <[email protected]>
Cc: Harish Patil <[email protected]>
Cc: George Prekas <[email protected]>
Cc: Sergio Gonzalez Monroy <[email protected]>

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +0 -2
index f7ef82554..fd320d87d 100644
@@ -336,8 +336,6 @@ igbuio_pci_open(struct uio_info *info, struct inode
 *inode)
 	struct pci_dev *dev = udev->pdev;
 	int err;
 
-	pci_reset_function(dev);
-
 	/* set bus master, which was cleared by the reset function */
 	pci_set_master(dev);
#11 lore raw

Re: [PATCH] igb_uio: remove device reset in open

In reply to Ferruh Yigit
Quoted 15 lines · Ferruh Yigit
Quoted 14 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")
Quoted 6 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

Hi Ferruh,

Tested for LiquidIO cards and it works.

Thanks,
Shijith

#12 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 18 lines · Shijith Thotton
Quoted 17 lines · Ferruh Yigit
Quoted 15 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")
Quoted 8 lines
Quoted 4 lines

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

Hi Ferruh,

Tested for LiquidIO cards and it works.

Thanks Shijith,

Is following commit needs to be reverted after pci_reset removed from open():

Commit: 9ed3f38770c6 ("net/liquidio: remove FLR request to PF driver")

Thanks,
ferruh

Quoted 4 lines

Thanks,
Shijith

#13 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 26 lines · Ferruh Yigit
Quoted 25 lines · Shijith Thotton
Quoted 15 lines · Ferruh Yigit
Quoted 14 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")
Quoted 6 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

Hi Ferruh,

Quoted 7 lines
Quoted 1 line

Tested for LiquidIO cards and it works.

Thanks Shijith,

Is following commit needs to be reverted after pci_reset removed from open():

Commit: 9ed3f38770c6 ("net/liquidio: remove FLR request to PF driver")

Not required. The commit can stay.

Thanks,
Shijith

#14 lore raw

Re: [PATCH] igb_uio: remove device reset in open

In reply to Shijith Thotton
Quoted 38 lines

-----Original Message-----
From: Shijith Thotton [mailto:[email protected]]
Sent: Monday, October 23, 2017 8:28 PM
To: Yigit, Ferruh <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Gregory Etelson <[email protected]>; Harish Patil <[email protected]>; Thomas Monjalon <[email protected]>; [email protected]; [email protected]; Tan, Jianfeng <[email protected]>; George Prekas <[email protected]>; Gonzalez Monroy, Sergio <[email protected]>
Subject: Re: [PATCH] igb_uio: remove device reset in open

Quoted 16 lines · Ferruh Yigit
Quoted 15 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of

device file")
Cc: [email protected]

Quoted 7 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

Quoted 6 lines

Hi Ferruh,

Tested for LiquidIO cards and it works.

Thanks,
Shijith

Hi, Ferruh

For i40e, it's OK too.

Thanks
Jingjing

#15 lore raw

Re: [PATCH] igb_uio: remove device reset in open

In reply to Ferruh Yigit

Hi Ferruh,

Quoted 19 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 15 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of

device file")
Cc: [email protected]

Quoted 6 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Now, we tested this change for BNX2X PMD using latest dpdk, which has this fix where FLR is invoked only in the release(). However, we ran into an issue when trying to reload the testpmd application in quick succession. The pci reset, called during the igb_uio release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Thanks!
-Rasesh

Quoted 32 lines

Thanks,
ferruh

lib/librte_eal/linuxapp/igb_uio/igb_uio.c igbuio_pci_open(struct uio_info *info, struct inode

Quoted 18 lines

---
Cc: Jianfeng Tan <[email protected]>
Cc: Jingjing Wu <[email protected]>
Cc: Shijith Thotton <[email protected]>
Cc: Gregory Etelson <[email protected]>
Cc: Harish Patil <[email protected]>
Cc: George Prekas <[email protected]>
Cc: Sergio Gonzalez Monroy <[email protected]>

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +0 -0
index f7ef82554..fd320d87d 100644
@@ -336,8 +336,6 @@ igbuio_pci_open(struct uio_info *info, struct inode

*inode)

Quoted 9 lines
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +0 -2
 	struct pci_dev *dev = udev->pdev;
 	int err;
 
-	pci_reset_function(dev);
-
 	/* set bus master, which was cleared by the reset function */
 	pci_set_master(dev);
 
#16 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Hi Rasesh,

Quoted 21 lines · Rasesh

Hi Ferruh,

Quoted 19 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 15 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of

device file")
Cc: [email protected]

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Now, we tested this change for BNX2X PMD using latest dpdk, which has this fix where FLR is invoked only in the release(). However, we ran into an issue when trying to reload the testpmd application in quick succession. The pci reset, called during the igb_uio release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

If we don't reset that device, it will continue working which is a more serious issue IMO.

How long does it take to reset BTW?

Thanks,
Jianfeng

#17 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 33 lines · Jianfeng

Hi Rasesh,

Quoted 29 lines · Rasesh

Hi Ferruh,

Quoted 19 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 15 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of

device file")
Cc: [email protected]

Quoted 5 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Now, we tested this change for BNX2X PMD using latest dpdk, which has this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Quoted 4 lines
Quoted 1 line

However, we ran into an issue when trying to reload the testpmd application in quick succession. The pci reset, called during the igb_uio release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

Quoted 1 line

How long does it take to reset BTW?

I was wondering same thing.

Quoted 4 lines

Thanks,
Jianfeng

#18 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Hi Jianfeng and Ferruh,

Quoted 36 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 15 lines · Jianfeng

Hi Rasesh,

Quoted 11 lines · Rasesh

Hi Ferruh,

Quoted 9 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 5 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines

initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of

device file")
Cc: [email protected]

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

Quoted 7 lines
Quoted 1 line
Quoted 1 line

The original FLR change during igb_uio open()/release() in DPDK17.08 also

impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Quoted 2 lines
Quoted 2 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 11 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 3 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

I think, it would better for the individual PMDs to take care of the reset during the application exit.

Quoted 3 lines
Quoted 1 line

How long does it take to reset BTW?

I was wondering same thing.

A five minutes delay was introduced for the reload of the application, however, we continue to see the issue with FLR during the pci release() operation.

Thanks!
-Rasesh

Quoted 5 lines
Quoted 5 lines

Thanks,
Jianfeng

#19 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 55 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 36 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 15 lines · Jianfeng

Hi Rasesh,

Quoted 11 lines · Rasesh

Hi Ferruh,

Quoted 9 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 5 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines

initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of

device file")
Cc: [email protected]

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

Quoted 7 lines
Quoted 1 line
Quoted 1 line

The original FLR change during igb_uio open()/release() in DPDK17.08 also

impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Quoted 2 lines
Quoted 2 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 1 line
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

I think, it would better for the individual PMDs to take care of the reset during the application exit.

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

#20 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 69 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, November 01, 2017 7:12 AM

Quoted 63 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 40 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 17 lines · Jianfeng

Hi Rasesh,

Quoted 13 lines · Rasesh

Hi Ferruh,

Quoted 11 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 6 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and

release of device file")
Cc: [email protected]

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also

Quoted 7 lines

impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Quoted 3 lines
Quoted 3 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 11 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio
release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 3 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

+1

I think, it would better for the individual PMDs to take care of the reset

during the application exit.

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

The pci reset in release is breaking the BNX2X PMD. Could we revert this reset and get it included with a solution that works for all in the next release?

Thanks!
-Rasesh

#21 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 71 lines · Rasesh
Quoted 71 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, November 01, 2017 7:12 AM

Quoted 65 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 40 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 17 lines · Jianfeng

Hi Rasesh,

Quoted 13 lines · Rasesh

Hi Ferruh,

Quoted 11 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 6 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

initialization error.
Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and

release of device file")
Cc: [email protected]

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also

Quoted 7 lines

impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Quoted 3 lines
Quoted 3 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 12 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio
release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 3 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I think, it would better for the individual PMDs to take care of the reset

during the application exit.

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

The pci reset in release is breaking the BNX2X PMD. Could we revert this reset and get it included with a solution that works for all in the next release?

Hi Rasesh,

I am not sure if there is more to do for solution for next releases, and related to your case, indeed I wasn't expecting a device reset will take more than five minutes...

Would you be OK to control the reset via a compile time config option, which is enabled by default. So you will need to disable it to prevent the reset?

Quoted 4 lines

Thanks!
-Rasesh

#22 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 88 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 1:55 AM

Quoted 26 lines · Rasesh
Quoted 26 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, November 01, 2017 7:12 AM

Quoted 20 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 18 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 14 lines · Jianfeng

Hi Rasesh,

Quoted 10 lines · Rasesh

Hi Ferruh,

Quoted 8 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 3 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

initialization error.
Adding delay can solve the issue but will increase driver load

time.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

2- Reset will be issues all devices unconditionally, not very

efficient

Quoted 39 lines
Quoted 39 lines
Quoted 39 lines
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and

release of device file")
Cc: [email protected]

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also

Quoted 7 lines

impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Quoted 3 lines
Quoted 3 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio
release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 1 line
Quoted 4 lines
Quoted 2 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

I think, it would better for the individual PMDs to take care of the reset

Quoted 7 lines
Quoted 5 lines

during the application exit.

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

The pci reset in release is breaking the BNX2X PMD. Could we revert this

reset and get it included with a solution that works for all in the next release?

Quoted 8 lines

Hi Rasesh,

I am not sure if there is more to do for solution for next releases, and related to your case, indeed I wasn't expecting a device reset will take more than five minutes...

Would you be OK to control the reset via a compile time config option, which is enabled by default. So you will need to disable it to prevent the reset?

Hi Ferruh,

As I understand, we will have a compile time config option, enabled by default, to guard the pci_reset_function() in the igbuio_pci_release(). We will disable this config option to prevent the reset when using BNX2X. The controlled reset should work for us.

Thanks!
-Rasesh

#23 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 94 lines · Rasesh
Quoted 94 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 1:55 AM

Quoted 26 lines · Rasesh
Quoted 26 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, November 01, 2017 7:12 AM

Quoted 20 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 18 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 14 lines · Jianfeng

Hi Rasesh,

Quoted 10 lines · Rasesh

Hi Ferruh,

Quoted 8 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 3 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

initialization error.
Adding delay can solve the issue but will increase driver load

time.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

2- Reset will be issues all devices unconditionally, not very

efficient

Quoted 39 lines
Quoted 39 lines
Quoted 39 lines
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and

release of device file")
Cc: [email protected]

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also

Quoted 7 lines

impacts BNX2X PMD and it exhibits the issues with bare metal testing.

Quoted 3 lines
Quoted 3 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio
release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 1 line
Quoted 4 lines
Quoted 2 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

I think, it would better for the individual PMDs to take care of the reset

Quoted 7 lines
Quoted 5 lines

during the application exit.

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

The pci reset in release is breaking the BNX2X PMD. Could we revert this

reset and get it included with a solution that works for all in the next release?

Hi Rasesh,

I am not sure if there is more to do for solution for next releases, and related to your case, indeed I wasn't expecting a device reset will take more than five minutes...

Quoted 6 lines
Quoted 2 lines

Would you be OK to control the reset via a compile time config option, which is enabled by default. So you will need to disable it to prevent the reset?

Hi Ferruh,

As I understand, we will have a compile time config option, enabled by default, to guard the pci_reset_function() in the igbuio_pci_release(). We will disable this config option to prevent the reset when using BNX2X.

Yep, this is the idea.

Quoted 1 line

The controlled reset should work for us.

If there is no objection, I can send a patch for this.

Quoted 4 lines

Thanks!
-Rasesh

#24 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 109 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 11:10 AM

Quoted 48 lines · Rasesh
Quoted 48 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 1:55 AM

Quoted 26 lines · Rasesh
Quoted 26 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, November 01, 2017 7:12 AM

Quoted 20 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 18 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 14 lines · Jianfeng

Hi Rasesh,

Quoted 10 lines · Rasesh

Hi Ferruh,

Quoted 8 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 3 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

initialization error.
Adding delay can solve the issue but will increase driver
load

time.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

2- Reset will be issues all devices unconditionally, not very

efficient

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and

release of device file")
Cc: [email protected]

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also

impacts BNX2X PMD and it exhibits the issues with bare metal

testing.

Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 17 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio
release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

I think, it would better for the individual PMDs to take care of the reset

during the application exit.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

The pci reset in release is breaking the BNX2X PMD. Could we revert this

reset and get it included with a solution that works for all in the next

release?

Quoted 9 lines
Quoted 9 lines

Hi Rasesh,

I am not sure if there is more to do for solution for next releases, and related to your case, indeed I wasn't expecting a device reset will take more than five minutes...

Would you be OK to control the reset via a compile time config option, which is enabled by default. So you will need to disable it to

prevent the reset?

Quoted 4 lines

Hi Ferruh,

As I understand, we will have a compile time config option, enabled by

Quoted 8 lines

default, to guard the pci_reset_function() in the igbuio_pci_release(). We will disable this config option to prevent the reset when using BNX2X.

Yep, this is the idea.

Quoted 1 line

The controlled reset should work for us.

If there is no objection, I can send a patch for this.

We are ok as we have at least some way to disable the reset, please send a patch.

Thanks!
-Rasesh

#25 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 112 lines · Rasesh
Quoted 112 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 11:10 AM

Quoted 48 lines · Rasesh
Quoted 48 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 1:55 AM

Quoted 26 lines · Rasesh
Quoted 26 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, November 01, 2017 7:12 AM

Quoted 20 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 18 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 14 lines · Jianfeng

Hi Rasesh,

Quoted 10 lines · Rasesh

Hi Ferruh,

Quoted 8 lines

From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 3 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF

PMD

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

initialization error.
Adding delay can solve the issue but will increase driver
load

time.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

2- Reset will be issues all devices unconditionally, not very

efficient

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and

release of device file")
Cc: [email protected]

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also

impacts BNX2X PMD and it exhibits the issues with bare metal

testing.

Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 17 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio
release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

I think, it would better for the individual PMDs to take care of the reset

during the application exit.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

The pci reset in release is breaking the BNX2X PMD. Could we revert this

reset and get it included with a solution that works for all in the next

release?

Quoted 9 lines
Quoted 9 lines

Hi Rasesh,

I am not sure if there is more to do for solution for next releases, and related to your case, indeed I wasn't expecting a device reset will take more than five minutes...

Would you be OK to control the reset via a compile time config option, which is enabled by default. So you will need to disable it to

prevent the reset?

Quoted 4 lines

Hi Ferruh,

As I understand, we will have a compile time config option, enabled by

default, to guard the pci_reset_function() in the igbuio_pci_release(). We will disable this config option to prevent the reset when using BNX2X.

Quoted 7 lines
Quoted 5 lines

Yep, this is the idea.

Quoted 1 line

The controlled reset should work for us.

If there is no objection, I can send a patch for this.

We are ok as we have at least some way to disable the reset, please send a patch.

Sent http://dpdk.org/dev/patchwork/patch/31143/, can you please test?

Quoted 4 lines

Thanks!
-Rasesh

#26 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 125 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 5:32 PM

Quoted 19 lines · Rasesh
Quoted 19 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 11:10 AM

Quoted 15 lines · Rasesh
Quoted 15 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, November 02, 2017 1:55 AM

Quoted 11 lines · Rasesh
Quoted 11 lines

From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, November 01, 2017 7:12 AM

Quoted 5 lines · Rasesh

Hi Jianfeng and Ferruh,

Quoted 3 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, October 26, 2017 5:50 PM

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Jianfeng
Quoted 7 lines

Hi Rasesh,

Quoted 3 lines · Rasesh

Hi Ferruh,

Quoted 1 line

From: dev [mailto:[email protected]] On Behalf Of

Ferruh

Quoted 81 lines
Quoted 81 lines
Quoted 26 lines
Quoted 26 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Yigit
Sent: Friday, October 20, 2017 9:58 AM

Quoted 3 lines · Ferruh Yigit

Remove device reset during application start, the reset for
application exit still there.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which
cause VF

PMD

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

initialization error.
Adding delay can solve the issue but will increase
driver load

time.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

2- Reset will be issues all devices unconditionally, not
very

efficient

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

way.

Fixes: b58eedfc7dd5 ("igb_uio: issue FLR during open and
release of device file")
Cc: [email protected]

Signed-off-by: Ferruh Yigit <[email protected]>

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Hi Jingjing, Shijith, Gregory, Harish,

Can you please test this on top of current master (which has already Jingjin's
fix) ?

The original FLR change during igb_uio open()/release() in DPDK17.08 also

impacts BNX2X PMD and it exhibits the issues with bare metal

testing.

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 18 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

Now, we tested this change for BNX2X PMD using latest dpdk, which has

this fix where FLR is invoked only in the release().

Good to hear this fixed the problem.

Yes, it fixed the issue caused by pci reset during application start.

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

However, we ran into an issue when trying to reload the testpmd

application in quick succession. The pci reset, called during the igb_uio
release() operation, is taking longer time and adapter is still doing the FLR when we relaunch the application. We see this behavior with bare metal testing.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

If we don't reset that device, it will continue working which is a more serious issue IMO.

+1

I think, it would better for the individual PMDs to take care of the reset

during the application exit.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

That will never be possible. Poll Mode Drivers are userspace entities and part of the application. If application crashes, there is no way for PMD to do cleanup, it must be handled by kernel.

The pci reset in release is breaking the BNX2X PMD. Could we revert this

reset and get it included with a solution that works for all in the next

release?

Quoted 10 lines
Quoted 10 lines

Hi Rasesh,

I am not sure if there is more to do for solution for next releases, and related to your case, indeed I wasn't expecting a device reset will take more than five minutes...

Would you be OK to control the reset via a compile time config option, which is enabled by default. So you will need to disable it to

Quoted 8 lines
Quoted 8 lines

prevent the reset?

Quoted 5 lines

Hi Ferruh,

As I understand, we will have a compile time config option, enabled by

default, to guard the pci_reset_function() in the igbuio_pci_release(). We will disable this config option to prevent the

reset when using BNX2X.

Quoted 3 lines
Quoted 3 lines

Yep, this is the idea.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

The controlled reset should work for us.

If there is no objection, I can send a patch for this.

We are ok as we have at least some way to disable the reset, please send a

patch.

Sent http://dpdk.org/dev/patchwork/patch/31143/, can you please test?

The testing of BNX2X looks OK with this patch. However, the solution has following drawbacks:
- an application will need to be recompiled to have the igb_uio kernel module rebuilt to support bnx2x devices
- this will break pre-compiled solutions that are provided with an OS such as RHOSP or as part of a pre-compiled VNF

We can live with this temporary solution for now. In the long term, we may have to revisit this. We are also looking at why bnx2x FLR is taking this long.

Thanks!
-Rasesh

#27 lore raw

Re: [PATCH] igb_uio: remove device reset in open

03/11/2017 20:18, Mody, Rasesh:

Quoted 7 lines

From: Ferruh Yigit [mailto:[email protected]]

Quoted 6 lines · Rasesh
Quoted 3 lines

From: Ferruh Yigit [mailto:[email protected]]

Quoted 1 line · Rasesh

We are ok as we have at least some way to disable the reset, please send a

patch.

Quoted 8 lines
Quoted 1 line

Sent http://dpdk.org/dev/patchwork/patch/31143/, can you please test?

The testing of BNX2X looks OK with this patch. However, the solution has following drawbacks:
- an application will need to be recompiled to have the igb_uio kernel module rebuilt to support bnx2x devices
- this will break pre-compiled solutions that are provided with an OS such as RHOSP or as part of a pre-compiled VNF

We can live with this temporary solution for now. In the long term, we may have to revisit this. We are also looking at why bnx2x FLR is taking this long.

Yes, I think the long term solution should be to fix your PMD or your firmware.
Please keep us posted when you find the root cause with your device. Thanks

#28 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 14 lines · Thomas Monjalon

03/11/2017 20:18, Mody, Rasesh:

Quoted 13 lines

From: Ferruh Yigit [mailto:[email protected]]

Quoted 7 lines · Rasesh
Quoted 3 lines

From: Ferruh Yigit [mailto:[email protected]]

Quoted 1 line · Rasesh

We are ok as we have at least some way to disable the reset, please send a

patch.

Sent http://dpdk.org/dev/patchwork/patch/31143/, can you please test?

The testing of BNX2X looks OK with this patch. However, the solution has following drawbacks:
- an application will need to be recompiled to have the igb_uio kernel module rebuilt to support bnx2x devices
- this will break pre-compiled solutions that are provided with an OS such as RHOSP or as part of a pre-compiled VNF

Quoted 7 lines
Quoted 2 lines

We can live with this temporary solution for now. In the long term, we may have to revisit this. We are also looking at why bnx2x FLR is taking this long.

Yes, I think the long term solution should be to fix your PMD or your firmware.
Please keep us posted when you find the root cause with your device. Thanks

Lee Roberts suggested doing device specific action instead of build time option.

I send following:
http://dpdk.org/dev/patchwork/patch/31168/

What do you think about this approach?

Meanwhile I will send a more proper patch to discuss on.

Thanks,
ferruh

#29 lore raw

Re: [PATCH] igb_uio: remove device reset in open

Quoted 23 lines · Ferruh Yigit
Quoted 14 lines · Thomas Monjalon

03/11/2017 20:18, Mody, Rasesh:

Quoted 13 lines

From: Ferruh Yigit [mailto:[email protected]]

Quoted 7 lines · Rasesh
Quoted 3 lines

From: Ferruh Yigit [mailto:[email protected]]

Quoted 1 line · Rasesh

We are ok as we have at least some way to disable the reset, please send a

patch.

Sent http://dpdk.org/dev/patchwork/patch/31143/, can you please test?

The testing of BNX2X looks OK with this patch. However, the solution has following drawbacks:
- an application will need to be recompiled to have the igb_uio kernel module rebuilt to support bnx2x devices
- this will break pre-compiled solutions that are provided with an OS such as RHOSP or as part of a pre-compiled VNF

Quoted 7 lines
Quoted 2 lines

We can live with this temporary solution for now. In the long term, we may have to revisit this. We are also looking at why bnx2x FLR is taking this long.

Yes, I think the long term solution should be to fix your PMD or your firmware.
Please keep us posted when you find the root cause with your device. Thanks

Quoted 8 lines

Lee Roberts suggested doing device specific action instead of build time option.

I send following:
http://dpdk.org/dev/patchwork/patch/31168/

What do you think about this approach?

Meanwhile I will send a more proper patch to discuss on.

http://dpdk.org/dev/patchwork/patch/31169/

author Tested-by Harish Patil Tested-by Shijith Thotton Tested-by Jingjing Wu on v1 1/1 Applied
#30 lore raw

Re: [PATCH] igb_uio: remove device reset in open

In reply to Ferruh Yigit
Quoted 8 lines · Ferruh Yigit

Remove device reset during application start, the reset for application exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
initialization error.
Adding delay can solve the issue but will increase driver load time.

Quoted 7 lines

2- Reset will be issues all devices unconditionally, not very efficient
way.

Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Applied to dpdk/master, thanks.

#31 lore raw
In reply to Ferruh Yigit

Hi, Ferruh

This one is generic, we can keep it.

Commit: 8cacf78469a7 ("net/i40e: fix VF initialization error")

Thanks
Jingjing

Quoted 359 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Wednesday, October 18, 2017 4:15 AM
To: Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Tan, Jianfeng <[email protected]>; Wu, Jingjing <[email protected]>; Shijith Thotton <[email protected]>; Gregory Etelson <[email protected]>; Harish Patil <[email protected]>; George Prekas <[email protected]>; [email protected]
Subject: [PATCH] igb_uio: revert open and release operations

This reverts commit 6b9ed026a8704b9e5ee5da7997617ef7cc82e114. This reverts commit 5f6ff30dc5075c49069d684bab229aef7ff0fdc3. This reverts commit b58eedfc7dd57eef6d12e2c654a52c834f36084a.

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

Cc Jianfeng Tan <[email protected]>
Cc Jingjing Wu <[email protected]>
Cc Shijith Thotton <[email protected]>
Cc Gregory Etelson <[email protected]>
Cc Harish Patil <[email protected]>
Cc George Prekas <[email protected]>
Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Thanks everyone who spent effort for this, hopefully we can continue to work on next release cycle.

Jingjing, there is a i40e commit, was part of igb_uio fix patchset, is it generic, or needs to be reverted with this patch?
Commit: 8cacf78469a7 ("net/i40e: fix VF initialization error")

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 201 +++++++++++-------------------
 1 file changed, 76 insertions(+), 125 deletions(-)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +1 -0
index f7ef82554..786df68a2 100644
@@ -49,6 +49,7 @@ struct rte_uio_pci_dev {
 
 static char *intr_mode;
 static enum rte_intr_mode igbuio_intr_mode_preferred =
 RTE_INTR_MODE_MSIX;
+
 /* sriov sysfs */
 static ssize_t

show_max_vfs(struct device *dev, struct device_attribute *attr, @@ -207,22
+208,80 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state)
* If yes, disable it here and will be enable later.
*/
static irqreturn_t

lib/librte_eal/linuxapp/igb_uio/igb_uio.c +61 -113
-igbuio_pci_irqhandler(int irq, void *dev_id)
+igbuio_pci_irqhandler(int irq, struct uio_info *info)
 {
-	struct rte_uio_pci_dev *udev = (struct rte_uio_pci_dev *)dev_id;
-	struct uio_info *info = &udev->info;
+	struct rte_uio_pci_dev *udev = info->priv;
 
 	/* Legacy mode need to mask in hardware */
 	if (udev->mode == RTE_INTR_MODE_LEGACY &&
 	    !pci_check_and_mask_intx(udev->pdev))
 		return IRQ_NONE;
 
-	uio_event_notify(info);
-
 	/* Message signal mode, no share IRQ and automasked */
 	return IRQ_HANDLED;
 }
 
+/* Remap pci resources described by bar #pci_bar in uio resource n. */
+static int igbuio_pci_setup_iomem(struct pci_dev *dev, struct uio_info
+*info,
+		       int n, int pci_bar, const char *name) {
+	unsigned long addr, len;
+	void *internal_addr;
+
+	if (n >= ARRAY_SIZE(info->mem))
+		return -EINVAL;
+
+	addr = pci_resource_start(dev, pci_bar);
+	len = pci_resource_len(dev, pci_bar);
+	if (addr == 0 || len == 0)
+		return -1;
+	internal_addr = ioremap(addr, len);
+	if (internal_addr == NULL)
+		return -1;
+	info->mem[n].name = name;
+	info->mem[n].addr = addr;
+	info->mem[n].internal_addr = internal_addr;
+	info->mem[n].size = len;
+	info->mem[n].memtype = UIO_MEM_PHYS;
+	return 0;
+}
+
+/* Get pci port io resources described by bar #pci_bar in uio resource
+n. */ static int igbuio_pci_setup_ioport(struct pci_dev *dev, struct
+uio_info *info,
+		int n, int pci_bar, const char *name) {
+	unsigned long addr, len;
+
+	if (n >= ARRAY_SIZE(info->port))
+		return -EINVAL;
+
+	addr = pci_resource_start(dev, pci_bar);
+	len = pci_resource_len(dev, pci_bar);
+	if (addr == 0 || len == 0)
+		return -EINVAL;
+
+	info->port[n].name = name;
+	info->port[n].start = addr;
+	info->port[n].size = len;
+	info->port[n].porttype = UIO_PORT_X86;
+
+	return 0;
+}
+
+/* Unmap previously ioremap'd resources */ static void
+igbuio_pci_release_iomem(struct uio_info *info) {
+	int i;
+
+	for (i = 0; i < MAX_UIO_MAPS; i++) {
+		if (info->mem[i].internal_addr)
+			iounmap(info->mem[i].internal_addr);
+	}
+}
+
 static int
 igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)  { @@ -252,7
+311,6 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 			break;
 		}
 #endif
-
 	/* fall back to MSI */
 	case RTE_INTR_MODE_MSI:
 #ifndef HAVE_ALLOC_IRQ_VECTORS
@@ -291,28 +349,15 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev
 *udev)
 	default:
 		dev_err(&udev->pdev->dev, "invalid IRQ mode %u",
 			igbuio_intr_mode_preferred);
-		udev->info.irq = UIO_IRQ_NONE;
 		err = -EINVAL;
 	}
 
-	if (udev->info.irq != UIO_IRQ_NONE)
-		err = request_irq(udev->info.irq, igbuio_pci_irqhandler,
-				  udev->info.irq_flags, udev->info.name,
-				  udev);
-	dev_info(&udev->pdev->dev, "uio device registered with irq %lx\n",
-		 udev->info.irq);
-
 	return err;
 }
 
 static void
 igbuio_pci_disable_interrupts(struct rte_uio_pci_dev *udev)  {
-	if (udev->info.irq) {
-		free_irq(udev->info.irq, udev);
-		udev->info.irq = 0;
-	}
-
 #ifndef HAVE_ALLOC_IRQ_VECTORS
 	if (udev->mode == RTE_INTR_MODE_MSIX)
 		pci_disable_msix(udev->pdev);
@@ -325,109 +370,6 @@ igbuio_pci_disable_interrupts(struct rte_uio_pci_dev
 *udev)  #endif  }
 
-
-/**
- * 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;
-	int err;
-
-	pci_reset_function(dev);
-
-	/* set bus master, which was cleared by the reset function */
-	pci_set_master(dev);
-
-	/* enable interrupts */
-	err = igbuio_pci_enable_interrupts(udev);
-	if (err) {
-		dev_err(&dev->dev, "Enable interrupt fails\n");
-		return err;
-	}
-	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;
-
-	/* disable interrupts */
-	igbuio_pci_disable_interrupts(udev);
-
-	/* stop the device from further DMA */
-	pci_clear_master(dev);
-
-	pci_reset_function(dev);
-
-	return 0;
-}
-
-/* Remap pci resources described by bar #pci_bar in uio resource n. */ -static
 int -igbuio_pci_setup_iomem(struct pci_dev *dev, struct uio_info *info,
-		       int n, int pci_bar, const char *name)
-{
-	unsigned long addr, len;
-	void *internal_addr;
-
-	if (n >= ARRAY_SIZE(info->mem))
-		return -EINVAL;
-
-	addr = pci_resource_start(dev, pci_bar);
-	len = pci_resource_len(dev, pci_bar);
-	if (addr == 0 || len == 0)
-		return -1;
-	internal_addr = ioremap(addr, len);
-	if (internal_addr == NULL)
-		return -1;
-	info->mem[n].name = name;
-	info->mem[n].addr = addr;
-	info->mem[n].internal_addr = internal_addr;
-	info->mem[n].size = len;
-	info->mem[n].memtype = UIO_MEM_PHYS;
-	return 0;
-}
-
-/* Get pci port io resources described by bar #pci_bar in uio resource n. */ -
 static int -igbuio_pci_setup_ioport(struct pci_dev *dev, struct uio_info *info,
-		int n, int pci_bar, const char *name)
-{
-	unsigned long addr, len;
-
-	if (n >= ARRAY_SIZE(info->port))
-		return -EINVAL;
-
-	addr = pci_resource_start(dev, pci_bar);
-	len = pci_resource_len(dev, pci_bar);
-	if (addr == 0 || len == 0)
-		return -EINVAL;
-
-	info->port[n].name = name;
-	info->port[n].start = addr;
-	info->port[n].size = len;
-	info->port[n].porttype = UIO_PORT_X86;
-
-	return 0;
-}
-
-/* Unmap previously ioremap'd resources */ -static void -
 igbuio_pci_release_iomem(struct uio_info *info) -{
-	int i;
-
-	for (i = 0; i < MAX_UIO_MAPS; i++) {
-		if (info->mem[i].internal_addr)
-			iounmap(info->mem[i].internal_addr);
-	}
-}
-
 static int
 igbuio_setup_bars(struct pci_dev *dev, struct uio_info *info)  { @@ -518,16
+460,19 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id

*id)

lib/librte_eal/linuxapp/igb_uio/igb_uio.c +9 -3
 	/* fill uio infos */
 	udev->info.name = "igb_uio";
 	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;
 	udev->info.priv = udev;
 	udev->pdev = dev;
 
-	err = sysfs_create_group(&dev->dev.kobj, &dev_attr_grp);
+	err = igbuio_pci_enable_interrupts(udev);
 	if (err != 0)
 		goto fail_release_iomem;
 
+	err = sysfs_create_group(&dev->dev.kobj, &dev_attr_grp);
+	if (err != 0)
+		goto fail_disable_interrupts;
+
 	/* register uio driver */
 	err = uio_register_device(&dev->dev, &udev->info);
 	if (err != 0)
@@ -535,6 +480,9 @@ igbuio_pci_probe(struct pci_dev *dev, const struct
 pci_device_id *id)
 
 	pci_set_drvdata(dev, udev);
 
+	dev_info(&dev->dev, "uio device registered with irq %lx\n",
+		 udev->info.irq);
+
 	/*
 	 * Doing a harmless dma mapping for attaching the device to
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +2 -0
 	 * the iommu identity mapping if kernel boots with iommu=pt.
@@ -560,6 +508,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct
 pci_device_id *id)
 
 fail_remove_group:
 	sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp);
+fail_disable_interrupts:
+	igbuio_pci_disable_interrupts(udev);
 fail_release_iomem:
 	igbuio_pci_release_iomem(&udev->info);
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +1 -1
 	pci_disable_device(dev);
@@ -576,6 +526,7 @@ igbuio_pci_remove(struct pci_dev *dev)
 
 	sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp);
 	uio_unregister_device(&udev->info);
+	igbuio_pci_disable_interrupts(udev);
 	igbuio_pci_release_iomem(&udev->info);
 	pci_disable_device(dev);
 	pci_set_drvdata(dev, NULL);
--

2.13.6

#32 lore raw
In reply to Ferruh Yigit
Quoted 48 lines · Ferruh Yigit

This reverts commit 6b9ed026a8704b9e5ee5da7997617ef7cc82e114. This reverts commit 5f6ff30dc5075c49069d684bab229aef7ff0fdc3. This reverts commit b58eedfc7dd57eef6d12e2c654a52c834f36084a.

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

Cc Jianfeng Tan <[email protected]>
Cc Jingjing Wu <[email protected]>
Cc Shijith Thotton <[email protected]>
Cc Gregory Etelson <[email protected]>
Cc Harish Patil <[email protected]>
Cc George Prekas <[email protected]>
Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Quoted 6 lines

Thanks everyone who spent effort for this, hopefully we can continue to work on next release cycle.

Jingjing, there is a i40e commit, was part of igb_uio fix patchset, is it generic, or needs to be reverted with this patch?
Commit: 8cacf78469a7 ("net/i40e: fix VF initialization error")

Hi Ferruh,

Please consider this patch as part of revert.
Commit: 9ed3f38770c6 ("net/liquidio: remove FLR request to PF driver")

Here I have removed extra FLR requests inside driver during init and close. They are required now, as we remove resets in igb_uio.

Thanks,
Shijith

[...]

#33 lore raw
Quoted 52 lines · Shijith Thotton
Quoted 51 lines · Ferruh Yigit

This reverts commit 6b9ed026a8704b9e5ee5da7997617ef7cc82e114. This reverts commit 5f6ff30dc5075c49069d684bab229aef7ff0fdc3. This reverts commit b58eedfc7dd57eef6d12e2c654a52c834f36084a.

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

Cc Jianfeng Tan <[email protected]>
Cc Jingjing Wu <[email protected]>
Cc Shijith Thotton <[email protected]>
Cc Gregory Etelson <[email protected]>
Cc Harish Patil <[email protected]>
Cc George Prekas <[email protected]>
Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Thanks everyone who spent effort for this, hopefully we can continue to work on next release cycle.

Quoted 8 lines
Quoted 3 lines

Jingjing, there is a i40e commit, was part of igb_uio fix patchset, is it generic, or needs to be reverted with this patch?
Commit: 8cacf78469a7 ("net/i40e: fix VF initialization error")

Hi Ferruh,

Please consider this patch as part of revert.
Commit: 9ed3f38770c6 ("net/liquidio: remove FLR request to PF driver")

Hi Shijith,

Sure, I will add this on next version of the patch.

Quoted 9 lines

Here I have removed extra FLR requests inside driver during init and close. They are required now, as we remove resets in igb_uio.

Thanks,
Shijith

[...]

#34 lore raw
In reply to Ferruh Yigit
Quoted 48 lines · Ferruh Yigit

This reverts commit 6b9ed026a8704b9e5ee5da7997617ef7cc82e114. This reverts commit 5f6ff30dc5075c49069d684bab229aef7ff0fdc3. This reverts commit b58eedfc7dd57eef6d12e2c654a52c834f36084a.

There were bug reports about terminated application may leave device in undesired state:
http://dpdk.org/ml/archives/dev/2016-November/049745.html
http://dpdk.org/ml/archives/dev/2016-November/050932.html

And a proposal to fix:
http://dpdk.org/ml/archives/dev/2016-December/051844.html

Later another proposal triggered the discussion:
http://dpdk.org/ml/archives/dev/2017-May/066317.html

Finally a fix patch pushed into v17.08:
Commit: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

Later a regression report sent related to the pushed patch:
http://dpdk.org/ml/archives/dev/2017-September/075236.html

And a fix for regression integrated into v17.11-rc1:
http://dpdk.org/ml/archives/dev/2017-October/079166.html
Commit: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Commit: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17")

Even after the fix qede PMD reported to be broken:
http://dpdk.org/ml/archives/dev/2017-October/079359.html

So this patch reverts original fix and related commits. The related igb_uio code part turns back to v17.05 base.

Cc Jianfeng Tan <[email protected]>
Cc Jingjing Wu <[email protected]>
Cc Shijith Thotton <[email protected]>
Cc Gregory Etelson <[email protected]>
Cc Harish Patil <[email protected]>
Cc George Prekas <[email protected]>
Fixes b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")

---
It would be nice to solve this issue in LTS release, but being close to the release and the error report without details makes it hard to work more on this issue.

Quoted 6 lines

Thanks everyone who spent effort for this, hopefully we can continue to work on next release cycle.

Jingjing, there is a i40e commit, was part of igb_uio fix patchset, is it generic, or needs to be reverted with this patch?
Commit: 8cacf78469a7 ("net/i40e: fix VF initialization error")

This patch is no more valid and will be marked as rejected, since instead of revert, agreed on a solution [1].

[1]
http://dpdk.org/ml/archives/dev/2017-October/thread.html#79815
http://dpdk.org/dev/patchwork/patch/30654/