diff options
author | Juergen Gross <jgross@suse.com> | 2017-01-10 08:32:52 -0500 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2017-01-29 18:48:27 -0500 |
commit | 56dd5af9bc23d0d5d23bb207c477715b4c2216c5 (patch) | |
tree | 3d801b67474d3fe57d268c4eb8e573d8cb14a584 /drivers/net/xen-netback/netback.c | |
parent | 034702a64a6692a8d5d0d9630064a014fc633728 (diff) |
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 <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/net/xen-netback/netback.c')
-rw-r--r-- | drivers/net/xen-netback/netback.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 47b481095d77..f9bcf4a665bc 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -67,6 +67,7 @@ module_param(rx_drain_timeout_msecs, uint, 0444); | |||
67 | unsigned int rx_stall_timeout_msecs = 60000; | 67 | unsigned int rx_stall_timeout_msecs = 60000; |
68 | module_param(rx_stall_timeout_msecs, uint, 0444); | 68 | module_param(rx_stall_timeout_msecs, uint, 0444); |
69 | 69 | ||
70 | #define MAX_QUEUES_DEFAULT 8 | ||
70 | unsigned int xenvif_max_queues; | 71 | unsigned int xenvif_max_queues; |
71 | module_param_named(max_queues, xenvif_max_queues, uint, 0644); | 72 | module_param_named(max_queues, xenvif_max_queues, uint, 0644); |
72 | MODULE_PARM_DESC(max_queues, | 73 | MODULE_PARM_DESC(max_queues, |
@@ -1622,11 +1623,12 @@ static int __init netback_init(void) | |||
1622 | if (!xen_domain()) | 1623 | if (!xen_domain()) |
1623 | return -ENODEV; | 1624 | return -ENODEV; |
1624 | 1625 | ||
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 |
1626 | * specified a value. | 1627 | * specified a value. |
1627 | */ | 1628 | */ |
1628 | if (xenvif_max_queues == 0) | 1629 | 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()); | ||
1630 | 1632 | ||
1631 | if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) { | 1633 | if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) { |
1632 | pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n", | 1634 | pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n", |