-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvme show-regs is giving invalid argument error #2092
Comments
Confirmed the nvme-cli implementation below so looks the mmap is failed but the get-property seems also not supported on the drive device used then the error caused. static void *mmap_registers(nvme_root_t r, struct nvme_dev *dev)
{
...
membase = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, fd, 0);
if (membase == MAP_FAILED) {
if (map_log_level(0, false) >= LOG_DEBUG) {
fprintf(stderr, "%s failed to map. ", dev->name);
fprintf(stderr, "Did your kernel enable CONFIG_IO_STRICT_DEVMEM?\n");
}
membase = NULL;
...
return membase;
...
static int show_registers(int argc, char **argv, struct command *cmd, struct plugin *plugin)
{
...
bar = mmap_registers(r, dev);
if (!bar) {
err = nvme_get_properties(dev_fd(dev), &bar);
if (err)
goto free_tree;
fabrics = true;
} About the mmap failure it is mentioned by the issue comment #1941 (comment) and the issue #1846 so please refer them also. Since seems if you can disable the kernel config CONFIG_IO_STRICT_DEVMEM the error behavior can be resolved. (Sorry I am not sure about the change impact for your environment if you can change the kernel config.) tokunori@tokunori-desktop:~/nvme-cli$ sudo .build/nvme get-property /dev/nvme1 --offset=0
NVMe status: Invalid Command Opcode: A reserved coded value or an unsupported value in the command opcode field(0x2001) |
This is a know problem with certain devices and we are working on this. The issue is that the device is reporting an error for an valid command which the firmware is not handling. Instead just ignoring it (this would be the right thing to do) it logs it as error.
This is also a known configuration issue. When the Linux kernel is configured with
The error message is not really good here. As @ikegami-t pointed out the kernel doesn't allow us to map the |
|
No more problems using: nvme version 2.7.1 (git 2.7.1)
libnvme version 1.7 (git 1.7) |
Thanks for testing. There is still a minor issue that |
TL;DR;
I'm getting an error with
show-regs
:Full story:
I'm getting regular emails from the smart daemon about my NVMe disk.
I've been trying to figure this out for months but I've not had any luck. Here are the various commands I have tried and their output.
smartctl -a /dev/nvme0
nvme error-log /dev/nvme0
nvme.log
nvme list
The text was updated successfully, but these errors were encountered: