svn commit: r333424 - head/sbin/camcontrol

Warner Losh imp at FreeBSD.org
Wed May 9 18:41:06 UTC 2018


Author: imp
Date: Wed May  9 18:41:04 2018
New Revision: 333424
URL: https://svnweb.freebsd.org/changeset/base/333424

Log:
  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

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Wed May  9 18:39:31 2018	(r333423)
+++ head/sbin/camcontrol/camcontrol.c	Wed May  9 18:41:04 2018	(r333424)
@@ -5167,7 +5167,22 @@ cts_print(struct cam_device *device, struct ccb_trans_
 				"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);
+		}
+	}
 }
 
 /*


More information about the svn-src-head mailing list