From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH 2/5] nvme: Add ANA base definitions
Date: Fri, 4 May 2018 13:28:42 +0200 [thread overview]
Message-ID: <20180504112845.38820-3-hare@suse.de> (raw)
In-Reply-To: <20180504112845.38820-1-hare@suse.de>
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];
__u8 sqes;
__u8 cqes;
__le16 maxcmd;
@@ -258,7 +262,8 @@ struct nvme_id_ctrl {
__le16 acwu;
__u8 rsvd534[2];
__le32 sgls;
- __u8 rsvd540[228];
+ __le32 mnn;
+ __u8 rsvd540[224];
char subnqn[256];
__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];
__u8 eui64[8];
struct nvme_lbaf lbaf[16];
@@ -440,6 +446,7 @@ enum {
NVME_AER_VS = 7,
NVME_AER_NOTICE_NS_CHANGED = 0x0002,
NVME_AER_NOTICE_FW_ACT_STARTING = 0x0102,
+ NVME_AER_NOTICE_ANA_CHANGE = 0x0302,
};
struct nvme_lba_range_type {
@@ -748,11 +755,17 @@ enum {
NVME_LOG_SMART = 0x02,
NVME_LOG_FW_SLOT = 0x03,
NVME_LOG_CMD_EFFECTS = 0x05,
+ NVME_LOG_ANA = 0x0c,
NVME_LOG_DISC = 0x70,
NVME_LOG_RESERVATION = 0x80,
NVME_FWACT_REPL = (0 << 3),
NVME_FWACT_REPL_ACTV = (1 << 3),
NVME_FWACT_ACTV = (2 << 3),
+ 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,
};
struct nvme_identify {
@@ -917,6 +930,23 @@ struct nvmf_common_command {
__u8 ts[24];
};
+/* Asymmetric Namespace Access log page entry */
+struct nvmf_ana_group_descriptor {
+ __le32 groupid;
+ __le32 nsid_num;
+ __le64 chgcnt;
+ __u8 ana_state;
+ __u8 resv1[7];
+ __le32 nsid[0];
+};
+
+struct nvmf_ana_rsp_page_header {
+ __le64 chgcnt;
+ __le16 grpid_num;
+ __le16 resv[3];
+ struct nvmf_ana_group_descriptor desc[0];
+};
+
/*
* The legal cntlid range a NVMe Target will provide.
* Note that cntlid of value 0 is considered illegal in the fabrics world.
@@ -1135,6 +1165,8 @@ enum {
NVME_SC_NS_NOT_ATTACHED = 0x11a,
NVME_SC_THIN_PROV_NOT_SUPP = 0x11b,
NVME_SC_CTRL_LIST_INVALID = 0x11c,
+ NVME_SC_GRP_ID_INVALID = 0x123,
+ NVME_SC_ANA_ATTACH_FAILED = 0x124,
/*
* I/O Command Set Specific - NVM commands:
@@ -1168,6 +1200,15 @@ enum {
NVME_SC_ACCESS_DENIED = 0x286,
NVME_SC_UNWRITTEN_BLOCK = 0x287,
+ /* Path-related Errors */
+ NVME_SC_INTERNAL_PATH_ERROR = 0x300,
+ NVME_SC_ANA_PERSISTENT_LOSS = 0x301,
+ NVME_SC_ANA_INACCESSIBLE = 0x302,
+ NVME_SC_ANA_TRANSITION = 0x303,
+ NVME_SC_CTRL_PATHING_ERROR = 0x360,
+ NVME_SC_HOST_PATHING_ERROR = 0x370,
+ NVME_SC_HOST_ABORTED = 0x371,
+
NVME_SC_DNR = 0x4000,
};
--
2.12.3
next prev parent reply other threads:[~2018-05-04 11:28 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 ` Hannes Reinecke [this message]
2018-05-04 16:17 ` [PATCH 2/5] nvme: Add ANA base definitions 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
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=20180504112845.38820-3-hare@suse.de \
--to=hare@suse.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).