1 Description: igb_uio: switch to new irq function for MSI-X
3 From 99bb58f3adc73046b538874a0944578146ee1189 Mon Sep 17 00:00:00 2001
4 From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
5 Date: Thu, 20 Apr 2017 15:11:23 +0200
6 Subject: [PATCH] igb_uio: switch to new irq function for MSI-X
8 pci_enable_msix() will be removed in kernel 4.12.
9 The new API pci_alloc_irq_vectors() is available
10 since linux 4.8, thus let's use it.
12 Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aff171641d18
13 Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=4244de1c64de
15 Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
16 Reviewed-by: David Marchand <david.marchand@6wind.com>
17 Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
19 lib/librte_eal/linuxapp/igb_uio/compat.h | 4 ++++
20 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 11 +++++++++++
21 2 files changed, 15 insertions(+)
23 Forwarded: no (backport)
24 Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
25 Original-Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>
26 Origin: http://dpdk.org/browse/dpdk/commit/?id=99bb58f3adc73046b538874a0944578146ee1189
27 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1700768
28 Patch-Name: debian/patches/igb_uio-switch-to-new-irq-function-for-MSI-X.patch
29 Last-Update: 2017-06-27
30 --- a/lib/librte_eal/linuxapp/igb_uio/compat.h
31 +++ b/lib/librte_eal/linuxapp/igb_uio/compat.h
37 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
38 +#define HAVE_PCI_ENABLE_MSIX
40 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
41 +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
43 igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
45 struct rte_uio_pci_dev *udev;
46 +#ifdef HAVE_PCI_ENABLE_MSIX
47 struct msix_entry msix_entry;
51 udev = kzalloc(sizeof(struct rte_uio_pci_dev), GFP_KERNEL);
53 switch (igbuio_intr_mode_preferred) {
54 case RTE_INTR_MODE_MSIX:
55 /* Only 1 msi-x vector needed */
56 +#ifdef HAVE_PCI_ENABLE_MSIX
58 if (pci_enable_msix(dev, &msix_entry, 1) == 0) {
59 dev_dbg(&dev->dev, "using MSI-X");
61 udev->mode = RTE_INTR_MODE_MSIX;
65 + if (pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSIX) == 1) {
66 + dev_dbg(&dev->dev, "using MSI-X");
67 + udev->info.irq = pci_irq_vector(dev, 0);
68 + udev->mode = RTE_INTR_MODE_MSIX;
72 /* fall back to INTX */
73 case RTE_INTR_MODE_LEGACY:
74 if (pci_intx_mask_supported(dev)) {