1 From 9fb3cd2c041eeca30b6c46e5d555d857d6096ae7 Mon Sep 17 00:00:00 2001
2 From: Ferruh Yigit <ferruh.yigit@intel.com>
3 Date: Wed, 3 May 2017 17:00:16 +0100
4 Subject: [PATCH] kni: fix ethtool build with kernel 4.11
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
10 .../lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
11 error: implicit declaration of function ‘pci_enable_msix’
12 err = pci_enable_msix(pdev,
15 This build error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option
18 Following Linux commit removes the pci_enable_msix()
19 Linux: 4244de1c64de ("PCI: remove pci_enable_msix")
21 Switch to pci_enable_msix_range() for kernel > 4.8 since current Linux
22 igb driver uses this function.
24 Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
25 Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
27 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++
28 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++
29 2 files changed, 11 insertions(+)
31 Origin: http://dpdk.org/browse/dpdk/commit/?id=9fb3cd2c041eeca30b6c46e5d555d857d6096ae7
32 Original-Author: Ferruh Yigit <ferruh.yigit@intel.com>
33 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1691830
34 Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
35 Last-Update: 2017-05-19
37 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
38 +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
39 @@ -1031,8 +1031,15 @@
40 for (i = 0; i < numvecs; i++)
41 adapter->msix_entries[i].entry = i;
43 +#ifdef HAVE_PCI_ENABLE_MSIX
44 err = pci_enable_msix(pdev,
45 adapter->msix_entries, numvecs);
47 + err = pci_enable_msix_range(pdev,
48 + adapter->msix_entries,
55 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
56 +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
58 #define HAVE_VF_VLAN_PROTO
61 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
62 +#define HAVE_PCI_ENABLE_MSIX
65 #endif /* _KCOMPAT_H_ */