All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org,
	netdev@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	boris.ostrovsky@oracle.com, paul.durrant@citrix.com,
	wei.liu2@citrix.com
Subject: [PATCH 1/2] xen/netfront: set default upper limit of tx/rx queues to 8
Date: Tue, 10 Jan 2017 14:32:51 +0100	[thread overview]
Message-ID: <20170110133252.5346-2-jgross__5195.30943497575$1484055241$gmane$org@suse.com> (raw)
In-Reply-To: <20170110133252.5346-1-jgross@suse.com>

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>
---
 drivers/net/xen-netfront.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index a479cd9..490c865 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -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,
@@ -2164,11 +2165,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);
 }
-- 
2.10.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-01-10 13:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 13:32 [PATCH 0/2] xen/net: limit number of tx/rx queues Juergen Gross
2017-01-10 13:32 ` [PATCH 1/2] xen/netfront: set default upper limit of tx/rx queues to 8 Juergen Gross
2017-01-10 14:53   ` Boris Ostrovsky
2017-01-10 14:53   ` Boris Ostrovsky
2017-01-10 15:02     ` Juergen Gross
2017-01-10 15:02     ` Juergen Gross
2017-01-10 13:32 ` Juergen Gross [this message]
2017-01-10 13:32 ` [PATCH 2/2] xen/netback: " Juergen Gross
2017-01-10 13:32 ` Juergen Gross
2017-01-10 13:54 ` [PATCH 0/2] xen/net: limit number of tx/rx queues Wei Liu
2017-01-10 13:54 ` Wei Liu
2017-01-30  2:55 ` Boris Ostrovsky
2017-01-30  2:55   ` Boris Ostrovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20170110133252.5346-2-jgross__5195.30943497575$1484055241$gmane$org@suse.com' \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul.durrant@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.