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)
Mon, Jan 5, 6:17 PM
Unknown Object (File)
Tue, Dec 23, 7:22 PM
Unknown Object (File)
Dec 12 2025, 4:22 AM
Unknown Object (File)
Dec 6 2025, 4:20 AM
Unknown Object (File)
Nov 22 2025, 6:21 PM
Unknown Object (File)
Nov 3 2025, 10:07 PM
Unknown Object (File)
Nov 2 2025, 2:06 AM
Unknown Object (File)
Oct 23 2025, 12:56 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 64575
Build 61459: arc lint + arc unit

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