Skip to content

Commit 64a5108

Browse files
committed
nvmet: implement id ns for nvm command set
We don't report anything here, but it's a mandatory identification for nvme 2.1. Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Matias Bjørling <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 5a47c20 commit 64a5108

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/nvme/target/admin-cmd.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,20 @@ static void nvmet_execute_identify_ctrl_nvm(struct nvmet_req *req)
701701
nvmet_zero_sgl(req, 0, sizeof(struct nvme_id_ctrl_nvm)));
702702
}
703703

704+
static void nvme_execute_identify_ns_nvm(struct nvmet_req *req)
705+
{
706+
u16 status;
707+
708+
status = nvmet_req_find_ns(req);
709+
if (status)
710+
goto out;
711+
712+
status = nvmet_copy_to_sgl(req, 0, ZERO_PAGE(0),
713+
NVME_IDENTIFY_DATA_SIZE);
714+
out:
715+
nvmet_req_complete(req, status);
716+
}
717+
704718
static void nvmet_execute_identify(struct nvmet_req *req)
705719
{
706720
if (!nvmet_check_transfer_len(req, NVME_IDENTIFY_DATA_SIZE))
@@ -722,8 +736,8 @@ static void nvmet_execute_identify(struct nvmet_req *req)
722736
case NVME_ID_CNS_CS_NS:
723737
switch (req->cmd->identify.csi) {
724738
case NVME_CSI_NVM:
725-
/* Not supported */
726-
break;
739+
nvme_execute_identify_ns_nvm(req);
740+
return;
727741
case NVME_CSI_ZNS:
728742
if (IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
729743
nvmet_execute_identify_ns_zns(req);

0 commit comments

Comments
 (0)