linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 2/5] nvme: Add ANA base definitions
Date: Wed, 9 May 2018 09:27:46 +0200	[thread overview]
Message-ID: <20180509072746.GB20363@lst.de> (raw)
In-Reply-To: <20180504112845.38820-3-hare@suse.de>

On Fri, May 04, 2018@01:28:42PM +0200, Hannes Reinecke wrote:
> Add definitions from the ANA TP errata.
> 
> Signed-off-by: Hannes Reinecke <hare at suse.com>
> ---
>  include/linux/nvme.h | 47 ++++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 44 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/nvme.h b/include/linux/nvme.h
> index 4112e2bd747f..40c2d08ee761 100644
> --- a/include/linux/nvme.h
> +++ b/include/linux/nvme.h
> @@ -242,7 +242,11 @@ struct nvme_id_ctrl {
>  	__le32			sanicap;
>  	__le32			hmminds;
>  	__le16			hmmaxd;
> -	__u8			rsvd338[174];
> +	__u8			anatt;
> +	__u8			anacap;
> +	__le32			anagrpmax;
> +	__le32			nanagrpid;
> +	__u8			rsvd338[164];

SANICAP is at bytes 328 to 331, the HMM field go from 332 to 337,
so we really need to reserve bytes 338, 339, and 340 before starting
the ANA fields.  Note that this is already hinted at by the naming
for the rsvd338 field.  So the new post-ana rsvd field should also
be named rsvd352

>  	__u8			rsvd1024[768];
>  	__le32			ioccsz;
> @@ -312,7 +317,8 @@ struct nvme_id_ns {
>  	__le16			nabspf;
>  	__le16			noiob;
>  	__u8			nvmcap[16];
> -	__u8			rsvd64[40];
> +	__u8			rsvd64[36];
> +	__le32			anagrpid;
>  	__u8			nguid[16];

nguid is at offset 104, so if you please anagrip just before
it it is in the wrong offset.

> +	NVME_ANA_STATE_OPTIMIZED = 0x01,
> +	NVME_ANA_STATE_NONOPTIMIZED = 0x02,
> +	NVME_ANA_STATE_INACCESSIBLE = 0x03,
> +	NVME_ANA_STATE_PERSISTENT_LOSS = 0x04,
> +	NVME_ANA_STATE_CHANGE_STATE = 0x05,

Please make this a separate 'enum nvme_ana_state'

> +/* Asymmetric Namespace Access log page entry */
> +struct nvmf_ana_group_descriptor {
> +	__le32 groupid;
> +	__le32 nsid_num;
> +	__le64 chgcnt;
> +	__u8 ana_state;
> +	__u8 resv1[7];

Pleae encode the offset of the reserved field in the name:

	__u8 resv17[7];

> +	__le32 nsid[0];

Please use C99 flexible arrays:

	__le32 nsid[];

> +struct nvmf_ana_rsp_page_header {
> +	__le64 chgcnt;
> +	__le16 grpid_num;
> +	__le16 resv[3];
> +	struct nvmf_ana_group_descriptor desc[0];
> +};

Same here.

also we use _hdr for the discover log name, maybe match that here.

  parent reply	other threads:[~2018-05-09  7:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 11:28 [RFC PATCH 0/5] nvme: ANA support Hannes Reinecke
2018-05-04 11:28 ` [PATCH 1/5] nvmet: EUI64 support Hannes Reinecke
2018-05-07  7:17   ` Johannes Thumshirn
2018-05-09  7:08   ` Christoph Hellwig
2018-05-09  7:45     ` Hannes Reinecke
2018-05-09  7:52       ` Christoph Hellwig
2018-05-09 15:43   ` Ewan D. Milne
2018-05-04 11:28 ` [PATCH 2/5] nvme: Add ANA base definitions Hannes Reinecke
2018-05-04 16:17   ` Keith Busch
2018-05-04 17:03     ` Meneghini, John
2018-05-04 17:21       ` Knight, Frederick
2018-05-05 13:17       ` Hannes Reinecke
2018-05-04 21:12   ` Schremmer, Steven
2018-05-09  7:27   ` Christoph Hellwig [this message]
2018-05-04 11:28 ` [PATCH 3/5] nvmet: Add ANA base support Hannes Reinecke
2018-05-06  2:42   ` Guan Junxiong
2018-05-04 11:28 ` [PATCH 4/5] block: BLK_STS_NEXUS is a path failure Hannes Reinecke
2018-05-09  7:31   ` Christoph Hellwig
2018-05-04 11:28 ` [PATCH 5/5] nvme: ANA base support Hannes Reinecke
2018-05-04 22:11   ` Schremmer, Steven
2018-05-05 13:23     ` Hannes Reinecke
2018-05-06  3:23   ` Guan Junxiong
2018-05-07  7:21   ` Johannes Thumshirn
2018-05-09 18:49   ` Ewan D. Milne
2018-05-09 19:03   ` Ewan D. Milne
2018-05-10  9:16     ` Sriram Popuri
     [not found]     ` <CAGYjvj0Mk0MFAfUEApOOyQ9Prm3CvGcZH14PJzDQT2+Qc+w81w@mail.gmail.com>
2018-05-10 13:40       ` Hannes Reinecke
2018-05-11  7:50       ` Hannes Reinecke
2018-05-11  8:22         ` Popuri, Sriram
2018-05-11  8:36           ` Popuri, Sriram
2018-05-11 16:24             ` Knight, Frederick
2018-05-12 13:31   ` Christoph Hellwig
2018-05-13 10:33     ` Hannes Reinecke

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=20180509072746.GB20363@lst.de \
    --to=hch@lst.de \
    /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).