Add NVMe Get Features / Set Features support to camcontrol(8):
camcontrol nvfeature ndaX -a <get|set> -f feature [-d data]
[-s num] [-U]Currently, only the hostid feature is fully implemented. The
hostid value for set is specified with -d as a UUID or an integer
in decimal, hex, or octal, and -U outputs the hostid as a UUID on
get.
The -s argument exposes the feature select / save fields from the
NVMe specification. If bit 4 of the Optional NVM Command Support
(ONCS) field of the Identify Controller data is set, each feature
has a default, saved and current value, plus a capabilities mask:
- For get, -s selects which to display: 0 (current), 1 (default), 2 (saved) or 3 (capabilities).
- For set, -s is the save flag; a value of 1 sets the saved value as well as the current value, so the feature persists across an NVMe reset. Setting the save flag only works if the feature's capability mask includes saveable.
sbin/camcontrol/nvfeature.c:
New file, the camcontrol(8) nvfeature subcommand for getting and setting NVMe features.
sbin/camcontrol/camcontrol.c:
Add the nvfeature subcommand.
sbin/camcontrol/camcontrol.h:
Add the nvmefeature() prototype.
sbin/camcontrol/Makefile:
Add nvfeature.c to the build.
sbin/camcontrol/camcontrol.8:
Document the nvfeature subcommand.
Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Sponsored by: Spectra Logic
Depends on D59535
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>