summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-10-21 13:16:33 +0200
committerKevin Traynor <ktraynor@redhat.com>2019-10-22 14:01:54 +0100
commitce6dbecb12d3bbcf33162cda669b6e4bbd3214b2 (patch)
tree720cbcc9e3d62d115e17adfda6931517aede90d4
parent6c91b0a6422d0e040e6e048310f12421e57a1c7c (diff)
downloaddpdk-stable-ce6dbecb12d3bbcf33162cda669b6e4bbd3214b2.zip
dpdk-stable-ce6dbecb12d3bbcf33162cda669b6e4bbd3214b2.tar.gz
dpdk-stable-ce6dbecb12d3bbcf33162cda669b6e4bbd3214b2.tar.xz
kni: fix kernel 5.4 build - num_online_cpus
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 <christian.ehrhardt@canonical.com> Acked-by: Luca Boccassi <bluca@debian.org>
-rw-r--r--kernel/linux/kni/ethtool/igb/kcompat.h2
-rw-r--r--kernel/linux/kni/ethtool/ixgbe/kcompat.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index 74390aa..9643175 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 64d39a7..e1671e9 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)