Current autoconfig detection logic for HAVE_PER_CPU_PTR is not robust.
Depends on linux kernel version, the definition can be in either
linux/percpu.h or asm/percpu.h
Turns out it is simpler and safer to handle missing percpu.h
definitions in linux/percpu.h rather than asm/percpu.h. With this
change, there is no need for the autoconfig detection logic above.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD],
[OVS_DEFINE([HAVE_VLAN_BUG_WORKAROUND])])
- OVS_GREP_IFELSE([$KSRC/include/linux/percpu.h], [this_cpu_ptr])
-
OVS_GREP_IFELSE([$KSRC/include/linux/u64_stats_sync.h], [u64_stats_fetch_begin_irq])
OVS_GREP_IFELSE([$KSRC/include/linux/openvswitch.h], [openvswitch_handle_frame_hook],
openvswitch_headers += \
linux/compat/gso.h \
linux/compat/include/asm/hash.h \
- linux/compat/include/asm/percpu.h \
linux/compat/include/linux/percpu.h \
linux/compat/include/linux/bug.h \
linux/compat/include/linux/compiler.h \
+++ /dev/null
-#ifndef __ASM_PERCPU_WRAPPER_H
-#define __ASM_PERCPU_WRAPPER_H 1
-
-#include_next <asm/percpu.h>
-
-#if !defined this_cpu_ptr && !defined HAVE_THIS_CPU_PTR
-#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id())
-#endif
-
-#endif
#include_next <linux/percpu.h>
+#if !defined this_cpu_ptr
+#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id())
+#endif
+
#if !defined this_cpu_read
#define this_cpu_read(ptr) percpu_read(ptr)
#endif