Spdk/test/lib/nvme/unit
Daniel Verkamp 59fc5ba613 nvme: fix extended LBA block size calculations
For namespaces with end-to-end protection information, metadata size
of exactly 8 bytes, and extended LBA configured, the NVMe driver would
calculate the size of the data block incorrectly.  The NVMe spec has a
special provision for this specific case (8-byte metadata only) and
PRACT = 1 that requires that the host does not send the metadata as part
of the host memory buffer.

To fix this, clean up the calculation of the per-block data transfer
size by adding a new extended_lba_size field in the namespace, which
represents the total size of data to be transferred per block based on
the namespace's configured metadata size and whether it transfers
metadata as part of the data buffer.  Then add the special case for
PRACT = 1 and PI configured and extended LBA in the R/W helper
functions.

Change-Id: I0b383a58c773cac06e6c018858b57129064c6059
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-10 10:24:26 -07:00
..
nvme_c test: move test_env.c to a more generic location 2017-02-09 11:03:11 -07:00
nvme_ctrlr_c test: move test_env.c to a more generic location 2017-02-09 11:03:11 -07:00
nvme_ctrlr_cmd_c nvme: add offset to spdk_nvme_ctrlr_cmd_get_log_page() 2016-12-15 11:16:14 -07:00
nvme_ns_c test: move test_env.c to a more generic location 2017-02-09 11:03:11 -07:00
nvme_ns_cmd_c nvme: fix extended LBA block size calculations 2017-02-10 10:24:26 -07:00
nvme_pcie_c test: move test_env.c to a more generic location 2017-02-09 11:03:11 -07:00
nvme_qpair_c test: move test_env.c to a more generic location 2017-02-09 11:03:11 -07:00
nvme_quirks_c nvme: Make striping a quirk 2016-12-09 14:38:42 -07:00
Makefile test/nvme: add nvme_ns unit test 2017-01-30 09:57:38 -07:00