linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NVMe: Update namespace and controller identity structures as per 1.1a spec
@ 2014-04-19 21:19 Dimitri John Ledkov
  2014-04-23 15:13 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Dimitri John Ledkov @ 2014-04-19 21:19 UTC (permalink / raw)
  To: linux-nvme; +Cc: keith.busch, willy, linux-kernel

Controller: add CNTLID, AVSCC, APSTA, NVSCC, ACWU, SGLS fields.

Namespace: add NMIC, RESCAP, EUI64 fields. EUI64 is specifically
interesting, since it can be used to construct an UEFI NVMe device
path for a boot entry.

As per NVM Express 1.1a spec:
http://www.nvmexpress.org/wp-content/uploads/NVM-Express-1_1a.pdf

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
 include/uapi/linux/nvme.h | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index 096fe1c..73cb2af 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -49,7 +49,8 @@ struct nvme_id_ctrl {
 	__u8			ieee[3];
 	__u8			mic;
 	__u8			mdts;
-	__u8			rsvd78[178];
+	__le16			cntlid;
+	__u8			rsvd80[176];
 	__le16			oacs;
 	__u8			acl;
 	__u8			aerl;
@@ -57,7 +58,9 @@ struct nvme_id_ctrl {
 	__u8			lpa;
 	__u8			elpe;
 	__u8			npss;
-	__u8			rsvd264[248];
+	__u8			avscc;
+	__u8			apsta;
+	__u8			rsvd266[246];
 	__u8			sqes;
 	__u8			cqes;
 	__u8			rsvd514[2];
@@ -68,7 +71,12 @@ struct nvme_id_ctrl {
 	__u8			vwc;
 	__le16			awun;
 	__le16			awupf;
-	__u8			rsvd530[1518];
+	__u8			nvscc;
+	__u8			rsvd531;
+	__le16			acwu;
+	__u8			rsvd534[2];
+	__le32			sgls;
+	__u8			rsvd540[1508];
 	struct nvme_id_power_state	psd[32];
 	__u8			vs[1024];
 };
@@ -95,7 +103,10 @@ struct nvme_id_ns {
 	__u8			mc;
 	__u8			dpc;
 	__u8			dps;
-	__u8			rsvd30[98];
+	__u8			nmic;
+	__u8			rescap;
+	__u8			rsvd32[88];
+	__le64			eui64;
 	struct nvme_lbaf	lbaf[16];
 	__u8			rsvd192[192];
 	__u8			vs[3712];
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] NVMe: Update namespace and controller identity structures as per 1.1a spec
  2014-04-19 21:19 [PATCH] NVMe: Update namespace and controller identity structures as per 1.1a spec Dimitri John Ledkov
@ 2014-04-23 15:13 ` Matthew Wilcox
  2014-05-07 19:55   ` [PATCH v2] " Dimitri John Ledkov
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2014-04-23 15:13 UTC (permalink / raw)
  To: Dimitri John Ledkov; +Cc: linux-nvme, keith.busch, linux-kernel

On Sat, Apr 19, 2014 at 10:19:57PM +0100, Dimitri John Ledkov wrote:
> Controller: add CNTLID, AVSCC, APSTA, NVSCC, ACWU, SGLS fields.
> 
> Namespace: add NMIC, RESCAP, EUI64 fields. EUI64 is specifically
> interesting, since it can be used to construct an UEFI NVMe device
> path for a boot entry.
> 
> As per NVM Express 1.1a spec:
> http://www.nvmexpress.org/wp-content/uploads/NVM-Express-1_1a.pdf

Thanks for the patch!

> -	__u8			rsvd78[178];
> +	__le16			cntlid;
> +	__u8			rsvd80[176];

I don't think cntlid is a little-endian value.  I think it's a cookie,
so this should be __u16.

> -	__u8			rsvd30[98];
> +	__u8			nmic;
> +	__u8			rescap;
> +	__u8			rsvd32[88];
> +	__le64			eui64;

eui64 isn't treated as a 64-bit value elsewhere in the kernel, rather as
an array of bytes.  So I think this one should be:

	__u8			eui64[8];

That matches the IEEE's recommendations:

An EUI-64 is a string of eight octets, labeled as eui[0] through eui[7].

(see http://standards.ieee.org/develop/regauth/tut/eui64.pdf)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] NVMe: Update namespace and controller identity structures as per 1.1a spec
  2014-04-23 15:13 ` Matthew Wilcox
@ 2014-05-07 19:55   ` Dimitri John Ledkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dimitri John Ledkov @ 2014-05-07 19:55 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-nvme, linux-kernel, Dimitri John Ledkov

Controller: add CNTLID, AVSCC, APSTA, NVSCC, ACWU, SGLS fields.

Namespace: add NMIC, RESCAP, EUI64 fields. EUI64 is specifically
interesting, since it can be used to construct an UEFI NVMe device
path for a boot entry.

As per NVM Express 1.1a spec:
http://www.nvmexpress.org/wp-content/uploads/NVM-Express-1_1a.pdf

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---

 Changes since v1:
  - Change cntlid from __le16 to __u16 ("it's a cookie")
  - Change eui64 from __le64 to __u8[8] (as per IEEE's recommendation)

 include/uapi/linux/nvme.h | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index f090336..e74da78 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -45,7 +45,8 @@ struct nvme_id_ctrl {
 	__u8			ieee[3];
 	__u8			mic;
 	__u8			mdts;
-	__u8			rsvd78[178];
+	__u16			cntlid;
+	__u8			rsvd80[176];
 	__le16			oacs;
 	__u8			acl;
 	__u8			aerl;
@@ -53,7 +54,9 @@ struct nvme_id_ctrl {
 	__u8			lpa;
 	__u8			elpe;
 	__u8			npss;
-	__u8			rsvd264[248];
+	__u8			avscc;
+	__u8			apsta;
+	__u8			rsvd266[246];
 	__u8			sqes;
 	__u8			cqes;
 	__u8			rsvd514[2];
@@ -64,7 +67,12 @@ struct nvme_id_ctrl {
 	__u8			vwc;
 	__le16			awun;
 	__le16			awupf;
-	__u8			rsvd530[1518];
+	__u8			nvscc;
+	__u8			rsvd531;
+	__le16			acwu;
+	__u8			rsvd534[2];
+	__le32			sgls;
+	__u8			rsvd540[1508];
 	struct nvme_id_power_state	psd[32];
 	__u8			vs[1024];
 };
@@ -92,7 +100,10 @@ struct nvme_id_ns {
 	__u8			mc;
 	__u8			dpc;
 	__u8			dps;
-	__u8			rsvd30[98];
+	__u8			nmic;
+	__u8			rescap;
+	__u8			rsvd32[88];
+	__u8			eui64[8];
 	struct nvme_lbaf	lbaf[16];
 	__u8			rsvd192[192];
 	__u8			vs[3712];
-- 
2.0.0.rc0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] NVMe: Update namespace and controller identity structures as per 1.1a spec
@ 2014-04-19 21:19 Dimitri John Ledkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dimitri John Ledkov @ 2014-04-19 21:19 UTC (permalink / raw)
  Cc: keith.busch, willy, linux-kernel

Controller: add CNTLID, AVSCC, APSTA, NVSCC, ACWU, SGLS fields.

Namespace: add NMIC, RESCAP, EUI64 fields. EUI64 is specifically
interesting, since it can be used to construct an UEFI NVMe device
path for a boot entry.

As per NVM Express 1.1a spec:
http://www.nvmexpress.org/wp-content/uploads/NVM-Express-1_1a.pdf

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
 include/uapi/linux/nvme.h | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index 096fe1c..73cb2af 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -49,7 +49,8 @@ struct nvme_id_ctrl {
 	__u8			ieee[3];
 	__u8			mic;
 	__u8			mdts;
-	__u8			rsvd78[178];
+	__le16			cntlid;
+	__u8			rsvd80[176];
 	__le16			oacs;
 	__u8			acl;
 	__u8			aerl;
@@ -57,7 +58,9 @@ struct nvme_id_ctrl {
 	__u8			lpa;
 	__u8			elpe;
 	__u8			npss;
-	__u8			rsvd264[248];
+	__u8			avscc;
+	__u8			apsta;
+	__u8			rsvd266[246];
 	__u8			sqes;
 	__u8			cqes;
 	__u8			rsvd514[2];
@@ -68,7 +71,12 @@ struct nvme_id_ctrl {
 	__u8			vwc;
 	__le16			awun;
 	__le16			awupf;
-	__u8			rsvd530[1518];
+	__u8			nvscc;
+	__u8			rsvd531;
+	__le16			acwu;
+	__u8			rsvd534[2];
+	__le32			sgls;
+	__u8			rsvd540[1508];
 	struct nvme_id_power_state	psd[32];
 	__u8			vs[1024];
 };
@@ -95,7 +103,10 @@ struct nvme_id_ns {
 	__u8			mc;
 	__u8			dpc;
 	__u8			dps;
-	__u8			rsvd30[98];
+	__u8			nmic;
+	__u8			rescap;
+	__u8			rsvd32[88];
+	__le64			eui64;
 	struct nvme_lbaf	lbaf[16];
 	__u8			rsvd192[192];
 	__u8			vs[3712];
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-07 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-19 21:19 [PATCH] NVMe: Update namespace and controller identity structures as per 1.1a spec Dimitri John Ledkov
2014-04-23 15:13 ` Matthew Wilcox
2014-05-07 19:55   ` [PATCH v2] " Dimitri John Ledkov
  -- strict thread matches above, loose matches on Subject: below --
2014-04-19 21:19 [PATCH] " Dimitri John Ledkov

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).