* [PATCH] nvme: add 'kato' sysfs attribute
@ 2021-02-26 7:52 Hannes Reinecke
2021-02-26 9:11 ` Daniel Wagner
2021-03-01 15:39 ` George, Martin
0 siblings, 2 replies; 4+ messages in thread
From: Hannes Reinecke @ 2021-02-26 7:52 UTC (permalink / raw)
To: Keith Busch
Cc: Martin George, Hannes Reinecke, Sagi Grimberg, linux-nvme,
Christoph Hellwig
Add a 'kato' controller sysfs attribute to display the current
keep-alive timeout value (if any). This allows userspace to identify
persistent discovery controllers, as these will have a non-zero
KATO value.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/nvme/host/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1d5fc8a6fd37..9ad23472ac15 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3547,6 +3547,7 @@ nvme_show_int_function(cntlid);
nvme_show_int_function(numa_node);
nvme_show_int_function(queue_count);
nvme_show_int_function(sqsize);
+nvme_show_int_function(kato);
static ssize_t nvme_sysfs_delete(struct device *dev,
struct device_attribute *attr, const char *buf,
@@ -3749,6 +3750,7 @@ static struct attribute *nvme_dev_attrs[] = {
&dev_attr_ctrl_loss_tmo.attr,
&dev_attr_fast_io_fail_tmo.attr,
&dev_attr_reconnect_delay.attr,
+ &dev_attr_kato.attr,
NULL
};
--
2.26.2
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: add 'kato' sysfs attribute
2021-02-26 7:52 [PATCH] nvme: add 'kato' sysfs attribute Hannes Reinecke
@ 2021-02-26 9:11 ` Daniel Wagner
2021-03-01 15:39 ` George, Martin
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2021-02-26 9:11 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin George, linux-nvme, Sagi Grimberg, Keith Busch, Christoph Hellwig
On Fri, Feb 26, 2021 at 08:52:51AM +0100, Hannes Reinecke wrote:
> Add a 'kato' controller sysfs attribute to display the current
> keep-alive timeout value (if any). This allows userspace to identify
> persistent discovery controllers, as these will have a non-zero
> KATO value.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: add 'kato' sysfs attribute
2021-02-26 7:52 [PATCH] nvme: add 'kato' sysfs attribute Hannes Reinecke
2021-02-26 9:11 ` Daniel Wagner
@ 2021-03-01 15:39 ` George, Martin
2021-03-01 16:46 ` Hannes Reinecke
1 sibling, 1 reply; 4+ messages in thread
From: George, Martin @ 2021-03-01 15:39 UTC (permalink / raw)
To: hare, keith.busch; +Cc: hch, linux-nvme, sagi
On Fri, 2021-02-26 at 08:52 +0100, Hannes Reinecke wrote:
> Add a 'kato' controller sysfs attribute to display the current
> keep-alive timeout value (if any). This allows userspace to identify
> persistent discovery controllers, as these will have a non-zero
> KATO value.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/nvme/host/core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 1d5fc8a6fd37..9ad23472ac15 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3547,6 +3547,7 @@ nvme_show_int_function(cntlid);
> nvme_show_int_function(numa_node);
> nvme_show_int_function(queue_count);
> nvme_show_int_function(sqsize);
> +nvme_show_int_function(kato);
>
> static ssize_t nvme_sysfs_delete(struct device *dev,
> struct device_attribute *attr, const
> char *buf,
> @@ -3749,6 +3750,7 @@ static struct attribute *nvme_dev_attrs[] = {
> &dev_attr_ctrl_loss_tmo.attr,
> &dev_attr_fast_io_fail_tmo.attr,
> &dev_attr_reconnect_delay.attr,
> + &dev_attr_kato.attr,
> NULL
> };
>
This is helpful indeed. But looks like the actual kato value sent down
the wire is ctrl->kato + NVME_KATO_GRACE. Wondering if that may end up
confusing the end user.
-Martin
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: add 'kato' sysfs attribute
2021-03-01 15:39 ` George, Martin
@ 2021-03-01 16:46 ` Hannes Reinecke
0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2021-03-01 16:46 UTC (permalink / raw)
To: George, Martin, keith.busch; +Cc: hch, linux-nvme, sagi
On 3/1/21 4:39 PM, George, Martin wrote:
> On Fri, 2021-02-26 at 08:52 +0100, Hannes Reinecke wrote:
>> Add a 'kato' controller sysfs attribute to display the current
>> keep-alive timeout value (if any). This allows userspace to identify
>> persistent discovery controllers, as these will have a non-zero
>> KATO value.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>> drivers/nvme/host/core.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 1d5fc8a6fd37..9ad23472ac15 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -3547,6 +3547,7 @@ nvme_show_int_function(cntlid);
>> nvme_show_int_function(numa_node);
>> nvme_show_int_function(queue_count);
>> nvme_show_int_function(sqsize);
>> +nvme_show_int_function(kato);
>>
>> static ssize_t nvme_sysfs_delete(struct device *dev,
>> struct device_attribute *attr, const
>> char *buf,
>> @@ -3749,6 +3750,7 @@ static struct attribute *nvme_dev_attrs[] = {
>> &dev_attr_ctrl_loss_tmo.attr,
>> &dev_attr_fast_io_fail_tmo.attr,
>> &dev_attr_reconnect_delay.attr,
>> + &dev_attr_kato.attr,
>> NULL
>> };
>>
>
> This is helpful indeed. But looks like the actual kato value sent down
> the wire is ctrl->kato + NVME_KATO_GRACE. Wondering if that may end up
> confusing the end user.
>
For that I had another patch sent, 'nvme: sanitize KATO setting'.
Might be an idea to roll this one into that set to make it clear.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: 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] 4+ messages in thread
end of thread, other threads:[~2021-03-01 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 7:52 [PATCH] nvme: add 'kato' sysfs attribute Hannes Reinecke
2021-02-26 9:11 ` Daniel Wagner
2021-03-01 15:39 ` George, Martin
2021-03-01 16:46 ` Hannes Reinecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).