Skip to contentSkip to conversation

Support inline_data_size port parameter

PATCH New Steve Wise 2 participants 4 messages Jul 2, 2018 – Jul 3, 2018 NVMe

lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH 1/1 Support inline_data_size port parameter

The port parameter attribute param_inline_data_size allows adjusting the amount of inline data that can be included in a write IO. Setting it to < 0 (or not setting it at all) allows the transport to choose a reasonable default, which will be 0 if that transport does not support inline. Setting it to 0 disables the transport from using inline_data. And setting it to > 0 configures that port/transport to use that inline data size, in bytes, if the transport supports it.

Signed_off_by: Steve Wise <swise at opengridcomputing.com>

---
 nvmet/nvme.py | 4 ++--
 nvmetcli      | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
nvmet/nvme.py +2 -2
index 8253ea9264b7..1aac7bc3fea3 100644
@@ -609,7 +609,7 @@ class Port(CFSNode):
     def __init__(self, portid, mode='any'):
         super(Port, self).__init__()
 
-        self.attr_groups = ['addr']
+        self.attr_groups = ['addr', 'param']
         self._portid = int(portid)
         self._path = "%s/ports/%d" % (self.configfs_dir, self._portid)
         self._create_in_cfs(mode)
@@ -710,7 +710,7 @@ class Referral(CFSNode):
         if not isinstance(port, Port):
             raise CFSError("Invalid parent class")
 
-        self.attr_groups = ['addr']
+        self.attr_groups = ['addr', 'param']
         self.port = port
         self._name = name
         self._path = "%s/referrals/%s" % (self.port.path, self._name)
nvmetcli +7 -0
index 6b102a235450..16528ace61ea 100755
@@ -374,6 +374,9 @@ class UIPortNode(UINode):
         'trsvcid': ('string', 'Transport Service ID (e.g. IP Port)'),
         'trtype': ('string', 'Transport Type (e.g. rdma or loop or fc)'),
     }
+    ui_desc_param = {
+        'inline_data_size': ('string', 'Port inline data size in bytes'),
+    }
 
     def __init__(self, parent, cfnode):
         UINode.__init__(self, str(cfnode.portid), parent, cfnode)
@@ -387,6 +390,7 @@ class UIPortNode(UINode):
         trsvcid = self.cfnode.get_attr("addr", "trsvcid")
         if trsvcid != "none":
             info.append("trsvcid=%s" % trsvcid)
+        info.append("inline_data_size=" + self.cfnode.get_attr("param", "inline_data_size"))
         enabled = not (not self.cfnode.subsystems and not list(self.cfnode.referrals))
         return (", ".join(info), True if enabled else 0)
 
@@ -493,6 +497,9 @@ class UIReferralNode(UINode):
         'trtype': ('string', 'Transport Type (e.g. rdma or loop or fc)'),
         'portid': ('number', 'Port identifier'),
     }
+    ui_desc_param = {
+        'inline_data_size': ('string', 'Port inline data size in bytes'),
+    }
 
     def __init__(self, parent, cfnode):
         UINode.__init__(self, cfnode.name, parent, cfnode)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/1 Support inline_data_size port parameter

Oops: forgot to add "nvmetcli" in the subject.

Steve.

Quoted 59 lines · Steve Wise

The port parameter attribute param_inline_data_size allows adjusting the amount of inline data that can be included in a write IO. Setting it to < 0 (or not setting it at all) allows the transport to choose a reasonable default, which will be 0 if that transport does not support inline. Setting it to 0 disables the transport from using inline_data. And setting it to > 0 configures that port/transport to use that inline data size, in bytes, if the transport supports it.

Signed_off_by: Steve Wise <swise at opengridcomputing.com>

---
 nvmet/nvme.py | 4 ++--
 nvmetcli      | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
nvmet/nvme.py +2 -2
index 8253ea9264b7..1aac7bc3fea3 100644
@@ -609,7 +609,7 @@ class Port(CFSNode):
     def __init__(self, portid, mode='any'):
         super(Port, self).__init__()
 
-        self.attr_groups = ['addr']
+        self.attr_groups = ['addr', 'param']
         self._portid = int(portid)
         self._path = "%s/ports/%d" % (self.configfs_dir, self._portid)
         self._create_in_cfs(mode)
@@ -710,7 +710,7 @@ class Referral(CFSNode):
         if not isinstance(port, Port):
             raise CFSError("Invalid parent class")
 
-        self.attr_groups = ['addr']
+        self.attr_groups = ['addr', 'param']
         self.port = port
         self._name = name
         self._path = "%s/referrals/%s" % (self.port.path, self._name)
nvmetcli +4 -0
index 6b102a235450..16528ace61ea 100755
@@ -374,6 +374,9 @@ class UIPortNode(UINode):
         'trsvcid': ('string', 'Transport Service ID (e.g. IP Port)'),
         'trtype': ('string', 'Transport Type (e.g. rdma or loop or fc)'),
     }
+    ui_desc_param = {
+        'inline_data_size': ('string', 'Port inline data size in bytes'),
+    }
 
     def __init__(self, parent, cfnode):
         UINode.__init__(self, str(cfnode.portid), parent, cfnode)
@@ -387,6 +390,7 @@ class UIPortNode(UINode):
         trsvcid = self.cfnode.get_attr("addr", "trsvcid")
         if trsvcid != "none":
             info.append("trsvcid=%s" % trsvcid)
+        info.append("inline_data_size=" + self.cfnode.get_attr("param", "inline_data_size"))
         enabled = not (not self.cfnode.subsystems and not list(self.cfnode.referrals))
         return (", ".join(info), True if enabled else 0)
 

nvmetcli class UIReferralNode(UINode): · line 505

Quoted 9 lines
nvmetcli +3 -0
@@ -493,6 +497,9 @@ class UIReferralNode(UINode):
         'trtype': ('string', 'Transport Type (e.g. rdma or loop or fc)'),
         'portid': ('number', 'Port identifier'),
     }
+    ui_desc_param = {
+        'inline_data_size': ('string', 'Port inline data size in bytes'),
+    }
 
     def __init__(self, parent, cfnode):
         UINode.__init__(self, cfnode.name, parent, cfnode)

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

maintainer
#2 lore raw

PATCH 1/1 Support inline_data_size port parameter

In reply to Steve Wise

nvmetcli class UIReferralNode(UINode): · line 502

Quoted 8 lines
nvmetcli +3 -0
@@ -493,6 +497,9 @@ class UIReferralNode(UINode):
          'trtype': ('string', 'Transport Type (e.g. rdma or loop or fc)'),
          'portid': ('number', 'Port identifier'),
      }
+    ui_desc_param = {
+        'inline_data_size': ('string', 'Port inline data size in bytes'),
+    }

Umm, should a referral node have this?

Also, would this work with kernels that don't have it yet?

author
#3 lore raw

PATCH 1/1 Support inline_data_size port parameter

Quoted 13 lines · Sagi Grimberg
Quoted 10 lines
(quoted diff) +0 -0
@@ -493,6 +497,9 @@ class UIReferralNode(UINode):

????????? 'trtype': ('string', 'Transport Type (e.g. rdma or loop or fc)'),
????????? 'portid': ('number', 'Port identifier'),
????? }
+??? ui_desc_param = {
+??????? 'inline_data_size': ('string', 'Port inline data size in bytes'),
+??? }

Umm, should a referral node have this?

I didn't know what a referral node is. :)? I'll remove it.

Quoted 1 line

Also, would this work with kernels that don't have it yet?

Yea, it doesn't work.? I'll fix that.?? How should it deal with that?

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus