nvme/identify: fix max data transfer when MPSMIN != 0

Correctly calculate the maximum data transfer size as defined in the
spec - MDTS is a power of two in units of the minimum memory page size.

Change-Id: Ifd517d3051a28d404246c5a5d342147aa69ceedc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-08-24 13:55:58 -07:00
parent 76af27c0fc
commit 060ffe8dee

View File

@ -483,12 +483,11 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, struct spdk_pci_device *pci_dev)
printf("IEEE OUI Identifier: %02x %02x %02x\n",
cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]);
printf("Multi-path I/O: %02x\n", *(int *)&cdata->cmic);
/* TODO: Use CAP.MPSMIN to determine true memory page size. */
printf("Max Data Transfer Size: ");
if (cdata->mdts == 0)
printf("Unlimited\n");
else
printf("%d\n", 4096 * (1 << cdata->mdts));
printf("%" PRIu64 "\n", (uint64_t)1 << (12 + cap.bits.mpsmin + cdata->mdts));
if (features[SPDK_NVME_FEAT_ERROR_RECOVERY].valid) {
unsigned tler = features[SPDK_NVME_FEAT_ERROR_RECOVERY].result & 0xFFFF;
printf("Error Recovery Timeout: ");