Skip to contentSkip to conversation

nvme: add 'kato' sysfs attribute

PATCH In review Hannes Reinecke 3 participants 4 messages Feb 26, 2021 – Mar 1, 2021 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: add 'kato' sysfs attribute

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.

---
 drivers/nvme/host/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/core.c +2 -0
index 1d5fc8a6fd37..9ad23472ac15 100644
@@ -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
 };
 
Signature · 7 lines
2.26.2


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Hannes Reinecke

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.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#2 lore raw
In reply to Hannes Reinecke
Quoted 24 lines · Hannes Reinecke

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.

---
 drivers/nvme/host/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/core.c +1 -0
index 1d5fc8a6fd37..9ad23472ac15 100644
@@ -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,

drivers/nvme/host/core.c static struct attribute *nvme_dev_attrs[] = { · line 3756

Quoted 7 lines
drivers/nvme/host/core.c +1 -0
@@ -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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#3 lore raw
Quoted 21 lines · Martin
Quoted 20 lines · Hannes Reinecke

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.

---
  drivers/nvme/host/core.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/nvme/host/core.c +1 -0
index 1d5fc8a6fd37..9ad23472ac15 100644
@@ -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);
 
Quoted 16 lines

drivers/nvme/host/core.c static struct attribute *nvme_dev_attrs[] = { · line 3756

Quoted 11 lines
drivers/nvme/host/core.c +0 -0
  static ssize_t nvme_sysfs_delete(struct device *dev,
                                 struct device_attribute *attr, const

char *buf,

drivers/nvme/host/core.c +1 -0
@@ -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

Signature · 9 lines
Dr. Hannes Reinecke                Kernel Storage Architect
[email protected]                              +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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme