From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Luca Boccassi <bluca@debian.org>, dpdk stable <stable@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
Christian Ehrhardt <christian.ehrhardt@canonical.com>
Subject: [dpdk-stable] [PATCH 2/3] kni: fix kernel 5.4 build - num_online_cpus
Date: Mon, 21 Oct 2019 13:16:33 +0200 [thread overview]
Message-ID: <20191021111634.15500-3-christian.ehrhardt@canonical.com> (raw)
In-Reply-To: <20191021111634.15500-1-christian.ehrhardt@canonical.com>
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>
---
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
next prev parent reply other threads:[~2019-10-21 11:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 11:16 [dpdk-stable] [PATCH 0/3] kni: fix kernel 5.4 builds Christian Ehrhardt
2019-10-21 11:16 ` [dpdk-stable] [PATCH 1/3] kni: fix kernel 5.4 build - merged pci_aspm.h Christian Ehrhardt
2019-10-21 11:16 ` Christian Ehrhardt [this message]
2019-10-21 11:16 ` [dpdk-stable] [PATCH 3/3] kni: fix kernel 5.4 build - skb_frag_t to bio_vec Christian Ehrhardt
2019-10-21 17:30 ` [dpdk-stable] [PATCH 0/3] kni: fix kernel 5.4 builds Luca Boccassi
2019-10-24 15:58 ` Kevin Traynor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191021111634.15500-3-christian.ehrhardt@canonical.com \
--to=christian.ehrhardt@canonical.com \
--cc=bluca@debian.org \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).