Hi Lance,
NVME_MAX_XFER_SIZE is the maximum data length supported by SPDK driver, of course the NVMe
controller has a field(MDTS)
to show the limit from hardware, so choose the smaller one as the command limit to split
commands bigger than this number.
Most of Intel NVMe SSDs has a hardware value 128KiB, so the driver limit with (506*4) KiB
is big enough to support it.
-----Original Message-----
From: SPDK [mailto:
[email protected]] On Behalf Of Lance Hartmann
ORACLE
Sent: Wednesday, August 9, 2017 11:52 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] Determination of NVMe max_io_xfer_size
(NVME_MAX_XFER_SIZE) ?
Hello,
I’m trying to reconcile the #define NVME_MAX_XFER_SIZE and leading comment:
/*
* For commands requiring more than 2 PRP entries, one PRP will be
* embedded in the command (prp1), and the rest of the PRP entries
* will be in a list pointed to by the command (prp2). This means
* that real max number of PRP entries we support is 506+1, which
* results in a max xfer size of 506*PAGE_SIZE.
*/
in lib/nvme/nvme_pcie.c with my interpretation from reading the NVMe spec.
I’d greatly appreciate if someone could “show me the math” or otherwise help
me to understand this. How was NVME_MAX_PRP_LIST_ENTRIES (506) derived?
I don’t know if I’m lost in the semantics of the naming, the comment, or perhaps
there’s a nuance in the “…we support…” part. I would’ve guessed, otherwise,
that the max # of PRP entries would be a function of the PAGE_SIZE.
I did see that the driver in nvme_ctrlr_identify() compares this derived maximum
transfer size with that which the controller can actually support as reported in
the Identify Controller structure, choosing the minimum of the two values, but
that’s understood and separate from the above.
regards,
--
Lance Hartmann
lance.hartmann(a)oracle.com
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk