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)
Wed, Jul 8, 4:11 AM
Unknown Object (File)
Tue, Jul 7, 1:37 PM
Unknown Object (File)
Mon, Jul 6, 3:15 PM
Unknown Object (File)
Fri, Jun 26, 12:59 PM
Unknown Object (File)
Thu, Jun 25, 10:47 PM
Unknown Object (File)
Jun 3 2026, 4:07 AM
Unknown Object (File)
May 3 2026, 10:33 PM
Unknown Object (File)
May 3 2026, 10:41 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