From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B8BBE37A2 for ; Wed, 19 Apr 2017 20:33:55 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 11:33:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,222,1488873600"; d="scan'208";a="91818275" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.59]) ([10.237.220.59]) by fmsmga006.fm.intel.com with ESMTP; 19 Apr 2017 11:33:52 -0700 To: Nicolas Dichtel , dev@dpdk.org Cc: david.marchand@6wind.com References: <20170413145632.4214-1-nicolas.dichtel@6wind.com> From: Ferruh Yigit Message-ID: Date: Wed, 19 Apr 2017 19:33:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <20170413145632.4214-1-nicolas.dichtel@6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] igb_uio: switch to pci_alloc_irq_vectors() 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: , X-List-Received-Date: Wed, 19 Apr 2017 18:33:56 -0000 On 4/13/2017 3:56 PM, Nicolas Dichtel wrote: > pci_enable_msix() will be removed in kernel 4.12. The new API is available since > linux 4.8, thus let's use it. > > Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aff171641d18 > Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=4244de1c64de > Signed-off-by: Nicolas Dichtel > Reviewed-by: David Marchand > --- > lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > index 192bd4a96b68..b50e0f8b0457 100644 > --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > @@ -325,7 +325,9 @@ static int > igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) > { > struct rte_uio_pci_dev *udev; > +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) > struct msix_entry msix_entry; > +#endif > dma_addr_t map_dma_addr; > void *map_addr; > int err; > @@ -381,6 +383,7 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) > switch (igbuio_intr_mode_preferred) { > case RTE_INTR_MODE_MSIX: > /* Only 1 msi-x vector needed */ > +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) Hi Nicolas, Overall patch looks good, thanks. Only can you please use compat.h for version check, instead of doing in c file? Thanks, ferruh > msix_entry.entry = 0; > if (pci_enable_msix(dev, &msix_entry, 1) == 0) { > dev_dbg(&dev->dev, "using MSI-X"); > @@ -389,6 +392,14 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) > udev->mode = RTE_INTR_MODE_MSIX; > break; > } > +#else > + if (pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSIX) == 1) { > + dev_dbg(&dev->dev, "using MSI-X"); > + udev->info.irq = pci_irq_vector(dev, 0); > + udev->mode = RTE_INTR_MODE_MSIX; > + break; > + } > +#endif > /* fall back to INTX */ > case RTE_INTR_MODE_LEGACY: > if (pci_intx_mask_supported(dev)) { >