]> git.proxmox.com Git - ovs.git/commitdiff
compat: Fix RHEL 7 compile
authorGreg Rose <gvrose8192@gmail.com>
Mon, 26 Feb 2018 22:10:15 +0000 (14:10 -0800)
committerPravin B Shelar <pshelar@ovn.org>
Wed, 28 Feb 2018 03:45:19 +0000 (19:45 -0800)
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@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
acinclude.m4
datapath/linux/compat/include/net/inet_frag.h

index b5f62ccc75ff027a6f9839acd15375982d583dbc..d61e37a5eb7a68e001a06d517902a551304bec19 100644 (file)
@@ -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
index 40908860f93f6f2e5777c548c1f5a6183ef640ec..124c8bea7c5698fa08fb1909e1bc8f671d866a7a 100644 (file)
@@ -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);