Skip to contentSkip to conversation

xen-net{front,back}: respect user provided max_queues

PATCH Superseded Wei Liu 3 participants 9 messages Sep 10, 2015

Subsystems (4)
lore
Share & tools
lore
author
#3 lore raw

PATCH v3 2/2 xen-netfront: respect user provided max_queues

In reply to Wei Liu

Originally that parameter was always reset to num_online_cpus during module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not provided a value.

Cc David Vrabel <[email protected]>

---
v3: fix copy-n-paste error to make netfront compile

---
 drivers/net/xen-netfront.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/xen-netfront.c +5 -2
index e27e6d2..b9c637a 100644
@@ -2132,8 +2132,11 @@ static int __init netif_init(void)
 
 	pr_info("Initialising Xen virtual ethernet driver\n");
 
-	/* Allow as many queues as there are CPUs, by default */
-	xennet_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xennet_max_queues == 0)
+		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);
 }
Signature · 1 line
2.1.4

Wei Liu

author
#0 lore raw

v3 cover xen-net{front,back}: respect user provided max_queues

Wei Liu (2):
xen-netback: respect user provided max_queues
xen-netfront: respect user provided max_queues

 drivers/net/xen-netback/netback.c | 7 +++++--
 drivers/net/xen-netfront.c        | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
Signature · 1 line
2.1.4
author
#1 lore raw

PATCH v3 1/2 xen-netback: respect user provided max_queues

Originally that parameter was always reset to num_online_cpus during module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not provided a value.

---
 drivers/net/xen-netback/netback.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/xen-netback/netback.c +5 -2
index 42569b9..f585c6a 100644
@@ -2105,8 +2105,11 @@ static int __init netback_init(void)
 	if (!xen_domain())
 		return -ENODEV;
 
-	/* Allow as many queues as there are CPUs, by default */
-	xenvif_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xenvif_max_queues == 0)
+		xenvif_max_queues = num_online_cpus();
 
 	if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) {
 		pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",
Signature · 1 line
2.1.4
author
#2 lore raw

PATCH v3 1/2 xen-netback: respect user provided max_queues

In reply to Wei Liu

Originally that parameter was always reset to num_online_cpus during module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not provided a value.

---
 drivers/net/xen-netback/netback.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/xen-netback/netback.c +5 -2
index 42569b9..f585c6a 100644
@@ -2105,8 +2105,11 @@ static int __init netback_init(void)
 	if (!xen_domain())
 		return -ENODEV;
 
-	/* Allow as many queues as there are CPUs, by default */
-	xenvif_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xenvif_max_queues == 0)
+		xenvif_max_queues = num_online_cpus();
 
 	if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) {
 		pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",
Signature · 1 line
2.1.4
author
#6 lore raw

PATCH v3 2/2 xen-netfront: respect user provided max_queues

In reply to Wei Liu

Originally that parameter was always reset to num_online_cpus during module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not provided a value.

Cc David Vrabel <[email protected]>

---
v3: fix copy-n-paste error to make netfront compile

---
 drivers/net/xen-netfront.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/xen-netfront.c +5 -2
index e27e6d2..b9c637a 100644
@@ -2132,8 +2132,11 @@ static int __init netif_init(void)
 
 	pr_info("Initialising Xen virtual ethernet driver\n");
 
-	/* Allow as many queues as there are CPUs, by default */
-	xennet_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xennet_max_queues == 0)
+		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);
 }
Signature · 1 line
2.1.4
Reviewed-by Tested-by on v3 2/2
#4 lore raw

Re: [Xen-devel] [PATCH net v3 2/2] xen-netfront: respect user provided max_queues

In reply to Wei Liu
Quoted 5 lines · Wei Liu

Originally that parameter was always reset to num_online_cpus during module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not provided a value.

David

Quoted 17 lines
drivers/net/xen-netfront.c +5 -2
@@ -2132,8 +2132,11 @@ static int __init netif_init(void)
 
 	pr_info("Initialising Xen virtual ethernet driver\n");
 
-	/* Allow as many queues as there are CPUs, by default */
-	xennet_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xennet_max_queues == 0)
+		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);
 }
Reviewed-by Tested-by on v3 2/2
#5 lore raw

Re: [PATCH net v3 2/2] xen-netfront: respect user provided max_queues

In reply to Wei Liu
Quoted 5 lines · Wei Liu

Originally that parameter was always reset to num_online_cpus during module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not provided a value.

David

Quoted 17 lines
drivers/net/xen-netfront.c +5 -2
@@ -2132,8 +2132,11 @@ static int __init netif_init(void)
 
 	pr_info("Initialising Xen virtual ethernet driver\n");
 
-	/* Allow as many queues as there are CPUs, by default */
-	xennet_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xennet_max_queues == 0)
+		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);
 }
maintainer
#7 lore raw
In reply to Wei Liu

From: Wei Liu <[email protected]>
Date: Thu, 10 Sep 2015 11:18:56 +0100

Quoted 3 lines

Wei Liu (2):
xen-netback: respect user provided max_queues
xen-netfront: respect user provided max_queues

This looks better, series applied, thanks.

maintainer
#8 lore raw

Re: [PATCH net v3 0/2] xen-net{front, back}: respect user provided max_queues

In reply to Wei Liu

From: Wei Liu <[email protected]>
Date: Thu, 10 Sep 2015 11:18:56 +0100

Quoted 3 lines

Wei Liu (2):
xen-netback: respect user provided max_queues
xen-netfront: respect user provided max_queues

This looks better, series applied, thanks.