datapath: remove get_pcpu_ptr
authorPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 16:52:05 +0000 (09:52 -0700)
committerPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 17:25:09 +0000 (10:25 -0700)
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 <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
datapath/actions.c
datapath/linux/compat/include/linux/percpu.h

index ed44ead..fb5fa8a 100644 (file)
@@ -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);
index 871c877..7c346aa 100644 (file)
 #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