From: Stephen Hemminger <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
To: Thomas Monjalon
<thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>,
Yerden Zhumabekov <e_zhumabekov-8EHiFRVJVgQ@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: [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-a7a0dvSY7KrRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
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-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.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);
next prev parent reply other threads:[~2014-07-25 17:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 17:36 [PATCH 1/2] igb_uio: fix compability on old kernel Stephen Hemminger
[not found] ` <20140725103627.4ca989b7-a7a0dvSY7KrRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
2014-07-25 17:37 ` Stephen Hemminger [this message]
[not found] ` <20140725103754.5fbec494-a7a0dvSY7KrRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
2014-08-01 13:11 ` [PATCH 2/2] igb_uio: handle no IRQ fallback Thomas Monjalon
2014-08-01 13:10 ` [PATCH 1/2] igb_uio: fix compability on old kernel Thomas Monjalon
2014-08-22 17:29 ` Sanford, Robert
[not found] ` <D01CF3B4.28B5%rsanford-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org>
2014-08-22 18:09 ` Robert Sanford
[not found] ` <CA+cr1coJs9yokaDT1ya=5ChSWuSYWiF4TqmAhpcP0qLZKC4odA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-23 15:14 ` Stephen Hemminger
[not found] ` <20140823081453.6e3ae5d7-CA4OZQ/Yy2Lykuyl+CZolw@public.gmane.org>
2014-08-26 16:08 ` Sanford, Robert
[not found] ` <D0222750.29B5%rsanford-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org>
2014-09-01 11:15 ` Thomas Monjalon
2014-09-01 15:07 ` Guillaume Gaudonville
2014-09-01 14:55 ` Guillaume Gaudonville
[not found] ` <540488DD.3030304-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
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-otpzqlsittunbdjkjebofr2eb7je58tq@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.org \
--cc=e_zhumabekov-8EHiFRVJVgQ@public.gmane.org \
--cc=thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.