Page MenuHomeFreeBSD

cam nvme: Decode NVMe status for NVMe command failures
ClosedPublic

Authored by jhb on May 31 2025, 9:02 PM.
Tags
None
Referenced Files
F132500383: D50632.diff
Fri, Oct 17, 10:41 AM
Unknown Object (File)
Sat, Oct 11, 1:04 AM
Unknown Object (File)
Sat, Oct 4, 3:48 AM
Unknown Object (File)
Thu, Oct 2, 2:56 AM
Unknown Object (File)
Sep 13 2025, 12:58 AM
Unknown Object (File)
Sep 1 2025, 5:01 AM
Unknown Object (File)
Aug 24 2025, 5:49 AM
Unknown Object (File)
Aug 23 2025, 12:31 AM
Subscribers
None

Details

Summary

Similar to ATA and SCSI, log the command status (in this case the
status code from the CQE) on the console for failed NVMe commands.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I wanted this to debug a NVMeoF error I saw in testing, but the error didn't reproduce after this. However, on my test machine, the NVMe drive it uses for its main storage doesn't implement support for flush, so I get an error in dmesg on every reboot and this is the output from that with these two patches applied:

nvme0: FLUSH sqid:1 cid:127 nsid:1
nvme0: INVALID OPCODE (00/01) crd:0 m:0 dnr:0 p:1 sqid:1 cid:127 cdw0:0
(nda0:nvme0:0:0:1): FLUSH. NCB: opc=0 fuse=0 nsid=1 prp1=0 prp2=0 cdw=0 0 0 0 0 0
(nda0:nvme0:0:0:1): CAM status: NVME Status Error
(nda0:nvme0:0:0:1): NVMe status: INVALID_OPCODE
(nda0:nvme0:0:0:1): Error 5, Retries exhausted
(nda0:nvme0:0:0:1): Synchronize cache failed

I have some similar changes to do this for devd as well...

This revision is now accepted and ready to land.May 31 2025, 9:11 PM
In D50632#1155884, @imp wrote:

I have some similar changes to do this for devd as well...

Are you good with the earlier change as well (D50631)?

In D50632#1155908, @jhb wrote:
In D50632#1155884, @imp wrote:

I have some similar changes to do this for devd as well...

Are you good with the earlier change as well (D50631)?

Yea. I am. There's no conflicts or other reasons I can think to stop this.. with the proviso we'll likely refactor this and its companion un the fututre