Skip to contentSkip to conversation

nvme-cli: add new HMB identify fields of TP 4002

PATCH New Minwoo Im 2 participants 5 messages Nov 28, 2017 NVMe

lore
Share & tools
lore

Minwoo Im

author
#0 lore raw

PATCH 1/1 nvme-cli: add new HMB identify fields of TP 4002

Add new HMB identify fields (hmminds, hmmaxd) to struct nvme_id_ctrl. Those fields were added in TP 4002 which is "HMB Enhancements".

Signed-off-by Minwoo Im <minwoo.im.dev at gmail.com>
---
 linux/nvme.h | 4 +++-
 nvme-print.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
linux/nvme.h +3 -1
index 2d5be8f..2f30616 100644
@@ -217,7 +217,9 @@ struct nvme_id_ctrl {
 	__le16			mntmt;
 	__le16			mxtmt;
 	__le32			sanicap;
-	__u8			rsvd332[180];
+	__le32			hmminds;
+	__le16			hmmaxd;
+	__u8			rsvd332[174];
 	__u8			sqes;
 	__u8			cqes;
 	__le16			maxcmd;
nvme-print.c +2 -0
index db11dd7..1808405 100644
@@ -860,6 +860,8 @@ void __show_nvme_id_ctrl(struct nvme_id_ctrl *ctrl, unsigned int mode, void (*ve
 	printf("sanicap : %#x\n", le32_to_cpu(ctrl->sanicap));
 	if (human)
 		show_nvme_id_ctrl_sanicap(ctrl->sanicap);
+	printf("hmminds : %d\n", le32_to_cpu(ctrl->hmminds));
+	printf("hmmaxd  : %d\n", le16_to_cpu(ctrl->hmmaxd));
 	printf("sqes    : %#x\n", ctrl->sqes);
 	if (human)
 		show_nvme_id_ctrl_sqes(ctrl->sqes);
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 nvme-cli: add new HMB identify fields of TP 4002

Thanks, this looks good:

Reviewed-by Christoph Hellwig <hch at lst.de>
author
#2 lore raw

PATCH 1/1 nvme-cli: add new HMB identify fields of TP 4002

Hi all,

I'm sorry for making confusions because of the numbering of reserved field. It should be started with 338 instead of 332.

The following patch will be good to be reviewed.

Thanks,

Add new HMB identify fields (hmminds, hmmaxd) to struct nvme_id_ctrl. Those fields were added in TP 4002 which is "HMB Enhancements".

Signed-off-by Minwoo Im <minwoo.im.dev at gmail.com>
---
 linux/nvme.h | 4 +++-
 nvme-print.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
linux/nvme.h +3 -1
index 2d5be8f..48497a3 100644
@@ -217,7 +217,9 @@ struct nvme_id_ctrl {
        __le16                  mntmt;
        __le16                  mxtmt;
        __le32                  sanicap;
-       __u8                    rsvd332[180];
+       __le32                  hmminds;
+       __le16                  hmmaxd;
+       __u8                    rsvd338[174];
        __u8                    sqes;
        __u8                    cqes;
        __le16                  maxcmd;
nvme-print.c +0 -0
index db11dd7..1808405 100644
@@ -860,6 +860,8 @@ void __show_nvme_id_ctrl(struct nvme_id_ctrl

*ctrl, unsigned int mode, void (*ve

        printf("sanicap : %#x\n", le32_to_cpu(ctrl->sanicap));
        if (human)
                show_nvme_id_ctrl_sanicap(ctrl->sanicap);
+       printf("hmminds : %d\n", le32_to_cpu(ctrl->hmminds));
+       printf("hmmaxd  : %d\n", le16_to_cpu(ctrl->hmmaxd));
        printf("sqes    : %#x\n", ctrl->sqes);
        if (human)
                show_nvme_id_ctrl_sqes(ctrl->sqes);
Signature · 1 line
2.7.4
#3 lore raw

PATCH 1/1 nvme-cli: add new HMB identify fields of TP 4002

Quoted 4 lines · Minwoo Im

I'm sorry for making confusions because of the numbering of reserved field. It should be started with 338 instead of 332.

The following patch will be good to be reviewed.

To make things easier it might be a good idea to start by copying over nvme.h from the kernel as a first commit.

author
#4 lore raw

PATCH 1/1 nvme-cli: add new HMB identify fields of TP 4002

Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Minwoo Im

I'm sorry for making confusions because of the numbering of reserved field. It should be started with 338 instead of 332.

The following patch will be good to be reviewed.

To make things easier it might be a good idea to start by copying over nvme.h from the kernel as a first commit.

Hi Christoph,

I really appreciate your suggestion for a good idea of nvme.h. I'm going to send a patch for a sync of nvme.h with kernel's to be reviewed. After that, I'll send this kind of patch of "HMB identify fields" again.

If I've got anything wrong or misunderstood from your review, please feel free to let me know.

Thanks,