aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-06-27 16:17:52 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-06-27 16:17:52 +0200
commit50dfac14fc0f3e4a463cfc58dd84e89f4be09350 (patch)
tree4c807f83a32ef85f1e0bcc352d7453f1675fb6ab
parente17e83e3a136be1a66eb1b580a4f049912b81657 (diff)
igb_uio: switch to new irq function for MSI-X (LP: #1700768)
Change-Id: Iadfdf28cb6518b57c07b73e9a0c88efbda2ba800 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
-rw-r--r--debian/patches/igb_uio-switch-to-new-irq-function-for-MSI-X.patch74
-rw-r--r--debian/patches/series1
2 files changed, 75 insertions, 0 deletions
diff --git a/debian/patches/igb_uio-switch-to-new-irq-function-for-MSI-X.patch b/debian/patches/igb_uio-switch-to-new-irq-function-for-MSI-X.patch
new file mode 100644
index 00000000..4cfdced6
--- /dev/null
+++ b/debian/patches/igb_uio-switch-to-new-irq-function-for-MSI-X.patch
@@ -0,0 +1,74 @@
+Description: igb_uio: switch to new irq function for MSI-X
+
+From 99bb58f3adc73046b538874a0944578146ee1189 Mon Sep 17 00:00:00 2001
+From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
+Date: Thu, 20 Apr 2017 15:11:23 +0200
+Subject: [PATCH] igb_uio: switch to new irq function for MSI-X
+
+pci_enable_msix() will be removed in kernel 4.12.
+The new API pci_alloc_irq_vectors() 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 <nicolas.dichtel@6wind.com>
+Reviewed-by: David Marchand <david.marchand@6wind.com>
+Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
+---
+ lib/librte_eal/linuxapp/igb_uio/compat.h | 4 ++++
+ lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 11 +++++++++++
+ 2 files changed, 15 insertions(+)
+
+Forwarded: no (backport)
+Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
+Original-Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>
+Origin: http://dpdk.org/browse/dpdk/commit/?id=99bb58f3adc73046b538874a0944578146ee1189
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1700768
+Patch-Name: debian/patches/igb_uio-switch-to-new-irq-function-for-MSI-X.patch
+Last-Update: 2017-06-27
+--- a/lib/librte_eal/linuxapp/igb_uio/compat.h
++++ b/lib/librte_eal/linuxapp/igb_uio/compat.h
+@@ -123,3 +123,7 @@
+ }
+
+ #endif /* < 3.3.0 */
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
++#define HAVE_PCI_ENABLE_MSIX
++#endif
+--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
++++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+@@ -325,7 +325,9 @@
+ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+ {
+ struct rte_uio_pci_dev *udev;
++#ifdef HAVE_PCI_ENABLE_MSIX
+ struct msix_entry msix_entry;
++#endif
+ int err;
+
+ udev = kzalloc(sizeof(struct rte_uio_pci_dev), GFP_KERNEL);
+@@ -379,6 +381,7 @@
+ switch (igbuio_intr_mode_preferred) {
+ case RTE_INTR_MODE_MSIX:
+ /* Only 1 msi-x vector needed */
++#ifdef HAVE_PCI_ENABLE_MSIX
+ msix_entry.entry = 0;
+ if (pci_enable_msix(dev, &msix_entry, 1) == 0) {
+ dev_dbg(&dev->dev, "using MSI-X");
+@@ -386,6 +389,14 @@
+ 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)) {
diff --git a/debian/patches/series b/debian/patches/series
index a104d100..e57a6614 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ nicvf-0005-net-thunderx-wait-to-complete-during-link-update.patch
nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch
nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch
kni-fix-ethtool-build-with-kernel-4.11.patch
+igb_uio-switch-to-new-irq-function-for-MSI-X.patch