svn commit: r320425 - head/sbin/nvmecontrol

Warner Losh imp at FreeBSD.org
Tue Jun 27 20:24:45 UTC 2017


Author: imp
Date: Tue Jun 27 20:24:44 2017
New Revision: 320425
URL: https://svnweb.freebsd.org/changeset/base/320425

Log:
  Report some aspects of namespaces and namespace support in identify
  command.
  
  Sponsored by: Netflix
  Submitted by: Matt Williams (via D11330)

Modified:
  head/sbin/nvmecontrol/identify.c

Modified: head/sbin/nvmecontrol/identify.c
==============================================================================
--- head/sbin/nvmecontrol/identify.c	Tue Jun 27 20:24:39 2017	(r320424)
+++ head/sbin/nvmecontrol/identify.c	Tue Jun 27 20:24:44 2017	(r320425)
@@ -44,6 +44,7 @@ static void
 print_controller(struct nvme_controller_data *cdata)
 {
 	uint8_t str[128];
+	char cbuf[UINT128_DIG + 1];
 
 	printf("Controller Capabilities/Features\n");
 	printf("================================\n");
@@ -65,8 +66,8 @@ print_controller(struct nvme_controller_data *cdata)
 		printf("Unlimited\n");
 	else
 		printf("%d\n", PAGE_SIZE * (1 << cdata->mdts));
-	printf("\n");
 
+	printf("\n");
 	printf("Admin Command Set Attributes\n");
 	printf("============================\n");
 	printf("Security Send/Receive:       %s\n",
@@ -75,6 +76,8 @@ print_controller(struct nvme_controller_data *cdata)
 		cdata->oacs.format ? "Supported" : "Not Supported");
 	printf("Firmware Activate/Download:  %s\n",
 		cdata->oacs.firmware ? "Supported" : "Not Supported");
+	printf("Namespace Managment:         %s\n",
+		   cdata->oacs.nsmgmt ? "Supported" : "Not Supported");
 	printf("Abort Command Limit:         %d\n", cdata->acl+1);
 	printf("Async Event Request Limit:   %d\n", cdata->aerl+1);
 	printf("Number of Firmware Slots:    ");
@@ -91,8 +94,8 @@ print_controller(struct nvme_controller_data *cdata)
 		cdata->lpa.ns_smart ? "Yes" : "No");
 	printf("Error Log Page Entries:      %d\n", cdata->elpe+1);
 	printf("Number of Power States:      %d\n", cdata->npss+1);
-	printf("\n");
 
+	printf("\n");
 	printf("NVM Command Set Attributes\n");
 	printf("==========================\n");
 	printf("Submission Queue Entry Size\n");
@@ -110,6 +113,16 @@ print_controller(struct nvme_controller_data *cdata)
 		cdata->oncs.dsm ? "Supported" : "Not Supported");
 	printf("Volatile Write Cache:        %s\n",
 		cdata->vwc.present ? "Present" : "Not Present");
+
+	if (cdata->oacs.nsmgmt) {
+		printf("\n");
+		printf("Namespace Drive Attributes\n");
+		printf("==========================\n");
+		printf("NVM total cap:               %s\n",
+			   uint128_to_str(to128(cdata->untncap.tnvmcap), cbuf, sizeof(cbuf)));
+		printf("NVM unallocated cap:         %s\n",
+			   uint128_to_str(to128(cdata->untncap.unvmcap), cbuf, sizeof(cbuf)));
+	}
 }
 
 static void


More information about the svn-src-all mailing list