Skip to content

Commit

Permalink
virtio_net: Replace deprecated CPU-hotplug functions.
Browse files Browse the repository at this point in the history
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" <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: [email protected]
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Sebastian Andrzej Siewior authored and kuba-moo committed Aug 4, 2021
1 parent c2eecaa commit a0d1d0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit a0d1d0f

Please sign in to comment.