|
|
@@ -1886,8 +1886,11 @@ static int virtnet_probe(struct virtio_device *vdev)
|
|
|
if (vi->any_header_sg)
|
|
|
dev->needed_headroom = vi->hdr_len;
|
|
|
|
|
|
- /* Use single tx/rx queue pair as default */
|
|
|
- vi->curr_queue_pairs = 1;
|
|
|
+ /* Enable multiqueue by default */
|
|
|
+ if (num_online_cpus() >= max_queue_pairs)
|
|
|
+ vi->curr_queue_pairs = max_queue_pairs;
|
|
|
+ else
|
|
|
+ vi->curr_queue_pairs = num_online_cpus();
|
|
|
vi->max_queue_pairs = max_queue_pairs;
|
|
|
|
|
|
/* Allocate/initialize the rx/tx queues, and invoke find_vqs */
|
|
|
@@ -1918,6 +1921,8 @@ static int virtnet_probe(struct virtio_device *vdev)
|
|
|
goto free_unregister_netdev;
|
|
|
}
|
|
|
|
|
|
+ virtnet_set_affinity(vi);
|
|
|
+
|
|
|
/* Assume link up if device can't report link status,
|
|
|
otherwise get link status from config. */
|
|
|
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
|