Page MenuHomeFreeBSD

camcontrol: Add support for NVMe namespace Identify
Needs ReviewPublic

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

Details

Reviewers
None
Group Reviewers
cam
Summary

Add a -N argument to camcontrol identify. This will fetch and
display namespace Identify data for NVMe drives, using
nvme_print_namespace() from nvmecontrol(8).

This gets the namespace Identify data via XPT_DEV_ADVINFO (i.e.
data cached in the kernel) like the standard NVMe identify command
does, and so works even on NVMe devices that do not support NVMe
Namespace Management.

sbin/camcontrol/camcontrol.c:

Add a -N argument to camcontrol identify.

Rename nvme_get_cdata() to nvme_get_data(), and give it the
ability to fetch controller or namespace Identify data.
While here, improve its error reporting with
cam_error_print(), and only look at the CAM status bits of
the returned CCB.

Change identify(), ataidentify(), and nvmeidentify() to
handle the extra arguments.

Give nvmeidentify() the ability to fetch and print NVMe
namespace data, using nvme_print_namespace() from
nvmecontrol(8).

sbin/camcontrol/camcontrol.h:

Add the nvme_get_data() prototype, for use by future NVMe
subcommands living outside camcontrol.c.

sbin/camcontrol/camcontrol.8:

Document camcontrol identify -N.  Make it clear that the
NVMe data is from data cached in the kernel.  Add a cross
reference to nvmecontrol(8).

Sponsored by: Spectra Logic

Depends on D59530

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 76698
Build 73581: arc lint + arc unit

Event Timeline

ken requested review of this revision.Wed, Sep 9, 3:34 PM
sbin/camcontrol/camcontrol.8
530

Is there some reason that we don't send the command and get the results back?

537

Is this sentence needed?

sbin/camcontrol/camcontrol.c
10251

This is a confusing phrasing. "send identify to the nvme namespace" is clearer. It's a general problem elsewhere.