1
0
Fork 0

Merging upstream version 2.14.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-22 13:00:36 +02:00
parent 0d9181726f
commit f268303a51
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
572 changed files with 4636 additions and 1730 deletions

View file

@ -19,7 +19,7 @@
#define nvme_print(name, flags, ...) \
do { \
struct print_ops *ops = nvme_print_ops(flags); \
if (ops && ops->name) \
if (ops && ops->name && !nvme_cfg.dry_run) \
ops->name(__VA_ARGS__); \
} while (false)
@ -1096,6 +1096,96 @@ const char *nvme_feature_temp_sel_to_string(__u8 sel)
}
}
const char *nvme_feature_perfc_attri_to_string(__u8 attri)
{
switch (attri) {
case NVME_FEAT_PERFC_ATTRI_STD:
return "standard performance attribute";
case NVME_FEAT_PERFC_ATTRI_ID_LIST:
return "performance attribute identifier list";
case NVME_FEAT_PERFC_ATTRI_VS_MIN ... NVME_FEAT_PERFC_ATTRI_VS_MAX:
return "vendor specific performance attribute";
default:
break;
}
return "reserved";
}
const char *nvme_feature_perfc_r4karl_to_string(__u8 r4karl)
{
switch (r4karl) {
case NVME_FEAT_PERFC_R4KARL_NO_REPORT:
return "not reported";
case NVME_FEAT_PERFC_R4KARL_GE_100_SEC:
return "greater than or equal to 100 seconds";
case NVME_FEAT_PERFC_R4KARL_GE_50_SEC:
return "greater than or equal to 50 seconds and less than 100 seconds";
case NVME_FEAT_PERFC_R4KARL_GE_10_SEC:
return "greater than or equal to 10 seconds and less than 50 seconds";
case NVME_FEAT_PERFC_R4KARL_GE_5_SEC:
return "greater than or equal to 5 seconds and less than 10 seconds";
case NVME_FEAT_PERFC_R4KARL_GE_1_SEC:
return "greater than or equal to 1 second and less than 5 seconds";
case NVME_FEAT_PERFC_R4KARL_GE_500_MS:
return "greater than or equal to 500 milliseconds and less than 1 second";
case NVME_FEAT_PERFC_R4KARL_GE_100_MS:
return "greater than or equal to 100 milliseconds and less than 500 milliseconds";
case NVME_FEAT_PERFC_R4KARL_GE_50_MS:
return "greater than or equal to 50 milliseconds and less than 100 milliseconds";
case NVME_FEAT_PERFC_R4KARL_GE_10_MS:
return "greater than or equal to 10 milliseconds and less than 50 milliseconds";
case NVME_FEAT_PERFC_R4KARL_GE_5_MS:
return "greater than or equal to 5 milliseconds and less than 10 milliseconds";
case NVME_FEAT_PERFC_R4KARL_GE_1_MS:
return "greater than or equal to 1 millisecond and less than 5 milliseconds";
case NVME_FEAT_PERFC_R4KARL_GE_500_US:
return "greater than or equal to 500 microseconds and less than 1 millisecond";
case NVME_FEAT_PERFC_R4KARL_GE_100_US:
return "greater than or equal to 100 microseconds and less than 500 microseconds";
case NVME_FEAT_PERFC_R4KARL_GE_50_US:
return "greater than or equal to 50 microseconds and less than 100 microseconds";
case NVME_FEAT_PERFC_R4KARL_GE_10_US:
return "greater than or equal to 10 microseconds and less than 50 microseconds";
case NVME_FEAT_PERFC_R4KARL_GE_5_US:
return "greater than or equal to 5 microseconds and less than 10 microseconds";
case NVME_FEAT_PERFC_R4KARL_GE_1_US:
return "greater than or equal to 1 microsecond and less than 5 microseconds";
case NVME_FEAT_PERFC_R4KARL_GE_500_NS:
return "greater than or equal to 500 nanoseconds and less than 1 microsecond";
case NVME_FEAT_PERFC_R4KARL_GE_100_NS:
return "greater than or equal to 100 nanoseconds and less than 500 nanoseconds";
case NVME_FEAT_PERFC_R4KARL_GE_50_NS:
return "greater than or equal to 50 nanoseconds and less than 100 nanoseconds";
case NVME_FEAT_PERFC_R4KARL_GE_10_NS:
return "greater than or equal to 10 nanoseconds and less than 50 nanoseconds";
case NVME_FEAT_PERFC_R4KARL_GE_5_NS:
return "greater than or equal to 5 nanoseconds and less than 10 nanoseconds";
case NVME_FEAT_PERFC_R4KARL_GE_1_NS:
return "greater than or equal to 1 nanosecond and less than 5 nanoseconds";
default:
break;
}
return "reserved";
}
const char *nvme_feature_perfc_attrtyp_to_string(__u8 attrtyp)
{
switch (attrtyp) {
case NVME_GET_FEATURES_SEL_CURRENT:
return "current attribute";
case NVME_GET_FEATURES_SEL_DEFAULT:
return "default attribute";
case NVME_GET_FEATURES_SEL_SAVED:
return "saved attribute";
default:
break;
}
return "reserved";
}
const char *nvme_ns_wp_cfg_to_string(enum nvme_ns_write_protect_cfg state)
{
switch (state) {
@ -1112,6 +1202,24 @@ const char *nvme_ns_wp_cfg_to_string(enum nvme_ns_write_protect_cfg state)
}
}
const char *nvme_bpwps_to_string(__u8 bpwps)
{
switch (bpwps) {
case NVME_FEAT_BPWPS_CHANGE_NOT_REQUESTED:
return "Change in state not requested";
case NVME_FEAT_BPWPS_WRITE_UNLOCKED:
return "Write Unlocked";
case NVME_FEAT_BPWPS_WRITE_LOCKED:
return "Write Locked";
case NVME_FEAT_BPWPS_WRITE_LOCKED_PWR_CYCLE:
return "Write Locked Until Power Cycle";
case NVME_FEAT_BPWPS_WRITE_PROTECTION_RPMB:
return "Write Protection controlled by RPMB";
default:
return "Reserved";
}
}
void nvme_directive_show(__u8 type, __u8 oper, __u16 spec, __u32 nsid, __u32 result,
void *buf, __u32 len, nvme_print_flags_t flags)
{
@ -1478,6 +1586,22 @@ void nvme_show_perror(const char *msg, ...)
va_end(ap);
}
void nvme_show_key_value(const char *key, const char *val, ...)
{
struct print_ops *ops = nvme_print_ops(NORMAL);
va_list ap;
va_start(ap, val);
if (nvme_is_output_format_json())
ops = nvme_print_ops(JSON);
if (ops && ops->show_key_value)
ops->show_key_value(key, val, ap);
va_end(ap);
}
void nvme_show_discovery_log(struct nvmf_discovery_log *log, uint64_t numrec,
nvme_print_flags_t flags)
{