Commit a0d1d0f4 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Jakub Kicinski

virtio_net: Replace deprecated CPU-hotplug functions.

The functions get_online_cpus() and put_online_cpus() have been
deprecated during the CPU hotplug rework. They map directly to
cpus_read_lock() and cpus_read_unlock().

Replace deprecated CPU-hotplug functions with the official version.
The behavior remains unchanged.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c2eecaa1
......@@ -2197,14 +2197,14 @@ static int virtnet_set_channels(struct net_device *dev,
if (vi->rq[0].xdp_prog)
return -EINVAL;
get_online_cpus();
cpus_read_lock();
err = _virtnet_set_queues(vi, queue_pairs);
if (err) {
put_online_cpus();
cpus_read_unlock();
goto err;
}
virtnet_set_affinity(vi);
put_online_cpus();
cpus_read_unlock();
netif_set_real_num_tx_queues(dev, queue_pairs);
netif_set_real_num_rx_queues(dev, queue_pairs);
......@@ -2959,9 +2959,9 @@ static int init_vqs(struct virtnet_info *vi)
if (ret)
goto err_free;
get_online_cpus();
cpus_read_lock();
virtnet_set_affinity(vi);
put_online_cpus();
cpus_read_unlock();
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment