From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@meta.com>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, m@bjorling.me,
matias.bjorling@wdc.com, Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCHv3 04/11] nvmet: implement supported features log
Date: Wed, 6 Nov 2024 06:43:26 +0100 [thread overview]
Message-ID: <20241106054326.GD31330@lst.de> (raw)
In-Reply-To: <20241105174904.3612888-5-kbusch@meta.com>
On Tue, Nov 05, 2024 at 09:48:57AM -0800, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> This log is required for nvme 2.1.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/target/admin-cmd.c | 25 +++++++++++++++++++++++++
> include/linux/nvme.h | 1 +
> 2 files changed, 26 insertions(+)
>
> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> index b8229d6c9998d..c9b38d593fda5 100644
> --- a/drivers/nvme/target/admin-cmd.c
> +++ b/drivers/nvme/target/admin-cmd.c
> @@ -344,6 +344,29 @@ static void nvmet_execute_get_log_page_ana(struct nvmet_req *req)
> nvmet_req_complete(req, status);
> }
>
> +static void nvmet_execute_get_log_page_features(struct nvmet_req *req)
> +{
> + __le32 *features;
> + u16 status;
> +
> + features = kzalloc(1024, GFP_KERNEL);
The magic number here is a bit weird. Maybe add a
#define NVME_FEAT_MAX 256
and then make this ΝVME_FEAT_MAX * sizeof(*features)?
Same below.
> + if (!features) {
> + status = NVME_SC_INTERNAL;
> + goto out;
> + }
> +
> + features[NVME_FEAT_NUM_QUEUES] = cpu_to_le32(1 << 21 | 1);
> + features[NVME_FEAT_KATO] = cpu_to_le32(1 << 21 | 1);
> + features[NVME_FEAT_ASYNC_EVENT] = cpu_to_le32(1 << 21 | 1);
> + features[NVME_FEAT_HOST_ID] = cpu_to_le32(1 << 21 | 1);
> + features[NVME_FEAT_WRITE_PROTECT] = cpu_to_le32(1 << 20 | 1);
And having names for the bits / scopes would be kinda nice as well.
(maybe same for the logs in the last patch)
Otherwise this looks good to me.
next prev parent reply other threads:[~2024-11-06 5:43 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 17:48 [PATCHv3 00/11] Rotational storage support Keith Busch
2024-11-05 17:48 ` [PATCHv3 01/11] nvmet: implement id ns for nvm command set Keith Busch
2024-11-06 5:05 ` Chaitanya Kulkarni
2024-11-06 5:38 ` Christoph Hellwig
2024-11-07 0:30 ` Keith Busch
2024-11-05 17:48 ` [PATCHv3 02/11] nvmet: implement active command set ns list Keith Busch
2024-11-06 5:06 ` Chaitanya Kulkarni
2024-11-06 5:38 ` Christoph Hellwig
2024-11-05 17:48 ` [PATCHv3 03/11] nvmet: implement supported log pages Keith Busch
2024-11-06 4:24 ` Kanchan Joshi
2024-11-06 5:16 ` Chaitanya Kulkarni
2024-11-06 5:18 ` Chaitanya Kulkarni
2024-11-06 5:39 ` Christoph Hellwig
2024-11-05 17:48 ` [PATCHv3 04/11] nvmet: implement supported features log Keith Busch
2024-11-06 5:19 ` Chaitanya Kulkarni
2024-11-06 5:43 ` Christoph Hellwig [this message]
2024-11-05 17:48 ` [PATCHv3 05/11] nvmet: implement crto property Keith Busch
2024-11-06 5:43 ` Christoph Hellwig
2024-11-05 17:48 ` [PATCHv3 06/11] nvmet: declare 2.1 version compliance Keith Busch
2024-11-06 5:20 ` Chaitanya Kulkarni
2024-11-06 5:45 ` Christoph Hellwig
2024-11-06 6:13 ` Chaitanya Kulkarni
2024-11-05 17:49 ` [PATCHv3 07/11] nvmet: implement endurance groups Keith Busch
2024-11-06 5:23 ` Chaitanya Kulkarni
2024-11-06 5:55 ` Christoph Hellwig
2024-11-05 17:49 ` [PATCHv3 08/11] nvmet: implement rotational media information log Keith Busch
2024-11-06 5:56 ` Christoph Hellwig
2024-11-05 17:49 ` [PATCHv3 09/11] nvmet: support for csi identify ns Keith Busch
2024-11-06 5:46 ` Guixin Liu
2024-11-05 17:49 ` [PATCHv3 10/11] nvme: make independent ns identify default Keith Busch
2024-11-05 20:29 ` Keith Busch
2024-11-06 5:57 ` Christoph Hellwig
2024-11-05 17:49 ` [PATCHv3 11/11] nvme: add rotational support Keith Busch
2024-11-06 5:58 ` Christoph Hellwig
2024-11-06 6:15 ` Chaitanya Kulkarni
2024-11-06 7:57 ` Guixin Liu
2024-11-06 8:22 ` Christoph Hellwig
2024-11-07 0:35 ` Keith Busch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106054326.GD31330@lst.de \
--to=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-nvme@lists.infradead.org \
--cc=m@bjorling.me \
--cc=matias.bjorling@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).