]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen/netfront: set default upper limit of tx/rx queues to 8
authorJuergen Gross <jgross@suse.com>
Tue, 10 Jan 2017 13:32:51 +0000 (14:32 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 13 Sep 2017 04:37:45 +0000 (21:37 -0700)
The default for the number of tx/rx queues of one interface is the
number of vcpus of the system today. As each queue pair reserves 512
grant pages this default consumes a ridiculous number of grants for
large guests.

Limit the queue number to 8 as default. This value can be modified
via a module parameter if required.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
OraBug: 26662731

(cherry picked from commit 034702a64a6692a8d5d0d9630064a014fc633728)
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
drivers/net/xen-netfront.c

index 6436e249b8af67e076f328b1c29d803d4c7dc5ee..ca06a0b7b3142c251efd50d84a406fb2dd301ea9 100644 (file)
@@ -57,6 +57,7 @@
 #include <xen/interface/grant_table.h>
 
 /* Module parameters */
+#define MAX_QUEUES_DEFAULT 8
 static unsigned int xennet_max_queues;
 module_param_named(max_queues, xennet_max_queues, uint, 0644);
 MODULE_PARM_DESC(max_queues,
@@ -2752,11 +2753,12 @@ static int __init netif_init(void)
 
        pr_info("Initialising Xen virtual ethernet driver\n");
 
-       /* Allow as many queues as there are CPUs if user has not
+       /* Allow as many queues as there are CPUs inut max. 8 if user has not
         * specified a value.
         */
        if (xennet_max_queues == 0)
-               xennet_max_queues = num_online_cpus();
+               xennet_max_queues = min_t(unsigned int, MAX_QUEUES_DEFAULT,
+                                         num_online_cpus());
 
        return xenbus_register_frontend(&netfront_driver);
 }