Page MenuHomeFreeBSD

ctl: Support NVMe requests in debug trace functions
ClosedPublic

Authored by jhb on Apr 9 2024, 11:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 11:56 AM
Unknown Object (File)
Wed, Oct 16, 9:43 PM
Unknown Object (File)
Tue, Oct 15, 2:45 PM
Unknown Object (File)
Oct 13 2024, 11:26 AM
Unknown Object (File)
Oct 13 2024, 11:26 AM
Unknown Object (File)
Oct 11 2024, 5:58 PM
Unknown Object (File)
Oct 10 2024, 3:07 PM
Unknown Object (File)
Oct 8 2024, 11:26 AM

Details

Summary

Sponsored by: Chelsio Communications

Diff Detail

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

Event Timeline

jhb requested review of this revision.Apr 9 2024, 11:04 PM

Looks like the copyright text is missing.

sys/cam/ctl/ctl_nvme_all.c
8

Where is the actual copyright text?

sys/cam/ctl/ctl_nvme_all.h
5

Where is the actual copyright text?

imp added inline comments.
sys/cam/ctl/ctl_nvme_all.c
23

There are many places that duplicate this data.

sys/cam/ctl/ctl_nvme_all.h
5

Spdx means you don't need it

This revision is now accepted and ready to land.Apr 15 2024, 3:59 PM

If you have SPDX tags and no license text, then it's incorporated by reference and isn't needed. The actual copyright notices are still needed and are present.

sys/cam/ctl/ctl_nvme_all.c
23

Yeah. I'm not sure I want a single .c file to handle all these since different places want to do different things with opcodes (and it gets all kind of weird with sys/conf/files, etc.), but one thing I've thought about is adding some table macros in nvme.h along the lines of:

/* M is a caller-supplied macro */
#define NVME_ADMIN_OPCODES(M) \
       M(DELETE_IO_SQ) \
       M(CREATE_IO_SQ) \
....

Then you would do something like:

#define OPC_ENTRY(x)    [NVME_OPC_ ## x]  = #x11 

static const char *admin_opcodes[256] = {
      NVME_ADMIN_OPCODES(OPC_ENTRY)
};
sys/cam/ctl/ctl_nvme_all.c
23

Yes indeed. I have a need for it for the dtrace based camdump that I have been working on, but not in 'C' format...
So not sure how to make it better.

chuck added inline comments.
usr.sbin/bhyve/Makefile
30

Apologies for being dense. Why does bhyve need this? This review doesn't seem to modify bhyve to use these commands.

jhb added inline comments.
usr.sbin/bhyve/Makefile
30

Because bhyve uses ctl_util.c from the kernel which needs it.

usr.sbin/bhyve/Makefile
30

Oh, that's right. I'd forgotten that CTL gets pulled into bhyve for SCSI emulation.