From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 83D4C2B9E for ; Wed, 3 May 2017 18:00:21 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2017 09:00:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,284,1491289200"; d="scan'208";a="1164101213" Received: from sivswdev02.ir.intel.com ([10.237.217.46]) by fmsmga002.fm.intel.com with ESMTP; 03 May 2017 09:00:18 -0700 From: Ferruh Yigit To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit , Nicolas Dichtel Date: Wed, 3 May 2017 17:00:16 +0100 Message-Id: <20170503160016.31375-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 May 2017 16:00:23 -0000 build error: .../build/build/lib/librte_eal/linuxapp/kni/igb_main.c:1034:10: error: implicit declaration of function ‘pci_enable_msix’ [-Werror=implicit-function-declaration] 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 --- Cc: 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(+) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c index c0d52db..5f1f3a6 100644 --- 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 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix) 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; } diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index 4abab4a..4c52da3 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3937,4 +3937,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #define HAVE_VF_VLAN_PROTO #endif /* >= 4.9.0, >= SLES12SP3 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) +#define HAVE_PCI_ENABLE_MSIX +#endif + #endif /* _KCOMPAT_H_ */ -- 2.9.3