net/virtio-net: Convert to hotplug state machine
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 12 Aug 2016 17:49:43 +0000 (19:49 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 2 Sep 2016 18:05:06 +0000 (20:05 +0200)
commit8017c279196ab29174bafc104ac4ebbd42c7ca7f
tree4d5c5102c367e0c1018e5d435dbc96884263561d
parent8df038725ad5351a9730759e0a24a5c5d96be661
net/virtio-net: Convert to hotplug state machine

Install the callbacks via the state machine.

The driver supports multiple instances and therefore the new
cpuhp_state_add_instance_nocalls() infrastrucure is used. The driver
currently uses get_online_cpus() to avoid missing a CPU hotplug event while
invoking virtnet_set_affinity(). This could be avoided by using
cpuhp_state_add_instance() variant which holds the hotplug lock and invokes
callback during registration. This is more or less a 1:1 conversion of the
current code.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: netdev@vger.kernel.org
Cc: Will Deacon <will.deacon@arm.com>
Cc: virtualization@lists.linux-foundation.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/1471024183-12666-7-git-send-email-bigeasy@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/net/virtio_net.c
include/linux/cpuhotplug.h