Skip to contentSkip to conversation

nvme-cli: Implemented virtualization management admin command

PATCH New Revanth Rajashekar 3 participants 3 messages Jun 14, 2018 – Jun 15, 2018 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-cli: Implemented virtualization management admin command

Signed-off-by Revanth Rajashekar <revanth.rajashekar at intel.com>
---
 nvme-builtin.h |  1 +
 nvme-ioctl.c   | 11 +++++++++
 nvme-ioctl.h   |  1 +
 nvme.c         | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 76 insertions(+)
nvme-builtin.h +1 -0
index 86b0fff..c7f1812 100644
@@ -63,6 +63,7 @@ COMMAND_LIST(
 	ENTRY("gen-hostnqn", "Generate NVMeoF host NQN", gen_hostnqn_cmd)
 	ENTRY("dir-receive", "Submit a Directive Receive command, return results", dir_receive)
 	ENTRY("dir-send", "Submit a Directive Send command, return results", dir_send)
+	ENTRY("virtualization-management", "Manage the resource virtualization in controller", virtual_mgmt)
 );
 
 #endif
nvme-ioctl.c +11 -0
index 63ff8fb..3e1ed07 100644
@@ -817,3 +817,14 @@ int nvme_self_test_start(int fd, __u32 nsid, __u32 cdw10)
 
 	return nvme_submit_admin_passthru(fd, &cmd);
 }
+
+int nvme_virtual_mgmt(int fd, __u32 cdw10, __u32 cdw11)
+{
+	struct nvme_admin_cmd cmd = {
+		.opcode = nvme_admin_virtual_mgmt,
+		.cdw10  = cdw10,
+		.cdw11  = cdw11,
+	};
+
+	return nvme_submit_admin_passthru(fd, &cmd);
+}
nvme-ioctl.h +1 -0
index 6d4ac95..78d05fd 100644
@@ -138,4 +138,5 @@ int nvme_sanitize(int fd, __u8 sanact, __u8 ause, __u8 owpass, __u8 oipbp,
 		  __u8 no_dealloc, __u32 ovrpat);
 int nvme_self_test_start(int fd, __u32 nsid, __u32 cdw10);
 int nvme_self_test_log(int fd, struct nvme_self_test_log *self_test_log);
+int nvme_virtual_mgmt(int fd, __u32 cdw10, __u32 cdw11);
 #endif				/* _NVME_LIB_H */
nvme.c +63 -0

69 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 nvme-cli: Implemented virtualization management admin command

Quoted 1 line · Revanth Rajashekar
Signed-off-by Revanth Rajashekar <revanth.rajashekar at intel.com>

How has this been tested? Especially the flexible resource assignments really need some kernel support so that the host driver can stop using the resources.

#2 lore raw

PATCH 1/1 nvme-cli: Implemented virtualization management admin command

Quoted 6 lines · Christoph Hellwig
Quoted 1 line · Revanth Rajashekar
Signed-off-by Revanth Rajashekar <revanth.rajashekar at intel.com>

How has this been tested? Especially the flexible resource assignments really need some kernel support so that the host driver can stop using the resources.

I'm not sure this can be sufficiently tested without some prep-patches adding Identify Primary Controller Capabilities and Identify Secondary Controler List commands.

But what do we need from the primary controller driver to support this?

Flexible resources assigned to a primary controller are are not actually used or released until you do a controller reset following your virtualization management commands, so the driver will automatically react to the new assignment.

For a secondary controller's flexible resource assignement, you can only assign flexible resources from the primary controller when the secondary is offline, so the resources should be discovered by the driver when the controller is brought online again.

Neither appear to have a requirement for the driver to be aware these management commands are happening.