@@ -3041,22 +3041,40 @@ static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
3041
3041
3042
3042
static void stdout_nvm_id_ns_pic (__u8 pic )
3043
3043
{
3044
- __u8 rsvd = (pic & 0xF8 ) >> 3 ;
3045
- __u8 stcrs = (pic & 0x3 ) >> 2 ;
3044
+ __u8 rsvd = (pic & 0xF0 ) >> 4 ;
3045
+ __u8 qpifs = (pic & 0x8 ) >> 3 ;
3046
+ __u8 stcrs = (pic & 0x4 ) >> 2 ;
3046
3047
__u8 pic_16bpistm = (pic & 0x2 ) >> 1 ;
3047
3048
__u8 pic_16bpists = pic & 0x1 ;
3048
3049
3049
3050
if (rsvd )
3050
- printf (" [7:3] : %#x\tReserved\n" , rsvd );
3051
- printf (" [2:2] : %#x\tStorage Tag Check Read Support\n" , stcrs );
3051
+ printf (" [7:4] : %#x\tReserved\n" , rsvd );
3052
+ printf (" [3:3] : %#x\tQualified Protection Information Format %sSupported\n" ,
3053
+ qpifs , qpifs ? "" : "Not " );
3054
+ printf (" [2:2] : %#x\tStorage Tag Check Read %sSupported\n" ,
3055
+ stcrs , stcrs ? "" : "Not " );
3052
3056
printf (" [1:1] : %#x\t16b Guard Protection Information Storage Tag Mask\n" ,
3053
3057
pic_16bpistm );
3054
- printf (" [0:0] : %#x\t16b Guard Protection Information Storage Tag Support\n" ,
3055
- pic_16bpists );
3058
+ printf (" [0:0] : %#x\t16b Guard Protection Information Storage Tag %sSupported\n" ,
3059
+ pic_16bpists , pic_16bpists ? "" : "Not " );
3060
+ printf ("\n" );
3061
+ }
3062
+
3063
+ static void stdout_nvm_id_ns_pifa (__u8 pifa )
3064
+ {
3065
+ __u8 rsvd = (pifa & 0xF8 ) >> 3 ;
3066
+ __u8 stmla = pifa & 0x7 ;
3067
+
3068
+ if (rsvd )
3069
+ printf (" [7:3] : %#x\tReserved\n" , rsvd );
3070
+ printf (" [2:0] : %#x\tStorage Tag Masking Level Attribute : %s\n" , stmla ,
3071
+ stmla == 0 ? "Bit Granularity Masking" :
3072
+ stmla == 1 ? "Byte Granularity Masking" :
3073
+ stmla == 2 ? "Masking Not Supported" : "Reserved" );
3056
3074
printf ("\n" );
3057
3075
}
3058
3076
3059
- static char * pif_to_string (__u8 pif )
3077
+ static char * pif_to_string (__u8 pif , bool qpifs , bool pif_field )
3060
3078
{
3061
3079
switch (pif ) {
3062
3080
case NVME_NVM_PIF_16B_GUARD :
@@ -3065,6 +3083,9 @@ static char *pif_to_string(__u8 pif)
3065
3083
return "32b Guard" ;
3066
3084
case NVME_NVM_PIF_64B_GUARD :
3067
3085
return "64b Guard" ;
3086
+ case NVME_NVM_PIF_QTYPE :
3087
+ if (pif_field && qpifs )
3088
+ return "Qualified Type" ;
3068
3089
default :
3069
3090
return "Reserved" ;
3070
3091
}
@@ -3075,9 +3096,10 @@ static void stdout_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int nsid,
3075
3096
bool cap_only )
3076
3097
{
3077
3098
int i , verbose = stdout_print_ops .flags & VERBOSE ;
3099
+ bool qpifs = (nvm_ns -> pic & 0x8 ) >> 3 ;
3078
3100
__u32 elbaf ;
3079
3101
__u8 lbaf ;
3080
- int pif , sts ;
3102
+ int pif , sts , qpif ;
3081
3103
char * in_use = "(in use)" ;
3082
3104
3083
3105
nvme_id_ns_flbas_to_lbaf_inuse (ns -> flbas , & lbaf );
@@ -3092,18 +3114,23 @@ static void stdout_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int nsid,
3092
3114
printf ("pic : %#x\n" , nvm_ns -> pic );
3093
3115
if (verbose )
3094
3116
stdout_nvm_id_ns_pic (nvm_ns -> pic );
3117
+ printf ("pifa : %#x\n" , nvm_ns -> pifa );
3118
+ if (verbose )
3119
+ stdout_nvm_id_ns_pifa (nvm_ns -> pifa );
3095
3120
3096
3121
for (i = 0 ; i <= ns -> nlbaf + ns -> nulbaf ; i ++ ) {
3097
3122
elbaf = le32_to_cpu (nvm_ns -> elbaf [i ]);
3123
+ qpif = (elbaf >> 9 ) & 0xF ;
3098
3124
pif = (elbaf >> 7 ) & 0x3 ;
3099
3125
sts = elbaf & 0x7f ;
3100
3126
if (verbose )
3101
- printf ("Extended LBA Format %2d : Protection Information Format: "
3102
- "%s(%d) - Storage Tag Size (MSB): %-2d %s\n" ,
3103
- i , pif_to_string (pif ), pif , sts , i == lbaf ? in_use : "" );
3127
+ printf ("Extended LBA Format %2d : Qualified Protection Information Format: "
3128
+ "%s(%d) - Protection Information Format: %s(%d) - Storage Tag Size "
3129
+ "(MSB): %-2d %s\n" , i , pif_to_string (qpif , qpifs , false), qpif ,
3130
+ pif_to_string (pif , qpifs , true), pif , sts , i == lbaf ? in_use : "" );
3104
3131
else
3105
- printf ("elbaf %2d : pif:%d sts:%-2d %s\n" , i ,
3106
- pif , sts , i == lbaf ? in_use : "" );
3132
+ printf ("elbaf %2d : qpif:%d pif:%d sts:%-2d %s\n" , i ,
3133
+ qpif , pif , sts , i == lbaf ? in_use : "" );
3107
3134
}
3108
3135
}
3109
3136
0 commit comments