[PATCHv3 03/11] nvmet: implement supported log pages

Chaitanya Kulkarni chaitanyak at nvidia.com
Tue Nov 5 21:16:02 PST 2024


On 11/5/24 09:48, Keith Busch wrote:
> From: Keith Busch<kbusch at kernel.org>
> 
> This log is required for nvme 2.1.
> 
> Signed-off-by: Keith Busch<kbusch at kernel.org>
> ---
>   drivers/nvme/target/admin-cmd.c | 29 +++++++++++++++++++++++++++++
>   include/linux/nvme.h            |  1 +
>   2 files changed, 30 insertions(+)
> 
> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> index a13242e791c0f..b8229d6c9998d 100644
> --- a/drivers/nvme/target/admin-cmd.c
> +++ b/drivers/nvme/target/admin-cmd.c
> @@ -71,6 +71,33 @@ static void nvmet_execute_get_log_page_error(struct nvmet_req *req)
>   	nvmet_req_complete(req, 0);
>   }
>   
> +static void nvmet_execute_get_supported_log_pages(struct nvmet_req *req)
> +{
> +	__le32 *logs;
> +	u16 status;
> +
> +	logs = kzalloc(1024, GFP_KERNEL);
> +	if (!logs) {
> +		status = NVME_SC_INTERNAL;
> +		goto out;
> +	}
> +
> +	logs[NVME_LOG_SUPPORTED] = cpu_to_le32(1);
> +	logs[NVME_LOG_ERROR] = cpu_to_le32(1);
> +	logs[NVME_LOG_SMART] = cpu_to_le32(1);
> +	logs[NVME_LOG_FW_SLOT] = cpu_to_le32(1);
> +	logs[NVME_LOG_CHANGED_NS] = cpu_to_le32(1);
> +	logs[NVME_LOG_CMD_EFFECTS] = cpu_to_le32(1);
> +	logs[NVME_LOG_ENDURANCE_GROUP] = cpu_to_le32(1);
> +	logs[NVME_LOG_ANA] = cpu_to_le32(1);
> +	logs[NVME_LOG_RMI] = cpu_to_le32(1);

based on what we have in nvmet_get_cmd_effects_nvm() how about :-

         logs[NVME_LOG_SUPPORTED] =
         logs[NVME_LOG_ERROR] =
         logs[NVME_LOG_SMART] =
         logs[NVME_LOG_FW_SLOT] =
         logs[NVME_LOG_CHANGED_NS] =
         logs[NVME_LOG_CMD_EFFECTS] =
         logs[NVME_LOG_ENDURANCE_GROUP] =
         logs[NVME_LOG_ANA] =
         logs[NVME_LOG_RMI] =
                         	cpu_to_le32(1);

if you don't like please ignore this comment.

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>

-ck







More information about the Linux-nvme mailing list