Page MenuHomeFreeBSD

cam: Add NVMe reservation, format and features CCB building functions
Needs ReviewPublic

Authored by ken on Wed, Sep 9, 3:34 PM.

Details

Reviewers
None
Group Reviewers
cam
Summary

Add NVMe CCB (union ccb / struct ccb_nvmeio) building functions for
the four NVMe reservation opcodes, Format NVM, and Get Features /
Set Features. These use the nvme_command building blocks added to
sys/dev/nvme/nvme.h, and are used by the new camcontrol(8) nvres,
nvformat and nvfeature subcommands that will be added separately.

sys/cam/nvme/nvme_all.c:

Add NVMe CCB building functions for the four NVMe reservation
opcodes: nvme_resv_report(), nvme_resv_register(),
nvme_resv_acquire() and nvme_resv_release().  Data direction
is set internally (CAM_DIR_IN or CAM_DIR_OUT as appropriate),
so no flags parameter is needed.

Add a new nvme_format() CCB building function.

Add nvme_get_feature() and nvme_set_feature() CCB building
functions, along with nvme_get_feature_hostid() and
nvme_set_feature_hostid() convenience wrappers for the hostid
feature.  nvme_set_feature_hostid() takes an sv argument so
the caller can request that the hostid persist across reset.

sys/cam/nvme/nvme_all.h:

Add prototypes for the above.  Wrap the declarations in
__BEGIN_DECLS / __END_DECLS so C++ compilers don't mangle the
names of the C symbols.

Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Sponsored by: Spectra Logic

Depends on D59531

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 76697
Build 73580: arc lint + arc unit

Event Timeline

ken requested review of this revision.Wed, Sep 9, 3:34 PM
sys/cam/nvme/nvme_all.c
301

Why do some calls have the comments, and some don't?

sys/cam/nvme/nvme_all.h
33

This isn't needed since nvme.h includes sys/param.h.