From 0272270a8d6fe4e6edb92de3e1711442e5d15766 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 9 May 2018 18:41:04 +0000 Subject: [PATCH] nda protocol rate reporting Report the NVMe spec, number of lanes (and max) as well as the PCIe generation we're negotiated at (and max) for the camcontrol rate command. Reviewed by: scottl (the output, not the code) Sponsored by: Netflix --- sbin/camcontrol/camcontrol.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 47be6e29401..1192d01cfee 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -5167,7 +5167,22 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) "enabled" : "disabled"); } } + if (cts->protocol == PROTO_NVME) { + struct ccb_trans_settings_nvme *nvmex = + &cts->xport_specific.nvme; + if (nvmex->valid & CTS_NVME_VALID_SPEC) { + fprintf(stdout, "%sNVMe Spec: %d.%d\n", pathstr, + NVME_MAJOR(nvmex->spec), + NVME_MINOR(nvmex->spec)); + } + if (nvmex->valid & CTS_NVME_VALID_LINK) { + fprintf(stdout, "%sPCIe lanes: %d (%d max)\n", pathstr, + nvmex->lanes, nvmex->max_lanes); + fprintf(stdout, "%sPCIe Generation: %d (%d max)\n", pathstr, + nvmex->speed, nvmex->max_speed); + } + } } /*