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
F151148729: D50631.id156423.diff
Mon, Apr 6, 10:30 AM
Unknown Object (File)
Sun, Apr 5, 8:33 AM
Unknown Object (File)
Feb 18 2026, 8:46 PM
Unknown Object (File)
Feb 9 2026, 6:18 AM
Unknown Object (File)
Jan 30 2026, 3:44 AM
Unknown Object (File)
Jan 17 2026, 2:01 PM
Unknown Object (File)
Jan 16 2026, 12:38 AM
Unknown Object (File)
Jan 5 2026, 6:17 PM
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