From 8e0c599390561feb8b4ea639c2182e9e130fd7b7 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Fri, 19 May 2017 07:39:46 +0200 Subject: [PATCH] fix dkms issues on 4.11 (LP: #1691830) Change-Id: I5b22aa085d3172a294806b62158f0949ef574789 Signed-off-by: Christian Ehrhardt --- .../patches/kni-fix-build-with-kernel-4.11.patch | 82 ++++++++++++++++++++++ .../kni-fix-ethtool-build-with-kernel-4.11.patch | 65 +++++++++++++++++ debian/patches/series | 2 + 3 files changed, 149 insertions(+) create mode 100644 debian/patches/kni-fix-build-with-kernel-4.11.patch create mode 100644 debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch diff --git a/debian/patches/kni-fix-build-with-kernel-4.11.patch b/debian/patches/kni-fix-build-with-kernel-4.11.patch new file mode 100644 index 00000000..73dfe51d --- /dev/null +++ b/debian/patches/kni-fix-build-with-kernel-4.11.patch @@ -0,0 +1,82 @@ +From d4d2380cbb02980bf0334601d9ce6ec5400413f9 Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Tue, 21 Mar 2017 09:54:48 +0000 +Subject: [PATCH] kni: fix build with kernel 4.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +compile error: +.../build/build/lib/librte_eal/linuxapp/kni/kni_net.c:124:6: +error: implicit declaration of function ‘signal_pending’ +[-Werror=implicit-function-declaration] + if (signal_pending(current) || ret_val <= 0) { + ^~~~~~~~~~~~~~ + +Linux 4.11 moves signal function declarations to its own header file: +Linux: 174cd4b1e5fb ("sched/headers: Prepare to move signal wakeup & +sigpending methods from into ") + +Use new header file "linux/sched/signal.h" to fix the build error. + +Cc: stable@dpdk.org + +Reported-by: Jerin Jacob +Signed-off-by: Ferruh Yigit +Tested-by: Jerin Jacob +Tested-by: Pankaj Gupta +--- + lib/librte_eal/linuxapp/kni/compat.h | 6 ++++++ + lib/librte_eal/linuxapp/kni/kni_dev.h | 6 ++++++ + 2 files changed, 12 insertions(+) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=d4d2380cbb02980bf0334601d9ce6ec5400413f9 +Original-Author: Ferruh Yigit +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691830 +Author: Christian Ehrhardt +Last-Update: 2017-05-19 + +diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h +index 78da08e..d96275a 100644 +--- a/lib/librte_eal/linuxapp/kni/compat.h ++++ b/lib/librte_eal/linuxapp/kni/compat.h +@@ -2,6 +2,8 @@ + * Minimal wrappers to allow compiling kni on older kernels. + */ + ++#include ++ + #ifndef RHEL_RELEASE_VERSION + #define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b)) + #endif +@@ -67,3 +69,7 @@ + (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34))) + #undef NET_NAME_UNKNOWN + #endif ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER ++#endif +diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h +index 002e5fa..72385ab 100644 +--- a/lib/librte_eal/linuxapp/kni/kni_dev.h ++++ b/lib/librte_eal/linuxapp/kni/kni_dev.h +@@ -30,9 +30,15 @@ + #endif + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include "compat.h" ++ + #include + #include ++#ifdef HAVE_SIGNAL_FUNCTIONS_OWN_HEADER ++#include ++#else + #include ++#endif + #include + #include + #include +-- +2.7.4 + diff --git a/debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch b/debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch new file mode 100644 index 00000000..cd8c21be --- /dev/null +++ b/debian/patches/kni-fix-ethtool-build-with-kernel-4.11.patch @@ -0,0 +1,65 @@ +From 9fb3cd2c041eeca30b6c46e5d555d857d6096ae7 Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Wed, 3 May 2017 17:00:16 +0100 +Subject: [PATCH] kni: fix ethtool build with kernel 4.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +build error: +.../lib/librte_eal/linuxapp/kni/igb_main.c:1034:10: +error: implicit declaration of function ‘pci_enable_msix’ + err = pci_enable_msix(pdev, + ^~~~~~~~~~~~~~~ + +This build error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option +enabled. + +Following Linux commit removes the pci_enable_msix() +Linux: 4244de1c64de ("PCI: remove pci_enable_msix") + +Switch to pci_enable_msix_range() for kernel > 4.8 since current Linux +igb driver uses this function. + +Signed-off-by: Ferruh Yigit +Acked-by: Nicolas Dichtel +--- + lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++ + lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++ + 2 files changed, 11 insertions(+) + +Origin: http://dpdk.org/browse/dpdk/commit/?id=9fb3cd2c041eeca30b6c46e5d555d857d6096ae7 +Original-Author: Ferruh Yigit +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691830 +Author: Christian Ehrhardt +Last-Update: 2017-05-19 + +--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c ++++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +@@ -1031,8 +1031,15 @@ + for (i = 0; i < numvecs; i++) + adapter->msix_entries[i].entry = i; + ++#ifdef HAVE_PCI_ENABLE_MSIX + err = pci_enable_msix(pdev, + adapter->msix_entries, numvecs); ++#else ++ err = pci_enable_msix_range(pdev, ++ adapter->msix_entries, ++ numvecs, ++ numvecs); ++#endif + if (err == 0) + break; + } +--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h ++++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +@@ -3933,4 +3933,8 @@ + #define HAVE_VF_VLAN_PROTO + #endif /* >= 4.9.0 */ + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) ++#define HAVE_PCI_ENABLE_MSIX ++#endif ++ + #endif /* _KCOMPAT_H_ */ diff --git a/debian/patches/series b/debian/patches/series index 89f11d64..878e9259 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,3 +12,5 @@ nicvf-0007-net-thunderx-disable-PMD-for-old-compilers.patch nicvf-0008-net-thunderx-fix-stats-access-out-of-bounds.patch nicvf-0009-config-set-cache-line-as-128B-for-generic-arm64.patch nicvf-0010-net-thunderx-fix-deadlock-in-Rx-path.patch +kni-fix-build-with-kernel-4.11.patch +kni-fix-ethtool-build-with-kernel-4.11.patch -- 2.16.6