]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
sfx: fixed byte aligned issue; add additional smart log items
authorWei Hou <wei.hou@scaleflux.com>
Tue, 19 Apr 2022 07:40:47 +0000 (15:40 +0800)
committerDaniel Wagner <dwagner@suse.de>
Fri, 13 May 2022 14:12:37 +0000 (16:12 +0200)
plugins/scaleflux/sfx-nvme.c

index 1d7533c9006a950585f109d3fbc541bb774f912a..d20e2ceb98c037c219f7fdc2291a624460756a45 100644 (file)
@@ -66,25 +66,26 @@ struct nvme_capacity_info {
        __u64 used_space;
        __u64 free_space;
 };
-struct __attribute__((packed)) nvme_additional_smart_log_item {
-       uint8_t                    key;
-       uint8_t                    _kp[2];
-       uint8_t                    norm;
-       uint8_t                    _np;
-       union {
-               uint8_t            raw[6];
-               struct wear_level {
-                       uint16_t        min;
-                       uint16_t        max;
-                       uint16_t        avg;
-               } wear_level ;
-               struct thermal_throttle {
-                       uint8_t    pct;
-                       uint32_t        count;
+
+struct  __attribute__((packed)) nvme_additional_smart_log_item {
+       __u8                    key;
+       __u8                    _kp[2];
+       __u8                    norm;
+       __u8                    _np;
+       union __attribute__((packed)) {
+               __u8            raw[6];
+               struct __attribute__((packed))  wear_level {
+                       __le16  min;
+                       __le16  max;
+                       __le16  avg;
+               } wear_level;
+               struct __attribute__((packed)) thermal_throttle {
+                       __u8    pct;
+                       __u32   count;
                } thermal_throttle;
-       };
-       uint8_t                    _rp;
-};
+       } ;
+       __u8                    _rp;
+} ;
 
 struct nvme_additional_smart_log {
        struct nvme_additional_smart_log_item    program_fail_cnt;
@@ -105,6 +106,11 @@ struct nvme_additional_smart_log {
        struct nvme_additional_smart_log_item    erase_timeout_cnt;
        struct nvme_additional_smart_log_item    read_timeout_cnt;
        struct nvme_additional_smart_log_item    read_ecc_cnt;//retry cnt
+       struct nvme_additional_smart_log_item    non_media_crc_err_cnt;
+       struct nvme_additional_smart_log_item    compression_path_err_cnt;
+       struct nvme_additional_smart_log_item    out_of_space_flag;
+       struct nvme_additional_smart_log_item    physical_usage_ratio;
+       struct nvme_additional_smart_log_item    grown_bb; //grown bad block
 };
 
 int nvme_change_cap(int fd, __u32 nsid, __u64 capacity)