aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-12 22:25:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-12 22:25:04 -0500
commite71c3978d6f97659f6c3ee942c3e581299e4adf2 (patch)
tree0b58c76a20a79f5f5d9ada5731aa1dbb149fbcdc /net/core/dev.c
parentf797484c26300fec842fb669c69a3a60eb66e240 (diff)
parentb18cc3de00ec3442cf40ac60787dbe0703b99e24 (diff)
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull smp hotplug updates from Thomas Gleixner: "This is the final round of converting the notifier mess to the state machine. The removal of the notifiers and the related infrastructure will happen around rc1, as there are conversions outstanding in other trees. The whole exercise removed about 2000 lines of code in total and in course of the conversion several dozen bugs got fixed. The new mechanism allows to test almost every hotplug step standalone, so usage sites can exercise all transitions extensively. There is more room for improvement, like integrating all the pointlessly different architecture mechanisms of synchronizing, setting cpus online etc into the core code" * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (60 commits) tracing/rb: Init the CPU mask on allocation soc/fsl/qbman: Convert to hotplug state machine soc/fsl/qbman: Convert to hotplug state machine zram: Convert to hotplug state machine KVM/PPC/Book3S HV: Convert to hotplug state machine arm64/cpuinfo: Convert to hotplug state machine arm64/cpuinfo: Make hotplug notifier symmetric mm/compaction: Convert to hotplug state machine iommu/vt-d: Convert to hotplug state machine mm/zswap: Convert pool to hotplug state machine mm/zswap: Convert dst-mem to hotplug state machine mm/zsmalloc: Convert to hotplug state machine mm/vmstat: Convert to hotplug state machine mm/vmstat: Avoid on each online CPU loops mm/vmstat: Drop get_online_cpus() from init_cpu_node_state/vmstat_cpu_dead() tracing/rb: Convert to hotplug state machine oprofile/nmi timer: Convert to hotplug state machine net/iucv: Use explicit clean up labels in iucv_init() x86/pci/amd-bus: Convert to hotplug state machine x86/oprofile/nmi: Convert to hotplug state machine ...
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 3fec23cdeb80..6372117f653f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8008,18 +8008,13 @@ out:
8008} 8008}
8009EXPORT_SYMBOL_GPL(dev_change_net_namespace); 8009EXPORT_SYMBOL_GPL(dev_change_net_namespace);
8010 8010
8011static int dev_cpu_callback(struct notifier_block *nfb, 8011static int dev_cpu_dead(unsigned int oldcpu)
8012 unsigned long action,
8013 void *ocpu)
8014{ 8012{
8015 struct sk_buff **list_skb; 8013 struct sk_buff **list_skb;
8016 struct sk_buff *skb; 8014 struct sk_buff *skb;
8017 unsigned int cpu, oldcpu = (unsigned long)ocpu; 8015 unsigned int cpu;
8018 struct softnet_data *sd, *oldsd; 8016 struct softnet_data *sd, *oldsd;
8019 8017
8020 if (action != CPU_DEAD && action != CPU_DEAD_FROZEN)
8021 return NOTIFY_OK;
8022
8023 local_irq_disable(); 8018 local_irq_disable();
8024 cpu = smp_processor_id(); 8019 cpu = smp_processor_id();
8025 sd = &per_cpu(softnet_data, cpu); 8020 sd = &per_cpu(softnet_data, cpu);
@@ -8069,10 +8064,9 @@ static int dev_cpu_callback(struct notifier_block *nfb,
8069 input_queue_head_incr(oldsd); 8064 input_queue_head_incr(oldsd);
8070 } 8065 }
8071 8066
8072 return NOTIFY_OK; 8067 return 0;
8073} 8068}
8074 8069
8075
8076/** 8070/**
8077 * netdev_increment_features - increment feature set by one 8071 * netdev_increment_features - increment feature set by one
8078 * @all: current feature set 8072 * @all: current feature set
@@ -8406,7 +8400,9 @@ static int __init net_dev_init(void)
8406 open_softirq(NET_TX_SOFTIRQ, net_tx_action); 8400 open_softirq(NET_TX_SOFTIRQ, net_tx_action);
8407 open_softirq(NET_RX_SOFTIRQ, net_rx_action); 8401 open_softirq(NET_RX_SOFTIRQ, net_rx_action);
8408 8402
8409 hotcpu_notifier(dev_cpu_callback, 0); 8403 rc = cpuhp_setup_state_nocalls(CPUHP_NET_DEV_DEAD, "net/dev:dead",
8404 NULL, dev_cpu_dead);
8405 WARN_ON(rc < 0);
8410 dst_subsys_init(); 8406 dst_subsys_init();
8411 rc = 0; 8407 rc = 0;
8412out: 8408out: