DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas.monjalon@6wind.com>,
	Yerden Zhumabekov <e_zhumabekov@sts.kz>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] igb_uio: handle no IRQ fallback
Date: Fri, 25 Jul 2014 10:37:54 -0700	[thread overview]
Message-ID: <20140725103754.5fbec494@haswell.linuxnetplumber.net> (raw)
In-Reply-To: <20140725103627.4ca989b7@haswell.linuxnetplumber.net>

Fix a couple of issues with my earlier igb_uio stuff:
1. With MSI (like MSI-X) actual IRQ number is not known until
   after the pci_enable_msi() is done.
2. If INTX fails, fall back to running without IRQ.
   This allows usermode PCI to recover and run without out IRQ
   for cases where PCI INTX support is broken (aka VMWare).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>


--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c	2014-07-25 10:30:07.740159856 -0700
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c	2014-07-25 10:30:07.736159842 -0700
@@ -506,7 +506,6 @@ igbuio_pci_probe(struct pci_dev *dev, co
 	udev->info.version = "0.1";
 	udev->info.handler = igbuio_pci_irqhandler;
 	udev->info.irqcontrol = igbuio_pci_irqcontrol;
-	udev->info.irq = dev->irq;
 #ifdef CONFIG_XEN_DOM0
 	/* check if the driver run on Xen Dom0 */
 	if (xen_initial_domain())
@@ -516,9 +515,6 @@ igbuio_pci_probe(struct pci_dev *dev, co
 	udev->pdev = dev;
 
 	switch (igbuio_intr_mode_preferred) {
-	case RTE_INTR_MODE_NONE:
-		udev->info.irq = 0;
-		break;
 	case RTE_INTR_MODE_MSIX:
 		/* Only 1 msi-x vector needed */
 		msix_entry.entry = 0;
@@ -532,6 +528,7 @@ igbuio_pci_probe(struct pci_dev *dev, co
 	case RTE_INTR_MODE_MSI:
 		if (pci_enable_msi(dev) == 0) {
 			dev_dbg(&dev->dev, "using MSI");
+			udev->info.irq = dev->irq;
 			udev->mode = RTE_INTR_MODE_MSI;
 			break;
 		}
@@ -540,13 +537,17 @@ igbuio_pci_probe(struct pci_dev *dev, co
 		if (pci_intx_mask_supported(dev)) {
 			dev_dbg(&dev->dev, "using INTX");
 			udev->info.irq_flags = IRQF_SHARED;
+			udev->info.irq = dev->irq;
 			udev->mode = RTE_INTR_MODE_LEGACY;
-		} else {
-			dev_err(&dev->dev, "PCI INTX mask not supported\n");
-			err = -EIO;
-			goto fail_release_iomem;
+			break;
 		}
+		dev_notice(&dev->dev, "PCI INTX mask not supported\n");
+		/* fall back to no IRQ */
+	case RTE_INTR_MODE_NONE:
+		udev->mode = RTE_INTR_MODE_NONE;
+		udev->info.irq = 0;
 		break;
+
 	default:
 		dev_err(&dev->dev, "invalid IRQ mode %u",
 			igbuio_intr_mode_preferred);

  reply	other threads:[~2014-07-25 17:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 17:36 [dpdk-dev] [PATCH 1/2] igb_uio: fix compability on old kernel Stephen Hemminger
2014-07-25 17:37 ` Stephen Hemminger [this message]
2014-08-01 13:11   ` [dpdk-dev] [PATCH 2/2] igb_uio: handle no IRQ fallback Thomas Monjalon
2014-08-01 13:10 ` [dpdk-dev] [PATCH 1/2] igb_uio: fix compability on old kernel Thomas Monjalon
2014-08-22 17:29   ` Sanford, Robert
2014-08-22 18:09     ` Robert Sanford
2014-08-23 15:14       ` Stephen Hemminger
2014-08-26 16:08         ` Sanford, Robert
2014-09-01 11:15           ` Thomas Monjalon
2014-09-01 15:07       ` Guillaume Gaudonville
2014-09-01 14:55 ` Guillaume Gaudonville
2014-09-03  2:28   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140725103754.5fbec494@haswell.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=e_zhumabekov@sts.kz \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).