[PATCH] nvme.h: expend lbaf on nvme_id_ns, lbafe on nvme_zns_id_ns

Steven Seungcheol Lee sc108.lee at gmail.com
Mon Sep 27 19:19:40 PDT 2021


@Keith Busch
As I mentioned on commit, Its already been used from kernel source.

@Niklas Cassel
Thanks for the chekcing details, I made mistake for the structure name
since I brought those changes from nvme-cli.

Added more details on commit message about both of you guy's question.


=========== modified commit below=============
modification for supporting more LBA format from the device
if the nvme device does support over 16 LBA format,
current nvme driver will occur error.

lbaf, lbafe currently used on nvme driver
lbaf:
    function nvme_configure_metadata
    function nvme_update_ns_info
    function nvmet_passthru_override_id_ns

lbafe:
    function nvme_update_zone_info

The structure chages based on spec:
    NVMe-NVM-Command-Set-Specification-1.0a-2021.07.26-Ratified
    NVMe-Zoned-Namespace-Command-Set-Specification-1.1a-2021.07.26-Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee at gmail.com>
---
 include/linux/nvme.h | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index b7c4c4130b65..2d03c7322ac9 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -368,7 +368,10 @@ struct nvme_id_ns {
  __le16 npdg;
  __le16 npda;
  __le16 nows;
- __u8 rsvd74[18];
+ __le16 mssrl;
+ __le32 mcl;
+ __u8 msrc;
+ __u8 rsvd81[11];
  __le32 anagrpid;
  __u8 rsvd96[3];
  __u8 nsattr;
@@ -376,8 +379,7 @@ struct nvme_id_ns {
  __le16 endgid;
  __u8 nguid[16];
  __u8 eui64[8];
- struct nvme_lbaf lbaf[16];
- __u8 rsvd192[192];
+ struct nvme_lbaf lbaf[64];
  __u8 vs[3712];
 };

@@ -394,9 +396,14 @@ struct nvme_id_ns_zns {
  __le32 mor;
  __le32 rrl;
  __le32 frl;
- __u8 rsvd20[2796];
- struct nvme_zns_lbafe lbafe[16];
- __u8 rsvd3072[768];
+ __le32 rrl1;
+ __le32 rrl2;
+ __le32 rrl3;
+ __le32 frl1;
+ __le32 frl2;
+ __le32 frl3;
+ __u8 rsvd44[2772];
+ struct nvme_zns_lbafe lbafe[64];
  __u8 vs[256];
 };

--
2.25.1



More information about the Linux-nvme mailing list