From 82d293555a406207b608191cca822c7207e7d8c5 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 16 Nov 2012 13:20:58 -0800 Subject: [PATCH] datapath: Backport this_cpu_ptr to kernels < 2.6.33 An upstream commit uses this_cpu_ptr for a small performance benefit, so this provides an equivalent to kernels that don't have that function. Signed-off-by: Jesse Gross --- datapath/linux/Modules.mk | 1 + datapath/linux/compat/include/asm/percpu.h | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 datapath/linux/compat/include/asm/percpu.h diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk index 14d23a4af..81556d510 100644 --- a/datapath/linux/Modules.mk +++ b/datapath/linux/Modules.mk @@ -13,6 +13,7 @@ openvswitch_sources += \ linux/compat/time.c \ linux/compat/workqueue.c openvswitch_headers += \ + linux/compat/include/asm/percpu.h \ linux/compat/include/linux/bug.h \ linux/compat/include/linux/compiler.h \ linux/compat/include/linux/compiler-gcc.h \ diff --git a/datapath/linux/compat/include/asm/percpu.h b/datapath/linux/compat/include/asm/percpu.h new file mode 100644 index 000000000..404b93773 --- /dev/null +++ b/datapath/linux/compat/include/asm/percpu.h @@ -0,0 +1,10 @@ +#ifndef __ASM_PERCPU_WRAPPER_H +#define __ASM_PERCPU_WRAPPER_H 1 + +#include_next + +#ifndef this_cpu_ptr +#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id()) +#endif + +#endif -- 2.43.0