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)
Sun, May 3, 10:33 PM
Unknown Object (File)
Sun, May 3, 10:41 AM
Unknown Object (File)
Sun, May 3, 1:46 AM
Unknown Object (File)
Wed, Apr 29, 10:26 AM
Unknown Object (File)
Tue, Apr 28, 5:00 AM
Unknown Object (File)
Tue, Apr 28, 12:36 AM
Unknown Object (File)
Apr 6 2026, 10:30 AM
Unknown Object (File)
Apr 5 2026, 8:33 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