From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 91B5A592E for ; Fri, 25 Jul 2014 19:36:24 +0200 (CEST) Received: by mail-pa0-f43.google.com with SMTP id lf10so6469702pab.30 for ; Fri, 25 Jul 2014 10:37:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=xkV811Sk2N0exGPQJhPqucCEVClSg+GECqMVu5ctHWM=; b=M8lW3TMb15fxggAdsRY1x2tRo6rWa4f/16WM75ki/FIX5Cev6j4hJ8jNTzDehzH0dX Di1EiqxyxrPXrJrdIr6UY50vg65OpTiTG5HymPgCHXTE3ougwskji5YdkrWeF2DUvKO/ KQPbJq78RgP117QTxSwc1cTGiUuPKstKJo/cbPGh721kVdLGdmO0Ud9+Gtg1oaVUbgzp mR/0dSpnh52OXDK+GTJGcP63/z8p9H+f+usSMUonnoSO/OyRkayJJU8CFIHLz+RJIF9x b2wtV9Hcw4iNuGT3balj8HnElGct6SNhJ9LKK0o/Uou0xwxT5Wu4P4FflR+ZU6mAksG/ j1HQ== X-Gm-Message-State: ALoCoQkYPCSI265gpm6pUziLoRDzW+LKFaoa8yeirzj+mVAFDwcUQnEGL5SqAdZd7BiNEU5Ojo92 X-Received: by 10.68.247.137 with SMTP id ye9mr20328850pbc.69.1406309877165; Fri, 25 Jul 2014 10:37:57 -0700 (PDT) Received: from haswell.linuxnetplumber.net (static-50-53-72-226.bvtn.or.frontiernet.net. [50.53.72.226]) by mx.google.com with ESMTPSA id fx5sm9448852pbb.62.2014.07.25.10.37.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jul 2014 10:37:56 -0700 (PDT) Date: Fri, 25 Jul 2014 10:37:54 -0700 From: Stephen Hemminger To: Thomas Monjalon , Yerden Zhumabekov Message-ID: <20140725103754.5fbec494@haswell.linuxnetplumber.net> In-Reply-To: <20140725103627.4ca989b7@haswell.linuxnetplumber.net> References: <20140725103627.4ca989b7@haswell.linuxnetplumber.net> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 2/2] igb_uio: handle no IRQ fallback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2014 17:36:25 -0000 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 --- 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);