diff options
| author | Christoph Lameter <cl@linux.com> | 2014-08-17 13:30:35 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2014-08-26 13:45:47 -0400 |
| commit | 903ceff7ca7b4d80c083a80ee5163b74e9fa359f (patch) | |
| tree | 60c82f70f9d58720042bb3249eb6fa9f89fe9025 | |
| parent | f7f66b05aa2ac2632c5441a3f129f3be827fe7e7 (diff) | |
net: Replace get_cpu_var through this_cpu_ptr
Replace uses of get_cpu_var for address calculation through this_cpu_ptr.
Cc: netdev@vger.kernel.org
Cc: Eric Dumazet <edumazet@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
| -rw-r--r-- | include/net/netfilter/nf_conntrack.h | 2 | ||||
| -rw-r--r-- | include/net/snmp.h | 6 | ||||
| -rw-r--r-- | net/core/dev.c | 14 | ||||
| -rw-r--r-- | net/core/drop_monitor.c | 2 | ||||
| -rw-r--r-- | net/core/skbuff.c | 2 | ||||
| -rw-r--r-- | net/ipv4/route.c | 4 | ||||
| -rw-r--r-- | net/ipv4/syncookies.c | 2 | ||||
| -rw-r--r-- | net/ipv4/tcp.c | 2 | ||||
| -rw-r--r-- | net/ipv4/tcp_output.c | 2 | ||||
| -rw-r--r-- | net/ipv6/syncookies.c | 2 | ||||
| -rw-r--r-- | net/rds/ib_rdma.c | 2 |
11 files changed, 20 insertions, 20 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 37252f71a380..c8a7db605e03 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
| @@ -242,7 +242,7 @@ extern s32 (*nf_ct_nat_offset)(const struct nf_conn *ct, | |||
| 242 | DECLARE_PER_CPU(struct nf_conn, nf_conntrack_untracked); | 242 | DECLARE_PER_CPU(struct nf_conn, nf_conntrack_untracked); |
| 243 | static inline struct nf_conn *nf_ct_untracked_get(void) | 243 | static inline struct nf_conn *nf_ct_untracked_get(void) |
| 244 | { | 244 | { |
| 245 | return &__raw_get_cpu_var(nf_conntrack_untracked); | 245 | return raw_cpu_ptr(&nf_conntrack_untracked); |
| 246 | } | 246 | } |
| 247 | void nf_ct_untracked_status_or(unsigned long bits); | 247 | void nf_ct_untracked_status_or(unsigned long bits); |
| 248 | 248 | ||
diff --git a/include/net/snmp.h b/include/net/snmp.h index f1f27fdbb0d5..e154133877a2 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
| @@ -168,7 +168,7 @@ struct linux_xfrm_mib { | |||
| 168 | 168 | ||
| 169 | #define SNMP_ADD_STATS64_BH(mib, field, addend) \ | 169 | #define SNMP_ADD_STATS64_BH(mib, field, addend) \ |
| 170 | do { \ | 170 | do { \ |
| 171 | __typeof__(*mib) *ptr = __this_cpu_ptr(mib); \ | 171 | __typeof__(*mib) *ptr = raw_cpu_ptr(mib); \ |
| 172 | u64_stats_update_begin(&ptr->syncp); \ | 172 | u64_stats_update_begin(&ptr->syncp); \ |
| 173 | ptr->mibs[field] += addend; \ | 173 | ptr->mibs[field] += addend; \ |
| 174 | u64_stats_update_end(&ptr->syncp); \ | 174 | u64_stats_update_end(&ptr->syncp); \ |
| @@ -189,8 +189,8 @@ struct linux_xfrm_mib { | |||
| 189 | #define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) | 189 | #define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) |
| 190 | #define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \ | 190 | #define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \ |
| 191 | do { \ | 191 | do { \ |
| 192 | __typeof__(*mib) *ptr; \ | 192 | __typeof__(*mib) *ptr; \ |
| 193 | ptr = __this_cpu_ptr(mib); \ | 193 | ptr = raw_cpu_ptr((mib)); \ |
| 194 | u64_stats_update_begin(&ptr->syncp); \ | 194 | u64_stats_update_begin(&ptr->syncp); \ |
| 195 | ptr->mibs[basefield##PKTS]++; \ | 195 | ptr->mibs[basefield##PKTS]++; \ |
| 196 | ptr->mibs[basefield##OCTETS] += addend; \ | 196 | ptr->mibs[basefield##OCTETS] += addend; \ |
diff --git a/net/core/dev.c b/net/core/dev.c index b65a5051361f..9ef13ff354fe 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2153,7 +2153,7 @@ static inline void __netif_reschedule(struct Qdisc *q) | |||
| 2153 | unsigned long flags; | 2153 | unsigned long flags; |
| 2154 | 2154 | ||
| 2155 | local_irq_save(flags); | 2155 | local_irq_save(flags); |
| 2156 | sd = &__get_cpu_var(softnet_data); | 2156 | sd = this_cpu_ptr(&softnet_data); |
| 2157 | q->next_sched = NULL; | 2157 | q->next_sched = NULL; |
| 2158 | *sd->output_queue_tailp = q; | 2158 | *sd->output_queue_tailp = q; |
| 2159 | sd->output_queue_tailp = &q->next_sched; | 2159 | sd->output_queue_tailp = &q->next_sched; |
| @@ -3195,7 +3195,7 @@ static void rps_trigger_softirq(void *data) | |||
| 3195 | static int rps_ipi_queued(struct softnet_data *sd) | 3195 | static int rps_ipi_queued(struct softnet_data *sd) |
| 3196 | { | 3196 | { |
| 3197 | #ifdef CONFIG_RPS | 3197 | #ifdef CONFIG_RPS |
| 3198 | struct softnet_data *mysd = &__get_cpu_var(softnet_data); | 3198 | struct softnet_data *mysd = this_cpu_ptr(&softnet_data); |
| 3199 | 3199 | ||
| 3200 | if (sd != mysd) { | 3200 | if (sd != mysd) { |
| 3201 | sd->rps_ipi_next = mysd->rps_ipi_list; | 3201 | sd->rps_ipi_next = mysd->rps_ipi_list; |
| @@ -3222,7 +3222,7 @@ static bool skb_flow_limit(struct sk_buff *skb, unsigned int qlen) | |||
| 3222 | if (qlen < (netdev_max_backlog >> 1)) | 3222 | if (qlen < (netdev_max_backlog >> 1)) |
| 3223 | return false; | 3223 | return false; |
| 3224 | 3224 | ||
| 3225 | sd = &__get_cpu_var(softnet_data); | 3225 | sd = this_cpu_ptr(&softnet_data); |
| 3226 | 3226 | ||
| 3227 | rcu_read_lock(); | 3227 | rcu_read_lock(); |
| 3228 | fl = rcu_dereference(sd->flow_limit); | 3228 | fl = rcu_dereference(sd->flow_limit); |
| @@ -3369,7 +3369,7 @@ EXPORT_SYMBOL(netif_rx_ni); | |||
| 3369 | 3369 | ||
| 3370 | static void net_tx_action(struct softirq_action *h) | 3370 | static void net_tx_action(struct softirq_action *h) |
| 3371 | { | 3371 | { |
| 3372 | struct softnet_data *sd = &__get_cpu_var(softnet_data); | 3372 | struct softnet_data *sd = this_cpu_ptr(&softnet_data); |
| 3373 | 3373 | ||
| 3374 | if (sd->completion_queue) { | 3374 | if (sd->completion_queue) { |
| 3375 | struct sk_buff *clist; | 3375 | struct sk_buff *clist; |
| @@ -3794,7 +3794,7 @@ EXPORT_SYMBOL(netif_receive_skb); | |||
| 3794 | static void flush_backlog(void *arg) | 3794 | static void flush_backlog(void *arg) |
| 3795 | { | 3795 | { |
| 3796 | struct net_device *dev = arg; | 3796 | struct net_device *dev = arg; |
| 3797 | struct softnet_data *sd = &__get_cpu_var(softnet_data); | 3797 | struct softnet_data *sd = this_cpu_ptr(&softnet_data); |
| 3798 | struct sk_buff *skb, *tmp; | 3798 | struct sk_buff *skb, *tmp; |
| 3799 | 3799 | ||
| 3800 | rps_lock(sd); | 3800 | rps_lock(sd); |
| @@ -4301,7 +4301,7 @@ void __napi_schedule(struct napi_struct *n) | |||
| 4301 | unsigned long flags; | 4301 | unsigned long flags; |
| 4302 | 4302 | ||
| 4303 | local_irq_save(flags); | 4303 | local_irq_save(flags); |
| 4304 | ____napi_schedule(&__get_cpu_var(softnet_data), n); | 4304 | ____napi_schedule(this_cpu_ptr(&softnet_data), n); |
| 4305 | local_irq_restore(flags); | 4305 | local_irq_restore(flags); |
| 4306 | } | 4306 | } |
| 4307 | EXPORT_SYMBOL(__napi_schedule); | 4307 | EXPORT_SYMBOL(__napi_schedule); |
| @@ -4422,7 +4422,7 @@ EXPORT_SYMBOL(netif_napi_del); | |||
| 4422 | 4422 | ||
| 4423 | static void net_rx_action(struct softirq_action *h) | 4423 | static void net_rx_action(struct softirq_action *h) |
| 4424 | { | 4424 | { |
| 4425 | struct softnet_data *sd = &__get_cpu_var(softnet_data); | 4425 | struct softnet_data *sd = this_cpu_ptr(&softnet_data); |
| 4426 | unsigned long time_limit = jiffies + 2; | 4426 | unsigned long time_limit = jiffies + 2; |
| 4427 | int budget = netdev_budget; | 4427 | int budget = netdev_budget; |
| 4428 | void *have; | 4428 | void *have; |
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 50f9a9db5792..252e155c837b 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
| @@ -146,7 +146,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location) | |||
| 146 | unsigned long flags; | 146 | unsigned long flags; |
| 147 | 147 | ||
| 148 | local_irq_save(flags); | 148 | local_irq_save(flags); |
| 149 | data = &__get_cpu_var(dm_cpu_data); | 149 | data = this_cpu_ptr(&dm_cpu_data); |
| 150 | spin_lock(&data->lock); | 150 | spin_lock(&data->lock); |
| 151 | dskb = data->skb; | 151 | dskb = data->skb; |
| 152 | 152 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 163b673f9e62..adfc7ee1acf2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -345,7 +345,7 @@ static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) | |||
| 345 | unsigned long flags; | 345 | unsigned long flags; |
| 346 | 346 | ||
| 347 | local_irq_save(flags); | 347 | local_irq_save(flags); |
| 348 | nc = &__get_cpu_var(netdev_alloc_cache); | 348 | nc = this_cpu_ptr(&netdev_alloc_cache); |
| 349 | if (unlikely(!nc->frag.page)) { | 349 | if (unlikely(!nc->frag.page)) { |
| 350 | refill: | 350 | refill: |
| 351 | for (order = NETDEV_FRAG_PAGE_MAX_ORDER; ;) { | 351 | for (order = NETDEV_FRAG_PAGE_MAX_ORDER; ;) { |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index eaa4b000c7b4..7d6f4e021846 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -1311,7 +1311,7 @@ static bool rt_cache_route(struct fib_nh *nh, struct rtable *rt) | |||
| 1311 | if (rt_is_input_route(rt)) { | 1311 | if (rt_is_input_route(rt)) { |
| 1312 | p = (struct rtable **)&nh->nh_rth_input; | 1312 | p = (struct rtable **)&nh->nh_rth_input; |
| 1313 | } else { | 1313 | } else { |
| 1314 | p = (struct rtable **)__this_cpu_ptr(nh->nh_pcpu_rth_output); | 1314 | p = (struct rtable **)raw_cpu_ptr(nh->nh_pcpu_rth_output); |
| 1315 | } | 1315 | } |
| 1316 | orig = *p; | 1316 | orig = *p; |
| 1317 | 1317 | ||
| @@ -1939,7 +1939,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res, | |||
| 1939 | do_cache = false; | 1939 | do_cache = false; |
| 1940 | goto add; | 1940 | goto add; |
| 1941 | } | 1941 | } |
| 1942 | prth = __this_cpu_ptr(nh->nh_pcpu_rth_output); | 1942 | prth = raw_cpu_ptr(nh->nh_pcpu_rth_output); |
| 1943 | } | 1943 | } |
| 1944 | rth = rcu_dereference(*prth); | 1944 | rth = rcu_dereference(*prth); |
| 1945 | if (rt_cache_valid(rth)) { | 1945 | if (rt_cache_valid(rth)) { |
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index c0c75688896e..f83391bfdd76 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
| @@ -40,7 +40,7 @@ static u32 cookie_hash(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport, | |||
| 40 | 40 | ||
| 41 | net_get_random_once(syncookie_secret, sizeof(syncookie_secret)); | 41 | |
