From e9326797e5146a066432bdfa51498ec9992cf376 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Sun, 17 Jul 2016 09:52:05 -0700 Subject: [PATCH] datapath: remove get_pcpu_ptr There is no need to support old kernel so now we can use newer api to access per cpu data. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- datapath/actions.c | 4 ++-- datapath/linux/compat/include/linux/percpu.h | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/datapath/actions.c b/datapath/actions.c index ed44ead94..fb5fa8a95 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -622,7 +622,7 @@ static int set_sctp(struct sk_buff *skb, struct sw_flow_key *flow_key, static int ovs_vport_output(OVS_VPORT_OUTPUT_PARAMS) { - struct ovs_frag_data *data = get_pcpu_ptr(ovs_frag_data_storage); + struct ovs_frag_data *data = this_cpu_ptr(&ovs_frag_data_storage); struct vport *vport = data->vport; if (skb_cow_head(skb, data->l2_len) < 0) { @@ -665,7 +665,7 @@ static void prepare_frag(struct vport *vport, struct sk_buff *skb) unsigned int hlen = skb_network_offset(skb); struct ovs_frag_data *data; - data = get_pcpu_ptr(ovs_frag_data_storage); + data = this_cpu_ptr(&ovs_frag_data_storage); data->dst = (unsigned long) skb_dst(skb); data->vport = vport; data->cb = *OVS_GSO_CB(skb); diff --git a/datapath/linux/compat/include/linux/percpu.h b/datapath/linux/compat/include/linux/percpu.h index 871c877e4..7c346aa31 100644 --- a/datapath/linux/compat/include/linux/percpu.h +++ b/datapath/linux/compat/include/linux/percpu.h @@ -25,12 +25,6 @@ #define this_cpu_dec(ptr) percpu_sub(ptr, 1) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) -#define get_pcpu_ptr(name) ((void *)this_cpu_ptr(&__pcpu_unique_##name)) -#else -#define get_pcpu_ptr(name) (this_cpu_ptr(&name)) -#endif - #ifndef alloc_percpu_gfp #define NEED_ALLOC_PERCPU_GFP -- 2.20.1