Skip to contentSkip to conversation

nvme: Add ctrl attributes for queue_count and sqsize

PATCH Superseded James Smart 5 participants 5 messages Sep 24, 2019 – Sep 25, 2019 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: Add ctrl attributes for queue_count and sqsize

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.

---
 drivers/nvme/host/core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/nvme/host/core.c +4 -0
index e0e2dcbfd05e..b1c24af284ca 100644
@@ -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
 };
 
Signature · 7 lines
2.13.7


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · 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.

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

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

Quoted 8 lines
drivers/nvme/host/core.c +2 -0
@@ -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
 };
 

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke		      Teamlead Storage & Networking
[email protected]			                  +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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#2 lore raw
In reply to James Smart

Looks good.

Quoted 26 lines · 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.

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

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

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

maintainer
#3 lore raw
In reply to James Smart
Quoted 17 lines · 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.

---
 drivers/nvme/host/core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/nvme/host/core.c +0 -0
index e0e2dcbfd05e..b1c24af284ca 100644

drivers/nvme/host/core.c static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL); · line 3044

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

#4 lore raw
Quoted 19 lines · Keith Busch
Quoted 18 lines · 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.

---
  drivers/nvme/host/core.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/nvme/host/core.c +0 -0
index e0e2dcbfd05e..b1c24af284ca 100644
@@ -3040,6 +3040,8 @@ static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL);
 
Quoted 6 lines

drivers/nvme/host/core.c static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL); · line 3044

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