From patchwork Thu Aug 31 21:46:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 28196 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id EE758378E; Thu, 31 Aug 2017 23:47:29 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by dpdk.org (Postfix) with ESMTP id CF4582C17 for ; Thu, 31 Aug 2017 23:47:23 +0200 (CEST) Received: from thunderstorm.prakinf.tu-ilmenau.de (thunderstorm.prakinf.tu-ilmenau.de [141.24.212.108]) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPA id 33D2B5802AA; Thu, 31 Aug 2017 23:47:23 +0200 (CEST) From: Markus Theil To: dev@dpdk.org Cc: ferruh.yigit@intel.com, stephen@networkplumber.org, Markus Theil , nicolas.dichtel@6wind.com Date: Thu, 31 Aug 2017 23:46:57 +0200 Message-Id: <1504216020-16067-2-git-send-email-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504216020-16067-1-git-send-email-markus.theil@tu-ilmenau.de> References: <1504174949-25656-3-git-send-email-markus.theil@tu-ilmenau.de> <1504216020-16067-1-git-send-email-markus.theil@tu-ilmenau.de> Subject: [dpdk-dev] [PATCH v5 2/5] igb_uio: fix irq disable on recent kernels X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" igb_uio already allocates irqs using pci_alloc_irq_vectors on recent kernels >= 4.8. The interrupt disable code was not using the corresponding pci_free_irq_vectors, but the also deprecated pci_disable_msix, before this fix. Fixes: 99bb58f3adc7 ("igb_uio: switch to new irq function for MSI-X") Cc: nicolas.dichtel@6wind.com Signed-off-by: Markus Theil --- lib/librte_eal/linuxapp/igb_uio/compat.h | 4 ++-- lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/linuxapp/igb_uio/compat.h b/lib/librte_eal/linuxapp/igb_uio/compat.h index b800a53..3825933 100644 --- a/lib/librte_eal/linuxapp/igb_uio/compat.h +++ b/lib/librte_eal/linuxapp/igb_uio/compat.h @@ -124,6 +124,6 @@ static bool pci_check_and_mask_intx(struct pci_dev *pdev) #endif /* < 3.3.0 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) -#define HAVE_PCI_ENABLE_MSIX +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) +#define HAVE_ALLOC_IRQ_VECTORS 1 #endif diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index e2e9263..93bb71d 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -312,14 +312,14 @@ static int igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev) { int err = 0; -#ifdef HAVE_PCI_ENABLE_MSIX +#ifndef HAVE_ALLOC_IRQ_VECTORS struct msix_entry msix_entry; #endif switch (igbuio_intr_mode_preferred) { case RTE_INTR_MODE_MSIX: /* Only 1 msi-x vector needed */ -#ifdef HAVE_PCI_ENABLE_MSIX +#ifndef HAVE_ALLOC_IRQ_VECTORS msix_entry.entry = 0; if (pci_enable_msix(udev->pdev, &msix_entry, 1) == 0) { dev_dbg(&udev->pdev->dev, "using MSI-X"); @@ -364,8 +364,13 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev) static void igbuio_pci_disable_interrupts(struct rte_uio_pci_dev *udev) { +#ifndef HAVE_ALLOC_IRQ_VECTORS if (udev->mode == RTE_INTR_MODE_MSIX) pci_disable_msix(udev->pdev); +#else + if (udev->mode == RTE_INTR_MODE_MSIX) + pci_free_irq_vectors(udev->pdev); +#endif } static int