[ovs-dev] [PATCH 1/2] compat: Fix RHEL 7 compile

Greg Rose gvrose8192 at gmail.com
Mon Feb 26 22:10:15 UTC 2018


frag_percpu_counter_batch is a variable, not a define, so checking if
it is defined is an error and causes warning messages during compile
on RHEL 7 (or other 3.10 based) builds.  Use a compat #define from
acinclude.m4 instead.

Fixes: 64d8cb7295 ("compat:inet_frag.h: Check for frag_percpu_counter_batch")
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
---
 acinclude.m4                                  | 4 ++++
 datapath/linux/compat/include/net/inet_frag.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index b5f62cc..d61e37a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -811,6 +811,10 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/timekeeping.h],
                   [ktime_get_ns],
                   [OVS_DEFINE([HAVE_KTIME_GET_NS])])
+  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h],
+                  frag_percpu_counter_batch[],
+                  [OVS_DEFINE([HAVE_FRAG_PERCPU_COUNTER_BATCH])])
+
 
   if cmp -s datapath/linux/kcompat.h.new \
             datapath/linux/kcompat.h >/dev/null 2>&1; then
diff --git a/datapath/linux/compat/include/net/inet_frag.h b/datapath/linux/compat/include/net/inet_frag.h
index 4090886..124c8be 100644
--- a/datapath/linux/compat/include/net/inet_frag.h
+++ b/datapath/linux/compat/include/net/inet_frag.h
@@ -30,7 +30,7 @@ static inline bool inet_frag_evicting(struct inet_frag_queue *q)
 #endif
 
 #ifndef HAVE_SUB_FRAG_MEM_LIMIT_ARG_STRUCT_NETNS_FRAGS
-#ifdef frag_percpu_counter_batch
+#ifdef HAVE_FRAG_PERCPU_COUNTER_BATCH
 static inline void rpl_sub_frag_mem_limit(struct netns_frags *nf, int i)
 {
 	__percpu_counter_add(&nf->mem, -i, frag_percpu_counter_batch);
-- 
1.8.3.1



More information about the dev mailing list