@@ -89,6 +89,7 @@ static void nvmet_execute_get_supported_log_pages(struct nvmet_req *req)
8989 logs -> lids [NVME_LOG_CHANGED_NS ] = cpu_to_le32 (NVME_LIDS_LSUPP );
9090 logs -> lids [NVME_LOG_CMD_EFFECTS ] = cpu_to_le32 (NVME_LIDS_LSUPP );
9191 logs -> lids [NVME_LOG_ANA ] = cpu_to_le32 (NVME_LIDS_LSUPP );
92+ logs -> lids [NVME_LOG_FEATURES ] = cpu_to_le32 (NVME_LIDS_LSUPP );
9293 logs -> lids [NVME_LOG_RESERVATION ] = cpu_to_le32 (NVME_LIDS_LSUPP );
9394
9495 status = nvmet_copy_to_sgl (req , 0 , logs , sizeof (* logs ));
@@ -347,6 +348,36 @@ static void nvmet_execute_get_log_page_ana(struct nvmet_req *req)
347348 nvmet_req_complete (req , status );
348349}
349350
351+ static void nvmet_execute_get_log_page_features (struct nvmet_req * req )
352+ {
353+ struct nvme_supported_features_log * features ;
354+ u16 status ;
355+
356+ features = kzalloc (sizeof (* features ), GFP_KERNEL );
357+ if (!features ) {
358+ status = NVME_SC_INTERNAL ;
359+ goto out ;
360+ }
361+
362+ features -> fis [NVME_FEAT_NUM_QUEUES ] =
363+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
364+ features -> fis [NVME_FEAT_KATO ] =
365+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
366+ features -> fis [NVME_FEAT_ASYNC_EVENT ] =
367+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
368+ features -> fis [NVME_FEAT_HOST_ID ] =
369+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
370+ features -> fis [NVME_FEAT_WRITE_PROTECT ] =
371+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_NSCPE );
372+ features -> fis [NVME_FEAT_RESV_MASK ] =
373+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_NSCPE );
374+
375+ status = nvmet_copy_to_sgl (req , 0 , features , sizeof (* features ));
376+ kfree (features );
377+ out :
378+ nvmet_req_complete (req , status );
379+ }
380+
350381static void nvmet_execute_get_log_page (struct nvmet_req * req )
351382{
352383 if (!nvmet_check_transfer_len (req , nvmet_get_log_page_len (req -> cmd )))
@@ -372,6 +403,8 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req)
372403 return nvmet_execute_get_log_cmd_effects_ns (req );
373404 case NVME_LOG_ANA :
374405 return nvmet_execute_get_log_page_ana (req );
406+ case NVME_LOG_FEATURES :
407+ return nvmet_execute_get_log_page_features (req );
375408 case NVME_LOG_RESERVATION :
376409 return nvmet_execute_get_log_page_resv (req );
377410 }
0 commit comments