nvme/identify: dump namespace NGUID and EUI-64
Change-Id: I82f126e84ef8daf3c14829482b5c3f5090bcbe12 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/399532 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
1023ca7b46
commit
76f54a29d2
@ -127,6 +127,19 @@ hex_dump(const void *data, size_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
all_zero(const void *data, size_t size)
|
||||||
|
{
|
||||||
|
const uint8_t *buf = data;
|
||||||
|
|
||||||
|
while (size--) {
|
||||||
|
if (*buf++ != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_feature_completion(void *cb_arg, const struct spdk_nvme_cpl *cpl)
|
get_feature_completion(void *cb_arg, const struct spdk_nvme_cpl *cpl)
|
||||||
{
|
{
|
||||||
@ -403,6 +416,16 @@ get_log_pages(struct spdk_nvme_ctrlr *ctrlr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_hex_be(const void *v, size_t size)
|
||||||
|
{
|
||||||
|
const uint8_t *buf = v;
|
||||||
|
|
||||||
|
while (size--) {
|
||||||
|
printf("%02X", *buf++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_uint128_hex(uint64_t *v)
|
print_uint128_hex(uint64_t *v)
|
||||||
{
|
{
|
||||||
@ -498,6 +521,16 @@ print_namespace(struct spdk_nvme_ns *ns)
|
|||||||
if (nsdata->noiob) {
|
if (nsdata->noiob) {
|
||||||
printf("Optimal I/O Boundary: %u blocks\n", nsdata->noiob);
|
printf("Optimal I/O Boundary: %u blocks\n", nsdata->noiob);
|
||||||
}
|
}
|
||||||
|
if (!all_zero(nsdata->nguid, sizeof(nsdata->nguid))) {
|
||||||
|
printf("NGUID: ");
|
||||||
|
print_hex_be(nsdata->nguid, sizeof(nsdata->nguid));
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
if (!all_zero(&nsdata->eui64, sizeof(nsdata->eui64))) {
|
||||||
|
printf("EUI64: ");
|
||||||
|
print_hex_be(&nsdata->eui64, sizeof(nsdata->eui64));
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
printf("Thin Provisioning: %s\n",
|
printf("Thin Provisioning: %s\n",
|
||||||
nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported");
|
nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported");
|
||||||
printf("Per-NS Atomic Units: %s\n",
|
printf("Per-NS Atomic Units: %s\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user