mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 06:12:01 +01:00
nvmecontrol: Display Metadata and Sanitize capabilities of the device
Determine if a device supports "Extended" or "Separate" metadata, and what the current metadata setting is (None, Extended, Separate) Also determine if the device supports: - Sanitize Crypto Erase - Sanitize Block Erase - Sanitize Overwrite Reviewed by: chuck Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #49 Differential Revision: https://reviews.freebsd.org/D31067
This commit is contained in:
parent
680ca73945
commit
ae5a522cae
@ -84,7 +84,17 @@ print_namespace(struct nvme_namespace_data *nsdata)
|
||||
printf("Thin Provisioning: %s\n",
|
||||
thin_prov ? "Supported" : "Not Supported");
|
||||
printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1);
|
||||
printf("Current LBA Format: LBA Format #%02d\n", flbas_fmt);
|
||||
printf("Current LBA Format: LBA Format #%02d", flbas_fmt);
|
||||
if (nsdata->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_MS_SHIFT & NVME_NS_DATA_LBAF_MS_MASK)
|
||||
printf(" %s metadata\n", nsdata->flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT &
|
||||
NVME_NS_DATA_FLBAS_EXTENDED_MASK ? "Extended" : "Separate");
|
||||
else
|
||||
printf("\n");
|
||||
printf("Metadata Capabilities\n");
|
||||
printf(" Extended: %s\n",
|
||||
nsdata->mc >> NVME_NS_DATA_MC_EXTENDED_SHIFT & NVME_NS_DATA_MC_EXTENDED_MASK ? "Supported" : "Not Supported");
|
||||
printf(" Separate: %s\n",
|
||||
nsdata->mc >> NVME_NS_DATA_MC_POINTER_SHIFT & NVME_NS_DATA_MC_POINTER_MASK ? "Supported" : "Not Supported");
|
||||
printf("Data Protection Caps: %s%s%s%s%s%s\n",
|
||||
(nsdata->dpc == 0) ? "Not Supported" : "",
|
||||
((nsdata->dpc >> NVME_NS_DATA_DPC_MD_END_SHIFT) &
|
||||
|
@ -124,6 +124,38 @@ nvme_print_controller(struct nvme_controller_data *cdata)
|
||||
printf("Unlimited\n");
|
||||
else
|
||||
printf("%ld bytes\n", PAGE_SIZE * (1L << cdata->mdts));
|
||||
printf("Sanitize Crypto Erase: %s\n",
|
||||
((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_CES_SHIFT) &
|
||||
NVME_CTRLR_DATA_SANICAP_CES_MASK) ?
|
||||
"Supported" : "Not Supported");
|
||||
printf("Sanitize Block Erase: %s\n",
|
||||
((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_BES_SHIFT) &
|
||||
NVME_CTRLR_DATA_SANICAP_BES_MASK) ?
|
||||
"Supported" : "Not Supported");
|
||||
printf("Sanitize Overwrite: %s\n",
|
||||
((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_OWS_SHIFT) &
|
||||
NVME_CTRLR_DATA_SANICAP_OWS_MASK) ?
|
||||
"Supported" : "Not Supported");
|
||||
printf("Sanitize NDI: %s\n",
|
||||
((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_NDI_SHIFT) &
|
||||
NVME_CTRLR_DATA_SANICAP_NDI_MASK) ?
|
||||
"Supported" : "Not Supported");
|
||||
printf("Sanitize NODMMAS: ");
|
||||
switch (((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_NODMMAS_SHIFT) &
|
||||
NVME_CTRLR_DATA_SANICAP_NODMMAS_MASK)) {
|
||||
case NVME_CTRLR_DATA_SANICAP_NODMMAS_UNDEF:
|
||||
printf("Undefined\n");
|
||||
break;
|
||||
case NVME_CTRLR_DATA_SANICAP_NODMMAS_NO:
|
||||
printf("No\n");
|
||||
break;
|
||||
case NVME_CTRLR_DATA_SANICAP_NODMMAS_YES:
|
||||
printf("Yes\n");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown\n");
|
||||
break;
|
||||
}
|
||||
printf("Controller ID: 0x%04x\n", cdata->ctrlr_id);
|
||||
printf("Version: %d.%d.%d\n",
|
||||
(cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff,
|
||||
|
Loading…
Reference in New Issue
Block a user