net, virtio_net: replace the magic value
authorZhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Mon, 18 Nov 2013 13:19:27 +0000 (21:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Nov 2013 21:23:09 +0000 (16:23 -0500)
It is more appropriate to use # of queue pairs currently used by
the driver instead of a magic value.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c

index 69fb225e59a6ae3cccfd26f2352d85c134de1277..69ad42ba15385f5e3d48848c9e32892acd0dbed8 100644 (file)
@@ -1606,8 +1606,8 @@ static int virtnet_probe(struct virtio_device *vdev)
        if (err)
                goto free_stats;
 
-       netif_set_real_num_tx_queues(dev, 1);
-       netif_set_real_num_rx_queues(dev, 1);
+       netif_set_real_num_tx_queues(dev, vi->curr_queue_pairs);
+       netif_set_real_num_rx_queues(dev, vi->curr_queue_pairs);
 
        err = register_netdev(dev);
        if (err) {