All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Jin <joe.jin@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: wei.liu2@citrix.com, Ian Campbell <ian.campbell@citrix.com>,
	netdev@vger.kernel.org, xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 1/2] xen-netback: limit xen vif max queues number to online cpus
Date: Fri, 23 Oct 2015 16:33:15 +0800	[thread overview]
Message-ID: <5629F0CB.5030905__22951.4613435187$1445589305$gmane$org@oracle.com> (raw)
In-Reply-To: <562A09E802000078000ADDE7@prv-mh.provo.novell.com>

Hi Jan,

Thanks for you review, will create new patches with your comments.

Regards,
Joe
On 10/23/2015 04:20 PM, Jan Beulich wrote:
>>>> On 23.10.15 at 09:58, <joe.jin@oracle.com> wrote:
>> --- a/drivers/net/xen-netback/netback.c
>> +++ b/drivers/net/xen-netback/netback.c
>> @@ -68,7 +68,9 @@ unsigned int rx_stall_timeout_msecs = 60000;
>>  module_param(rx_stall_timeout_msecs, uint, 0444);
>>  
>>  unsigned int xenvif_max_queues;
>> -module_param_named(max_queues, xenvif_max_queues, uint, 0644);
>> +static int xennet_set_max_queues(const char *val, struct kernel_param *kp);
>> +module_param_call(max_queues, xennet_set_max_queues, param_get_int,
> 
> param_get_uint
> 
>> +		  &xenvif_max_queues, 0600);
> 
> Why the change from mode 0644 to 0600?
> 
>> @@ -107,6 +109,20 @@ static struct xen_netif_rx_response *make_rx_response(struct xenvif_queue *queue
>>  					     u16      size,
>>  					     u16      flags);
>>  
>> +static int xennet_set_max_queues(const char *val, struct kernel_param *kp)
>> +{
>> +	unsigned int cpus = num_online_cpus();
>> +	unsigned int max_queues = simple_strtoul(val, NULL, 10);
>> +
>> +	if (max_queues == 0 || max_queues > cpus) {
>> +		pr_info("max_queues %d is out of range [0 - %d]!\n", 
> 
> %u in both cases.
> 
>> +			max_queues, cpus);
>> +		return -EINVAL;
> 
> Considering the message: -ERANGE?
> 
>> +	}
>> +
>> +	return param_set_int(val, kp);
> 
> param_set_uint()
> 
>> @@ -2110,15 +2126,15 @@ int xenvif_dealloc_kthread(void *data)
>>  static int __init netback_init(void)
>>  {
>>  	int rc = 0;
>> +	unsigned int cpus = num_online_cpus();
>>  
>>  	if (!xen_domain())
>>  		return -ENODEV;
>>  
>> -	/* 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();
>> +	/* Allow at most as many queues as CPUs. */
>> +	if (xenvif_max_queues == 0 || xenvif_max_queues > cpus)
>> +		xenvif_max_queues = cpus;
>> +	pr_info("vif max_queues: %d\n", xenvif_max_queues);
> 
> %u again.
> 
> Jan
> 


-- 
Oracle <http://www.oracle.com>
Joe Jin | Software Development Director | +8610.6106.5624
ORACLE | Linux and Virtualization
No. 24 Zhongguancun Software Park, Haidian District | 100193 Beijing 

  parent reply	other threads:[~2015-10-23  8:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23  7:53 [PATCH 0/2] limit xen vnic max queues number to online cpu number Joe Jin
2015-10-23  7:58 ` [PATCH 1/2] xen-netback: limit xen vif max queues number to online cpus Joe Jin
2015-10-23  7:58 ` Joe Jin
2015-10-23  8:20   ` Jan Beulich
2015-10-23  8:20   ` [Xen-devel] " Jan Beulich
2015-10-23  8:33     ` Joe Jin
2015-10-23  8:33     ` Joe Jin [this message]
2015-10-23  7:59 ` [PATCH 2/2] xen-front: limit vnic max_queues " Joe Jin
2015-10-23  7:59 ` Joe Jin
2015-10-23  8:47 ` [PATCH 0/2] limit xen vnic max queues number to online cpu number Paul Durrant
2015-10-23  8:47 ` Paul Durrant
2015-10-23  9:05   ` Joe Jin
2015-10-23  9:05   ` Joe Jin
2015-10-23  9:28     ` Jan Beulich
2015-10-23  9:28     ` [Xen-devel] " Jan Beulich
2015-10-23  9:57     ` Paul Durrant
2015-10-23  9:57     ` Paul Durrant

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='5629F0CB.5030905__22951.4613435187$1445589305$gmane$org@oracle.com' \
    --to=joe.jin@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=davem@davemloft.net \
    --cc=ian.campbell@citrix.com \
    --cc=netdev@vger.kernel.org \
    --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.