All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: Add ctrl attributes for queue_count and sqsize
@ 2019-09-24 21:22 James Smart
  2019-09-25 12:50 ` Hannes Reinecke
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: James Smart @ 2019-09-24 21:22 UTC (permalink / raw)
  To: linux-nvme; +Cc: James Smart

Current controller interrogation requires a lot of guesswork
on how many io queues were created and what the io sq size is.
The numbers are dependent upon core/fabric defaults, connect
arguments, and target responses.

Add sysfs attributes for queue_count and sqsize.

Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/nvme/host/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e0e2dcbfd05e..b1c24af284ca 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3040,6 +3040,8 @@ static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL);
 
 nvme_show_int_function(cntlid);
 nvme_show_int_function(numa_node);
+nvme_show_int_function(queue_count);
+nvme_show_int_function(sqsize);
 
 static ssize_t nvme_sysfs_delete(struct device *dev,
 				struct device_attribute *attr, const char *buf,
@@ -3120,6 +3122,8 @@ static struct attribute *nvme_dev_attrs[] = {
 	&dev_attr_address.attr,
 	&dev_attr_state.attr,
 	&dev_attr_numa_node.attr,
+	&dev_attr_queue_count.attr,
+	&dev_attr_sqsize.attr,
 	NULL
 };
 
-- 
2.13.7


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Add ctrl attributes for queue_count and sqsize
  2019-09-24 21:22 [PATCH] nvme: Add ctrl attributes for queue_count and sqsize James Smart
@ 2019-09-25 12:50 ` Hannes Reinecke
  2019-09-25 21:10 ` Chaitanya Kulkarni
  2019-09-25 21:36 ` Keith Busch
  2 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2019-09-25 12:50 UTC (permalink / raw)
  To: linux-nvme

