Skip to content

nvme/023: use character device for nvme smart-log command#173

Closed
yizhanglinux wants to merge 1 commit intolinux-blktests:masterfrom
yizhanglinux:nvme-023-fix
Closed

nvme/023: use character device for nvme smart-log command#173
yizhanglinux wants to merge 1 commit intolinux-blktests:masterfrom
yizhanglinux:nvme-023-fix

Conversation

@yizhanglinux
Copy link
Copy Markdown
Contributor

The nvme-cli v2.12 changed to use the character device for nvme smart-log command, update nvme/023 to use char device to avoid the case failure.

$ nvme smart-log /dev/nvme0n1
smart log: No such device or address
$ nvme smart-log /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff critical_warning : 0
temperature : -459 °F (0 K)
available_spare : 0%
available_spare_threshold : 0%
percentage_used : 0%
endurance group critical warning summary: 0
Data Units Read : 20 (10.24 MB)
Data Units Written : 0 (0.00 B)
host_read_commands : 142
host_write_commands : 0
controller_busy_time : 0
power_cycles : 0
power_on_hours : 0
unsafe_shutdowns : 0
media_errors : 0
num_err_log_entries : 0
Warning Temperature Time : 0
Critical Composite Temperature Time : 0
Thermal Management T1 Trans Count : 0
Thermal Management T2 Trans Count : 0
Thermal Management T1 Total Time : 0
Thermal Management T2 Total Time : 0

Link: #172

The nvme-cli v2.12 changed to use the character device for
nvme smart-log command, update nvme/023 to use char device
to avoid the case failure.

$ nvme smart-log /dev/nvme0n1
smart log: No such device or address
$ nvme smart-log /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning			: 0
temperature				: -459 °F (0 K)
available_spare				: 0%
available_spare_threshold		: 0%
percentage_used				: 0%
endurance group critical warning summary: 0
Data Units Read				: 20 (10.24 MB)
Data Units Written			: 0 (0.00 B)
host_read_commands			: 142
host_write_commands			: 0
controller_busy_time			: 0
power_cycles				: 0
power_on_hours				: 0
unsafe_shutdowns			: 0
media_errors				: 0
num_err_log_entries			: 0
Warning Temperature Time		: 0
Critical Composite Temperature Time	: 0
Thermal Management T1 Trans Count	: 0
Thermal Management T2 Trans Count	: 0
Thermal Management T1 Total Time	: 0
Thermal Management T2 Total Time	: 0

Link: linux-blktests#172
Signed-off-by: Yi Zhang <[email protected]>
@igaw
Copy link
Copy Markdown
Contributor

igaw commented May 27, 2025

LGTM. Thanks!

@kawasaki
Copy link
Copy Markdown
Collaborator

Ah, I wasn't aware of this PR and the related issue #172. And did the investigation in parallel...
As I reported to linux-nvme, there are two unclear points:

  1. The man page of "nvme smart-log" command advertises it works for namespace block devices.
  2. When libnvme is built without liburing, "nvme smart-log" command works for the namespace block devices.

Based on these, I'm still not sure if really nvme-cli drops the namespace block device support for the "nvme smart-log" command.

@yizhanglinux
Copy link
Copy Markdown
Contributor Author

Thanks for the investigation. Let's hold the change until we have the final conclusion for "nvme smart-log."

@igaw
Copy link
Copy Markdown
Contributor

igaw commented May 28, 2025

We have a couple of places we are discussing things. I'll keep linux-nvme/nvme-cli#2829 updated what's going on in libnvme/nvme-cli resp. the mailing list.

@igaw
Copy link
Copy Markdown
Contributor

igaw commented May 28, 2025

I've applied the fix for libnvme.

The io_uring usage is borderline useful IMO. Maybe we should document that it is not necessary to be enabled for distro packages.

@yizhanglinux
Copy link
Copy Markdown
Contributor Author

Close it now.

@yizhanglinux yizhanglinux deleted the nvme-023-fix branch May 30, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants