Skip to contentSkip to conversation

xen-netfront: limit max queues number to online cpus

PATCH In review Joe Jin 1 participant 3 messages Oct 23, 2015

Subsystems (3)
lore
Share & tools
lore

Joe Jin

author
#0 lore raw

PATCH 1/1 xen-netfront: limit max queues number to online cpus

Should not allocate queues number more than online cpus.

Cc Boris Ostrovsky <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>
Cc David S. Miller <[email protected]>
---
 drivers/net/xen-netfront.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/xen-netfront.c +1 -1
index f821a97..1eebd4e 100644
@@ -2137,7 +2137,7 @@ static int __init netif_init(void)
 	/* Allow as many queues as there are CPUs if user has not
 	 * specified a value.
 	 */
-	if (xennet_max_queues == 0)
+	if (xennet_max_queues == 0 || xennet_max_queues > num_online_cpus())
 		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);
Signature · 1 line
1.7.1
author
#1 lore raw

We need to take care sysfs too, please ignore this patch, I'll create new one later for review and comment.

Thanks,
Joe

Quoted 24 lines · Joe Jin

Should not allocate queues number more than online cpus.

Cc Boris Ostrovsky <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>
Cc David S. Miller <[email protected]>
---
 drivers/net/xen-netfront.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/xen-netfront.c +1 -1
index f821a97..1eebd4e 100644
@@ -2137,7 +2137,7 @@ static int __init netif_init(void)
 	/* Allow as many queues as there are CPUs if user has not
 	 * specified a value.
 	 */
-	if (xennet_max_queues == 0)
+	if (xennet_max_queues == 0 || xennet_max_queues > num_online_cpus())
 		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);
author
#2 lore raw
In reply to Joe Jin

We need to take care sysfs too, please ignore this patch, I'll create new one later for review and comment.

Thanks,
Joe

Quoted 24 lines · Joe Jin

Should not allocate queues number more than online cpus.

Cc Boris Ostrovsky <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>
Cc David S. Miller <[email protected]>
---
 drivers/net/xen-netfront.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/xen-netfront.c +1 -1
index f821a97..1eebd4e 100644
@@ -2137,7 +2137,7 @@ static int __init netif_init(void)
 	/* Allow as many queues as there are CPUs if user has not
 	 * specified a value.
 	 */
-	if (xennet_max_queues == 0)
+	if (xennet_max_queues == 0 || xennet_max_queues > num_online_cpus())
 		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);