Skip to content

Commit

Permalink
print-stdout: print Host Behavior Support correctly
Browse files Browse the repository at this point in the history
In nvme-cli 1.16, printing the Host Behavior Support feature
logged the values of the 3 fields ACRE, ETDAS, and LBAFEE.
This appears to have regressed in nvme-cli 2.0,
and now only the value of ACRE is printed, without any description.
Log all 3 fields with proper descriptions.
Drop "Host Behavior Support" from their names,
as it's redundant with the feature name.

Signed-off-by: Caleb Sander <[email protected]>
  • Loading branch information
calebsander committed Oct 25, 2023
1 parent d812d09 commit 38958be
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -3282,7 +3282,7 @@ static void stdout_zns_changed(struct nvme_zns_changed_zone_log *log)
static void stdout_zns_report_zone_attributes(__u8 za, __u8 zai)
{
const char *const recommended_limit[4] = {"","1","2","3"};
printf("Attrs: Zone Descriptor Extension is %sVaild\n",
printf("Attrs: Zone Descriptor Extension is %sVaild\n",
(za & NVME_ZNS_ZA_ZDEV)? "" : "Not ");
if(za & NVME_ZNS_ZA_RZR) {
printf(" Reset Zone Recommended with Reset Recommended Limit%s\n",
Expand Down Expand Up @@ -4474,8 +4474,16 @@ static void stdout_feature_show_fields(enum nvme_features_id fid,
stdout_lba_status_info(result);
break;
case NVME_FEAT_FID_HOST_BEHAVIOR:
if (buf)
printf("\tHost Behavior Support: %s\n", (buf[0] & 0x1) ? "True" : "False");
if (buf) {
struct nvme_feat_host_behavior *host_behavior =
(struct nvme_feat_host_behavior *)buf;
printf("\tAdvanced Command Retry Enable (ACRE): %s\n",
host_behavior->acre ? "True" : "False");
printf("\tExtended Telemetry Data Area 4 Supported (ETDAS): %s\n",
host_behavior->etdas ? "True" : "False");
printf("\tLBA Format Extension Enable (LBAFEE): %s\n",
host_behavior->lbafee ? "True" : "False");
}
break;
case NVME_FEAT_FID_SANITIZE:
printf("\tNo-Deallocate Response Mode (NODRM) : %u\n", result & 0x1);
Expand Down

0 comments on commit 38958be

Please sign in to comment.