Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] nvmetcli: make model and ctrl-id configurable
@ 2019-11-22  7:42 Chaitanya Kulkarni
  2019-11-22  7:42 ` [PATCH 1/2] nvmetcli: allow setting of the cntlid[min|max] Chaitanya Kulkarni
  2019-11-22  7:42 ` [PATCH 2/2] nvmetcli: allow setting of the subsystem model Chaitanya Kulkarni
  0 siblings, 2 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2019-11-22  7:42 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, Chaitanya Kulkarni

Hi,

This patch series allows users to set the subsys model and ctrl-id
fields.

Chaitanya Kulkarni (2):
  nvmetcli: allow setting of the cntlid[min|max]
  nvmetcli: allow setting of the subsystem model

 nvmetcli | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

-- 
2.22.1


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

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

* [PATCH 1/2] nvmetcli: allow setting of the cntlid[min|max]
  2019-11-22  7:42 [PATCH 0/2] nvmetcli: make model and ctrl-id configurable Chaitanya Kulkarni
@ 2019-11-22  7:42 ` Chaitanya Kulkarni
  2019-11-22  7:42 ` [PATCH 2/2] nvmetcli: allow setting of the subsystem model Chaitanya Kulkarni
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2019-11-22  7:42 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, Chaitanya Kulkarni

This patch allows users to set the subsystem's cntlid min and
cntlid max.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 nvmetcli | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/nvmetcli b/nvmetcli
index 3d8c16e..4fdac53 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -155,6 +155,8 @@ class UISubsystemNode(UINode):
     ui_desc_attr = {
         'allow_any_host': ('string', 'Allow access by any host if set to 1'),
         'serial': ('string', 'Export serial number to hosts'),
+        'cntlid_min': ('number', 'Set min ctrl id'),
+        'cntlid_max': ('number', 'Set max ctrl id'),
         'version': ('string', 'Export version number to hosts'),
     }
 
@@ -172,6 +174,21 @@ class UISubsystemNode(UINode):
         info.append("allow_any=" +
                     self.cfnode.get_attr("attr", "allow_any_host"))
         info.append("serial=" + self.cfnode.get_attr("attr", "serial"))
+
+        try:
+            cntlid_min = str(self.cfnode.get_attr("attr", "cntlid_min"))
+        except Exception as e:
+            cntlid_min = "n/a"
+        if cntlid_min != "n/a":
+            info.append("cntlid_min=" + cntlid_min)
+
+        try:
+            cntlid_max = str(self.cfnode.get_attr("attr", "cntlid_max"))
+        except Exception as e:
+            cntlid_max = "n/a"
+        if cntlid_max != "n/a":
+            info.append("cntlid_max=" + cntlid_max)
+
         return (", ".join(info), True)
 
 
-- 
2.22.1


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

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

* [PATCH 2/2] nvmetcli: allow setting of the subsystem model
  2019-11-22  7:42 [PATCH 0/2] nvmetcli: make model and ctrl-id configurable Chaitanya Kulkarni
  2019-11-22  7:42 ` [PATCH 1/2] nvmetcli: allow setting of the cntlid[min|max] Chaitanya Kulkarni
@ 2019-11-22  7:42 ` Chaitanya Kulkarni
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2019-11-22  7:42 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, Chaitanya Kulkarni

From: Mark Ruijter <MRuijter@onestopsystems.com>

This patch allows users to set the subsystem's model.

Signed-off-by: Mark Ruijter <MRuijter@onestopsystems.com>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 nvmetcli | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nvmetcli b/nvmetcli
index 4fdac53..ea17f95 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -157,6 +157,7 @@ class UISubsystemNode(UINode):
         'serial': ('string', 'Export serial number to hosts'),
         'cntlid_min': ('number', 'Set min ctrl id'),
         'cntlid_max': ('number', 'Set max ctrl id'),
+        'model': ('string', 'Set a model description'),
         'version': ('string', 'Export version number to hosts'),
     }
 
@@ -189,6 +190,13 @@ class UISubsystemNode(UINode):
         if cntlid_max != "n/a":
             info.append("cntlid_max=" + cntlid_max)
 
+        try:
+            model = str(self.cfnode.get_attr("attr", "model"))
+        except Exception as e:
+            model = "n/a"
+        if model != "n/a":
+            info.append("model=" + model)
+
         return (", ".join(info), True)
 
 
-- 
2.22.1


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

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22  7:42 [PATCH 0/2] nvmetcli: make model and ctrl-id configurable Chaitanya Kulkarni
2019-11-22  7:42 ` [PATCH 1/2] nvmetcli: allow setting of the cntlid[min|max] Chaitanya Kulkarni
2019-11-22  7:42 ` [PATCH 2/2] nvmetcli: allow setting of the subsystem model Chaitanya Kulkarni

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git