On 9/24/19 11:22 PM, James Smart wrote:
> Current controller interrogation requires a lot of guesswork
> on how many io queues were created and what the io sq size is.
> The numbers are dependent upon core/fabric defaults, connect
> arguments, and target responses.
> 
> Add sysfs attributes for queue_count and sqsize.
> 
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
>  drivers/nvme/host/core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index e0e2dcbfd05e..b1c24af284ca 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3040,6 +3040,8 @@ static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL);
>  
>  nvme_show_int_function(cntlid);
>  nvme_show_int_function(numa_node);
> +nvme_show_int_function(queue_count);
> +nvme_show_int_function(sqsize);
>  
>  static ssize_t nvme_sysfs_delete(struct device *dev,
>  				struct device_attribute *attr, const char *buf,
> @@ -3120,6 +3122,8 @@ static struct attribute *nvme_dev_attrs[] = {
>  	&dev_attr_address.attr,
>  	&dev_attr_state.attr,
>  	&dev_attr_numa_node.attr,
> +	&dev_attr_queue_count.attr,
> +	&dev_attr_sqsize.attr,
>  	NULL
>  };
>  
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      Teamlead Storage & Networking
hare@suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Add ctrl attributes for queue_count and sqsize
  2019-09-24 21:22 [PATCH] nvme: Add ctrl attributes for queue_count and sqsize James Smart
  2019-09-25 12:50 ` Hannes Reinecke
@ 2019-09-25 21:10 ` Chaitanya Kulkarni
  2019-09-25 21:36 ` Keith Busch
  2 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2019-09-25 21:10 UTC (permalink / raw)
  To: linux-nvme@lists.infradead.org

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 9/24/19 2:22 PM, James Smart wrote:
> Current controller interrogation requires a lot of guesswork
> on how many io queues were created and what the io sq size is.
> The numbers are dependent upon core/fabric defaults, connect
> arguments, and target responses.
>
> Add sysfs attributes for queue_count and sqsize.
>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
>   drivers/nvme/host/core.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index e0e2dcbfd05e..b1c24af284ca 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3040,6 +3040,8 @@ static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL);
>   
>   nvme_show_int_function(cntlid);
>   nvme_show_int_function(numa_node);
> +nvme_show_int_function(queue_count);
> +nvme_show_int_function(sqsize);
>   
>   static ssize_t nvme_sysfs_delete(struct device *dev,
>   				struct device_attribute *attr, const char *buf,
> @@ -3120,6 +3122,8 @@ static struct attribute *nvme_dev_attrs[] = {
>   	&dev_attr_address.attr,
>   	&dev_attr_state.attr,
>   	&dev_attr_numa_node.attr,
> +	&dev_attr_queue_count.attr,
> +	&dev_attr_sqsize.attr,
>   	NULL
>   };
>   


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Add ctrl attributes for queue_count and sqsize
  2019-09-24 21:22 [PATCH] nvme: Add ctrl attributes for queue_count and sqsize James Smart
  2019-09-25 12:50 ` Hannes Reinecke
  2019-09-25 21:10 ` Chaitanya Kulkarni
@ 2019-09-25 21:36 ` Keith Busch
  2019-09-25 23:50   ` James Smart
  2 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2019-09-25 21:36 UTC (permalink / raw)
  To: James Smart; +Cc: linux-nvme

On Tue, Sep 24, 2019 at 02:22:08PM -0700, James Smart wrote:
> Current controller interrogation requires a lot of guesswork
> on how many io queues were created and what the io sq size is.
> The numbers are dependent upon core/fabric defaults, connect
> arguments, and target responses.
> 
> Add sysfs attributes for queue_count and sqsize.
> 
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
>  drivers/nvme/host/core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index e0e2dcbfd05e..b1c24af284ca 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3040,6 +3040,8 @@ static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL);
>  
>  nvme_show_int_function(cntlid);
>  nvme_show_int_function(numa_node);
> +nvme_show_int_function(queue_count);
> +nvme_show_int_function(sqsize);

The sqsize is only valid for fabrics, so I think you need to update the
'is_visible' to suppress this attribute for pcie.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Add ctrl attributes for queue_count and sqsize
  2019-09-25 21:36 ` Keith Busch
@ 2019-09-25 23:50   ` James Smart
  0 siblings, 0 replies; 5+ messages in thread
From: James Smart @ 2019-09-25 23:50 UTC (permalink / raw)
  To: Keith Busch, James Smart; +Cc: linux-nvme

On 9/25/2019 2:36 PM, Keith Busch wrote:
> On Tue, Sep 24, 2019 at 02:22:08PM -0700, James Smart wrote:
>> Current controller interrogation requires a lot of guesswork
>> on how many io queues were created and what the io sq size is.
>> The numbers are dependent upon core/fabric defaults, connect
>> arguments, and target responses.
>>
>> Add sysfs attributes for queue_count and sqsize.
>>
>> Signed-off-by: James Smart <jsmart2021@gmail.com>
>> ---
>>   drivers/nvme/host/core.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index e0e2dcbfd05e..b1c24af284ca 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -3040,6 +3040,8 @@ static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL);
>>   
>>   nvme_show_int_function(cntlid);
>>   nvme_show_int_function(numa_node);
>> +nvme_show_int_function(queue_count);
>> +nvme_show_int_function(sqsize);
> The sqsize is only valid for fabrics, so I think you need to update the
> 'is_visible' to suppress this attribute for pcie.

I would think knowing the SQ size or an I/O queue is still interesting 
although perhaps not as useful.

Looking in pci.c:
- dev->q_depth is the baseline, getting stamped into each of the queue 
structures
- nvme_pci_enable() is setting dev->ctrl.sqsize to dev->q_depth - 1;

Or are you asking not to display it as the implied model for how many 
outstanding ios is different ?
note: I wasn't trying to go there - only to say what the SQ size is for 
an I/O queue

-- james


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-25 23:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24 21:22 [PATCH] nvme: Add ctrl attributes for queue_count and sqsize James Smart
2019-09-25 12:50 ` Hannes Reinecke
2019-09-25 21:10 ` Chaitanya Kulkarni
2019-09-25 21:36 ` Keith Busch
2019-09-25 23:50   ` James Smart

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.