From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3359FA320B for ; Mon, 21 Oct 2019 13:16:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 64A361BEC1; Mon, 21 Oct 2019 13:16:38 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 7CB951BEB3 for ; Mon, 21 Oct 2019 13:16:37 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iMVfx-0006Ac-Bt; Mon, 21 Oct 2019 11:16:37 +0000 From: Christian Ehrhardt To: Luca Boccassi , dpdk stable Cc: Thomas Monjalon , Christian Ehrhardt Date: Mon, 21 Oct 2019 13:16:33 +0200 Message-Id: <20191021111634.15500-3-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191021111634.15500-1-christian.ehrhardt@canonical.com> References: <20191021111634.15500-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 2/3] kni: fix kernel 5.4 build - num_online_cpus X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" num_online_cpus was redefined [1] to now be a static inline function. Due to that the check we had to redefine num_online_cpus as needed triggers as false-positive and breaks like: /usr/src/dpdk-rte-kni-18.11.2/ethtool/ixgbe/kcompat.h:239:27: error: ‘smp_num_cpus’ undeclared (first use in this function) 239 | #define num_online_cpus() smp_num_cpus That redefine isn't needed for ages, and with >5.4 we can just rely on it. From the kernel it already is either a working function or defined as 1UL in case of non SMP. Not applying to master branch due to kni ethtool being removed in [2] [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0c09ab96 [2]: https://git.dpdk.org/dpdk/commit/?id=ea6b39b Signed-off-by: Christian Ehrhardt --- kernel/linux/kni/ethtool/igb/kcompat.h | 2 ++ kernel/linux/kni/ethtool/ixgbe/kcompat.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h index 74390aa5f..964317508 100644 --- a/kernel/linux/kni/ethtool/igb/kcompat.h +++ b/kernel/linux/kni/ethtool/igb/kcompat.h @@ -218,9 +218,11 @@ struct msix_entry { #define node_online(node) ((node) == 0) #endif +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) ) #ifndef num_online_cpus #define num_online_cpus() smp_num_cpus #endif +#endif #ifndef cpu_online #define cpu_online(cpuid) test_bit((cpuid), &cpu_online_map) diff --git a/kernel/linux/kni/ethtool/ixgbe/kcompat.h b/kernel/linux/kni/ethtool/ixgbe/kcompat.h index 64d39a7ae..e1671e91a 100644 --- a/kernel/linux/kni/ethtool/ixgbe/kcompat.h +++ b/kernel/linux/kni/ethtool/ixgbe/kcompat.h @@ -235,9 +235,11 @@ struct msix_entry { #define node_online(node) ((node) == 0) #endif +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) ) #ifndef num_online_cpus #define num_online_cpus() smp_num_cpus #endif +#endif #ifndef cpu_online #define cpu_online(cpuid) test_bit((cpuid), &cpu_online_map) -- 2.23.0