Skip to content

Commit 56dd5af

Browse files
jgross1Boris Ostrovsky
authored andcommitted
xen/netback: set default upper limit of tx/rx queues to 8
The default for the maximum number of tx/rx queues of one interface is the number of cpus 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 <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Boris Ostrovsky <[email protected]>
1 parent 034702a commit 56dd5af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/xen-netback/netback.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module_param(rx_drain_timeout_msecs, uint, 0444);
6767
unsigned int rx_stall_timeout_msecs = 60000;
6868
module_param(rx_stall_timeout_msecs, uint, 0444);
6969

70+
#define MAX_QUEUES_DEFAULT 8
7071
unsigned int xenvif_max_queues;
7172
module_param_named(max_queues, xenvif_max_queues, uint, 0644);
7273
MODULE_PARM_DESC(max_queues,
@@ -1622,11 +1623,12 @@ static int __init netback_init(void)
16221623
if (!xen_domain())
16231624
return -ENODEV;
16241625

1625-
/* Allow as many queues as there are CPUs if user has not
1626+
/* Allow as many queues as there are CPUs but max. 8 if user has not
16261627
* specified a value.
16271628
*/
16281629
if (xenvif_max_queues == 0)
1629-
xenvif_max_queues = num_online_cpus();
1630+
xenvif_max_queues = min_t(unsigned int, MAX_QUEUES_DEFAULT,
1631+
num_online_cpus());
16301632

16311633
if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) {
16321634
pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",

0 commit comments

Comments
 (0)