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>
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
#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);