nvme-cli: Implemented virtualization management admin command
PATCH 1/1 nvme-cli: Implemented virtualization management admin command
--- 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
@@ -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
@@ -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
@@ -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
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.
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.