Page MenuHomeFreeBSD

camcontrol: Add support for NVMe namespace Identify
Needs ReviewPublic

Authored by ken on Wed, Sep 9, 3:34 PM.
Tags
None
Referenced Files
F173991130: D59533.id187349.diff
Tue, Sep 29, 7:55 PM
F173976811: D59533.id187349.diff
Tue, Sep 29, 6:12 PM
F173976714: D59533.id186276.diff
Tue, Sep 29, 6:12 PM
F173961236: D59533.diff
Tue, Sep 29, 4:09 PM
Unknown Object (File)
Tue, Sep 29, 9:03 AM
Unknown Object (File)
Mon, Sep 28, 3:03 PM
Unknown Object (File)
Mon, Sep 28, 3:01 PM
Unknown Object (File)
Mon, Sep 28, 2:02 AM
Subscribers

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 77142
Build 74025: 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.

sbin/camcontrol/camcontrol.8
530

For the controller identify, you added the original code that uses XPT_DEV_ADVINFO/CDAI_TYPE_NVME_CNTRL in D15371.

So it made sense to do the namespace identify the same way.

We can certainly add the ability to send the command down / make it switchable.

537

Probably not.

sbin/camcontrol/camcontrol.c
10251

Yes, I agree.

ken edited the summary of this revision. (Show Details)

Address review feedback: drop the Namespace Management sentence from the man page, and reword the -N usage text to: send identify to the NVMe namespace.

ken marked 2 inline comments as done.Mon, Sep 21, 6:20 PM