Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 034702a6 authored by Juergen Gross's avatar Juergen Gross Committed by Boris Ostrovsky
Browse files

xen/netfront: set default upper limit of tx/rx queues to 8



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: default avatarJuergen Gross <jgross@suse.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
parent 566cf877
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@
#include <xen/interface/grant_table.h>
#include <xen/interface/grant_table.h>


/* Module parameters */
/* Module parameters */
#define MAX_QUEUES_DEFAULT 8
static unsigned int xennet_max_queues;
static unsigned int xennet_max_queues;
module_param_named(max_queues, xennet_max_queues, uint, 0644);
module_param_named(max_queues, xennet_max_queues, uint, 0644);
MODULE_PARM_DESC(max_queues,
MODULE_PARM_DESC(max_queues,
@@ -2164,11 +2165,12 @@ static int __init netif_init(void)


	pr_info("Initialising Xen virtual ethernet driver\n");
	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.
	 * specified a value.
	 */
	 */
	if (xennet_max_queues == 0)
	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);
	return xenbus_register_frontend(&netfront_driver);
}
}