Page MenuHomeFreeBSD

cam nvme: Move opcode and status code tables from CTL to base CAM
ClosedPublic

Authored by jhb on May 31 2025, 9:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Aug 18 2025, 4:12 PM
Unknown Object (File)
Aug 16 2025, 6:46 PM
Unknown Object (File)
Aug 15 2025, 4:35 PM
Unknown Object (File)
Aug 14 2025, 4:22 AM
Unknown Object (File)
Aug 14 2025, 12:30 AM
Unknown Object (File)
Aug 8 2025, 4:15 PM
Unknown Object (File)
Aug 7 2025, 4:42 AM
Unknown Object (File)
Jul 28 2025, 9:44 AM
Subscribers

Details

Summary

This adds support for decoding admin opcodes to the existing opcode
decoding and also removes one of the duplicate NVMe opcode string
tables.

  • Add nvme_opcode_sbuf and nvme_cpl_sbuf which are CCB type-independent and handle the guts of the CTL-specific routines.
  • Use nvme_opcode_sbuf to decode the opcode in nvme_command_sbuf.
  • Add nvme_status_sbuf to decode the CPL/CQE in a ccb_nvmeio.

Sponsored by: Chelsio Communications

Diff Detail

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

Event Timeline

sys/cam/nvme/nvme_all.c
63

If the nvme(4) driver depends on cam.ko driver already, we could perhaps switch it to using routines from here to reduce the duplication.

272

The only consumer of this is a debugging trace that duplicates the functionality of nvme_command_sbuf(). If that caller could be fixed to use an sbuf (it already uses a fixed string on the stack for nvme_cmd_string()) then we could remove nvme_op_string and nvme_cmd_string which might be simplifying.

This is fine, but I'm leaning subr_nvme for nvme protocol things...

This revision is now accepted and ready to land.Jun 1 2025, 3:17 AM