Skip to content

Commit

Permalink
nvmecontrol: Display additional Fabrics-related fields for cdata
Browse files Browse the repository at this point in the history
Some of these fields are specific to Fabrics controllers (such as the
size of capsules) while other fields are shared with PCI-e
controllers, but are more relevant for Fabrics controllers (such as
KeepAlive timer properties).

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44449
  • Loading branch information
bsdjhb committed Mar 23, 2024
1 parent 21d3a84 commit acbc176
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions sbin/nvmecontrol/identify_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,36 @@ nvme_print_controller(struct nvme_controller_data *cdata)
printf("Version: %d.%d.%d\n",
(cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff,
cdata->ver & 0xff);
printf("Traffic Based Keep Alive: %sSupported\n",
NVMEV(NVME_CTRLR_DATA_CTRATT_TBKAS, cdata->ctratt) ? "" : "Not ");
printf("Controller Type: ");
switch (cdata->cntrltype) {
case 0:
printf("Not Reported\n");
break;
case 1:
printf("I/O Controller\n");
break;
case 2:
printf("Discovery Controller\n");
break;
case 3:
printf("Administrative Controller\n");
break;
default:
printf("%d (Reserved)\n", cdata->cntrltype);
break;
}
printf("Keep Alive Timer ");
if (cdata->kas == 0)
printf("Not Supported\n");
else
printf("%u ms granularity\n", cdata->kas * 100);
printf("Maximum Outstanding Commands ");
if (cdata->maxcmd == 0)
printf("Not Specified\n");
else
printf("%u\n", cdata->maxcmd);
printf("\n");

printf("Admin Command Set Attributes\n");
Expand Down Expand Up @@ -248,4 +278,25 @@ nvme_print_controller(struct nvme_controller_data *cdata)

if (cdata->ver >= 0x010201)
printf("\nNVM Subsystem Name: %.256s\n", cdata->subnqn);

if (cdata->ioccsz != 0) {
printf("\n");
printf("Fabrics Attributes\n");
printf("==================\n");
printf("I/O Command Capsule Size: %d bytes\n",
cdata->ioccsz * 16);
printf("I/O Response Capsule Size: %d bytes\n",
cdata->iorcsz * 16);
printf("In Capsule Data Offset: %d bytes\n",
cdata->icdoff * 16);
printf("Controller Model: %s\n",
(cdata->fcatt & 1) == 0 ? "Dynamic" : "Static");
printf("Max SGL Descriptors: ");
if (cdata->msdbd == 0)
printf("Unlimited\n");
else
printf("%d\n", cdata->msdbd);
printf("Disconnect of I/O Queues: %sSupported\n",
(cdata->ofcs & 1) == 1 ? "" : "Not ");
}
}

0 comments on commit acbc176

Please sign in to comment.