Set +x on debian/rules
[deb_dpdk.git] / debian / patches / kni-fix-ethtool-build-with-kernel-4.11.patch
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
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 build error:
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,
13               ^~~~~~~~~~~~~~~
14
15 This build error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option
16 enabled.
17
18 Following Linux commit removes the pci_enable_msix()
19 Linux: 4244de1c64de ("PCI: remove pci_enable_msix")
20
21 Switch to pci_enable_msix_range() for kernel > 4.8 since current Linux
22 igb driver uses this function.
23
24 Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
25 Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
26 ---
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(+)
30
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
36
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;
42  
43 +#ifdef HAVE_PCI_ENABLE_MSIX
44                         err = pci_enable_msix(pdev,
45                                               adapter->msix_entries, numvecs);
46 +#else
47 +                       err = pci_enable_msix_range(pdev,
48 +                                       adapter->msix_entries,
49 +                                       numvecs,
50 +                                       numvecs);
51 +#endif
52                         if (err == 0)
53                                 break;
54                 }
55 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
56 +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
57 @@ -3933,4 +3933,8 @@
58  #define HAVE_VF_VLAN_PROTO
59  #endif /* >= 4.9.0 */
60  
61 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
62 +#define HAVE_PCI_ENABLE_MSIX
63 +#endif
64 +
65  #endif /* _KCOMPAT_H_ */