History

NVMe: Update SCSI Inquiry VPD 83h translation

The original translation created collisions on Inquiry VPD 83 for many existing devices. Newer specifications provide other ways to translate based on the device's version can be used to create unique identifiers. Version 1.1 provides an EUI64 field that uniquely identifies each namespace, and 1.2 added the longer NGUID field for the same reason. Both follow the IEEE EUI format and readily translate to the SCSI device identification EUI designator type 2h. For devices implementing either, the translation will use this type, defaulting to the EUI64 8-byte type if implemented then NGUID's 16 byte version if not. If neither are provided, the 1.0 translation is used, and is updated to use the SCSI String format to guarantee a unique identifier. Knowing when to use the new fields depends on the nvme controller's revision. The NVME_VS macro was not decoding this correctly, so that is fixed in this patch and moved to a more appropriate place. Since the Identify Namespace structure required an update for the NGUID field, this patch adds the remaining new 1.2 fields to the structure.

Keith Busch committed 11 years ago

Commit 4f1982b1 parent e1e5e563 files · +62 −44Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/nvme.h+9−1
@@ -115,7 +115,13 @@ struct nvme_id_ns { · 114 unmodified lines
115115 __le16 nawun;
116116 __le16 nawupf;
117117 __le16 nacwu;
118− __u8 rsvd40[80];
118+ __le16 nabsn;
119+ __le16 nabo;
120+ __le16 nabspf;
121+ __u16 rsvd46;
122+ __le64 nvmcap[2];
123+ __u8 rsvd64[40];
124+ __u8 nguid[16];
119125 __u8 eui64[8];
120126 struct nvme_lbaf lbaf[16];
121127 __u8 rsvd192[192];
@@ -565,6 +571,8 @@ struct nvme_passthru_cmd { · 443 unmodified lines
565571 __u32 result;
566572 };
567573
574+#define NVME_VS(major, minor) (((major) << 16) | ((minor) << 8))
575+
568576 #define nvme_admin_cmd nvme_passthru_cmd
569577
570578 #define NVME_IOCTL_ID _IO('N', 0x40)