aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
commit0429fbc0bdc297d64188483ba029a23773ae07b0 (patch)
tree67de46978c90f37540dd6ded1db20eb53a569030 /drivers/net
parent6929c358972facf2999f8768815c40dd88514fc2 (diff)
parent513d1a2884a49654f368b5fa25ef186e976bdada (diff)
Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Pull percpu consistent-ops changes from Tejun Heo: "Way back, before the current percpu allocator was implemented, static and dynamic percpu memory areas were allocated and handled separately and had their own accessors. The distinction has been gone for many years now; however, the now duplicate two sets of accessors remained with the pointer based ones - this_cpu_*() - evolving various other operations over time. During the process, we also accumulated other inconsistent operations. This pull request contains Christoph's patches to clean up the duplicate accessor situation. __get_cpu_var() uses are replaced with with this_cpu_ptr() and __this_cpu_ptr() with raw_cpu_ptr(). Unfortunately, the former sometimes is tricky thanks to C being a bit messy with the distinction between lvalues and pointers, which led to a rather ugly solution for cpumask_var_t involving the introduction of this_cpu_cpumask_var_ptr(). This converts most of the uses but not all. Christoph will follow up with the remaining conversions in this merge window and hopefully remove the obsolete accessors" * 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (38 commits) irqchip: Properly fetch the per cpu offset percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t -fix ia64: sn_nodepda cannot be assigned to after this_cpu conversion. Use __this_cpu_write. percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t Revert "powerpc: Replace __get_cpu_var uses" percpu: Remove __this_cpu_ptr clocksource: Replace __this_cpu_ptr with raw_cpu_ptr sparc: Replace __get_cpu_var uses avr32: Replace __get_cpu_var with __this_cpu_write blackfin: Replace __get_cpu_var uses tile: Use this_cpu_ptr() for hardware counters tile: Replace __get_cpu_var uses powerpc: Replace __get_cpu_var uses alpha: Replace __get_cpu_var ia64: Replace __get_cpu_var uses s390: cio driver &__get_cpu_var replacements s390: Replace __get_cpu_var uses mips: Replace __get_cpu_var uses MIPS: Replace __get_cpu_var uses in FPU emulator. arm: Replace __this_cpu_ptr with raw_cpu_ptr ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/tile/tilegx.c22
-rw-r--r--drivers/net/ethernet/tile/tilepro.c8
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index 69557a26f749..049747f558c9 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -423,7 +423,7 @@ static void tile_net_pop_all_buffers(int instance, int stack)
423/* Provide linux buffers to mPIPE. */ 423/* Provide linux buffers to mPIPE. */
424static void tile_net_provide_needed_buffers(void) 424static void tile_net_provide_needed_buffers(void)
425{ 425{
426 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 426 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
427 int instance, kind; 427 int instance, kind;
428 for (instance = 0; instance < NR_MPIPE_MAX && 428 for (instance = 0; instance < NR_MPIPE_MAX &&
429 info->mpipe[instance].has_iqueue; instance++) { 429 info->mpipe[instance].has_iqueue; instance++) {
@@ -551,7 +551,7 @@ static inline bool filter_packet(struct net_device *dev, void *buf)
551static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb, 551static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb,
552 gxio_mpipe_idesc_t *idesc, unsigned long len) 552 gxio_mpipe_idesc_t *idesc, unsigned long len)
553{ 553{
554 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 554 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
555 struct tile_net_priv *priv = netdev_priv(dev); 555 struct tile_net_priv *priv = netdev_priv(dev);
556 int instance = priv->instance; 556 int instance = priv->instance;
557 557
@@ -585,7 +585,7 @@ static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb,
585/* Handle a packet. Return true if "processed", false if "filtered". */ 585/* Handle a packet. Return true if "processed", false if "filtered". */
586static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc) 586static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc)
587{ 587{
588 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 588 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
589 struct mpipe_data *md = &mpipe_data[instance]; 589 struct mpipe_data *md = &mpipe_data[instance];
590 struct net_device *dev = md->tile_net_devs_for_channel[idesc->channel]; 590 struct net_device *dev = md->tile_net_devs_for_channel[idesc->channel];
591 uint8_t l2_offset; 591 uint8_t l2_offset;
@@ -651,7 +651,7 @@ drop:
651 */ 651 */
652static int tile_net_poll(struct napi_struct *napi, int budget) 652static int tile_net_poll(struct napi_struct *napi, int budget)
653{ 653{
654 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 654 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
655 unsigned int work = 0; 655 unsigned int work = 0;
656 gxio_mpipe_idesc_t *idesc; 656 gxio_mpipe_idesc_t *idesc;
657 int instance, i, n; 657 int instance, i, n;
@@ -700,7 +700,7 @@ done:
700/* Handle an ingress interrupt from an instance on the current cpu. */ 700/* Handle an ingress interrupt from an instance on the current cpu. */
701static irqreturn_t tile_net_handle_ingress_irq(int irq, void *id) 701static irqreturn_t tile_net_handle_ingress_irq(int irq, void *id)
702{ 702{
703 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 703 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
704 napi_schedule(&info->mpipe[(uint64_t)id].napi); 704 napi_schedule(&info->mpipe[(uint64_t)id].napi);
705 return IRQ_HANDLED; 705 return IRQ_HANDLED;
706} 706}
@@ -763,7 +763,7 @@ static enum hrtimer_restart tile_net_handle_tx_wake_timer(struct hrtimer *t)
763/* Make sure the egress timer is scheduled. */ 763/* Make sure the egress timer is scheduled. */
764static void tile_net_schedule_egress_timer(void) 764static void tile_net_schedule_egress_timer(void)
765{ 765{
766 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 766 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
767 767
768 if (!info->egress_timer_scheduled) { 768 if (!info->egress_timer_scheduled) {
769 hrtimer_start(&info->egress_timer, 769 hrtimer_start(&info->egress_timer,
@@ -780,7 +780,7 @@ static void tile_net_schedule_egress_timer(void)
780 */ 780 */
781static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t) 781static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t)
782{ 782{
783 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 783 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
784 unsigned long irqflags; 784 unsigned long irqflags;
785 bool pending = false; 785 bool pending = false;
786 int i, instance; 786 int i, instance;
@@ -1927,7 +1927,7 @@ static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue,
1927 */ 1927 */
1928static int tile_net_tx_tso(struct sk_buff *skb, struct net_device *dev) 1928static int tile_net_tx_tso(struct sk_buff *skb, struct net_device *dev)
1929{ 1929{
1930 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 1930 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
1931 struct tile_net_priv *priv = netdev_priv(dev); 1931 struct tile_net_priv *priv = netdev_priv(dev);
1932 int channel = priv->echannel; 1932 int channel = priv->echannel;
1933 int instance = priv->instance; 1933 int instance = priv->instance;
@@ -1996,7 +1996,7 @@ static unsigned int tile_net_tx_frags(struct frag *frags,
1996/* Help the kernel transmit a packet. */ 1996/* Help the kernel transmit a packet. */
1997static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) 1997static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
1998{ 1998{
1999 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 1999 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
2000 struct tile_net_priv *priv = netdev_priv(dev); 2000 struct tile_net_priv *priv = netdev_priv(dev);
2001 int instance = priv->instance; 2001 int instance = priv->instance;
2002 struct mpipe_data *md = &mpipe_data[instance]; 2002 struct mpipe_data *md = &mpipe_data[instance];
@@ -2138,7 +2138,7 @@ static int tile_net_set_mac_address(struct net_device *dev, void *p)
2138static void tile_net_netpoll(struct net_device *dev) 2138static void tile_net_netpoll(struct net_device *dev)
2139{ 2139{
2140 int instance = mpipe_instance(dev); 2140 int instance = mpipe_instance(dev);
2141 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 2141 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
2142 struct mpipe_data *md = &mpipe_data[instance]; 2142 struct mpipe_data *md = &mpipe_data[instance];
2143 2143
2144 disable_percpu_irq(md->ingress_irq); 2144 disable_percpu_irq(md->ingress_irq);
@@ -2237,7 +2237,7 @@ static void tile_net_dev_init(const char *name, const uint8_t *mac)
2237/* Per-cpu module initialization. */ 2237/* Per-cpu module initialization. */
2238static void tile_net_init_module_percpu(void *unused) 2238static void tile_net_init_module_percpu(void *unused)
2239{ 2239{
2240 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 2240 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
2241 int my_cpu = smp_processor_id(); 2241 int my_cpu = smp_processor_id();
2242 int instance; 2242 int instance;
2243 2243
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c
index 88818d5054ab..fb12d31cfcf6 100644
--- a/drivers/net/ethernet/tile/tilepro.c
+++ b/drivers/net/ethernet/tile/tilepro.c
@@ -996,13 +996,13 @@ static void tile_net_register(void *dev_ptr)
996 PDEBUG("tile_net_register(queue_id %d)\n", queue_id); 996 PDEBUG("tile_net_register(queue_id %d)\n", queue_id);
997 997
998 if (!strcmp(dev->name, "xgbe0")) 998 if (!strcmp(dev->name, "xgbe0"))
999 info = &__get_cpu_var(hv_xgbe0); 999 info = this_cpu_ptr(&hv_xgbe0);
1000 else if (!strcmp(dev->name, "xgbe1")) 1000 else if (!strcmp(dev->name, "xgbe1"))
1001 info = &__get_cpu_var(hv_xgbe1); 1001 info = this_cpu_ptr(&hv_xgbe1);
1002 else if (!strcmp(dev->name, "gbe0")) 1002 else if (!strcmp(dev->name, "gbe0"))
1003 info = &__get_cpu_var(hv_gbe0); 1003 info = this_cpu_ptr(&hv_gbe0);
1004 else if (!strcmp(dev->name, "gbe1")) 1004 else if (!strcmp(dev->name, "gbe1"))
1005 info = &__get_cpu_var(hv_gbe1); 1005 info = this_cpu_ptr(&hv_gbe1);
1006 else 1006 else
1007 BUG(); 1007 BUG();
1008 1008