Spdk/test/unit/lib/nvme
Niklas Cassel 014baeb8ef nvme: add support for ZNS zone append vector variant
We already have support for spdk_nvme_zns_zone_append(),
add support for spdk_nvme_zns_zone_appendv() (zone append with
NVME_PAYLOAD_TYPE_SGL).

_nvme_ns_cmd_rw() currently performs verification of the SGL,
if the parameter check_sgl is set. This parameter is set for all
calls with payload of type NVME_PAYLOAD_TYPE_SGL.

In order to be able to perform the same check_sgl verfication on
zone append vectors, we need to refactor _nvme_ns_cmd_rw() a bit.

Setting check_sgl ensures that _nvme_ns_cmd_split_request_sgl() or
_nvme_ns_cmd_split_request_prp() gets called.

These functions will split an oversized I/O into several different
requests. However, they also iterate the SGE entries, verifies that
the total payload size, total SGE entries is not too many, and that
buffers are properly aligned. A proper request will not get split.

For zone append, splitting a request into several is not allowed,
however, we still want the verification part to be done, such that
(e.g.) a non first/last SGE which is not page aligned, will cause
the whole request to be rejected.
(In the case of spdk_nvme_ns_cmd_write(), a non first/last SGE which
is not page aligned will instead cause the request to be split.)

An alternative would be to try to rip out the verification part from
_nvme_ns_cmd_split_request_sgl() and _nvme_ns_cmd_split_request_prp().
However, that is non-trivial, and would most likely end up with a lot
of duplicated code, which would easily get out of sync.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I2728acdcadeb70b1f0ed628704df19e75d14dcca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6248
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-02-17 10:17:22 +00:00
..
nvme_ctrlr_cmd.c test/nvme_ctrlr_cmd: initialize mutex 2021-02-04 08:38:12 +00:00
nvme_ctrlr_ocssd_cmd.c test/nvme_ctrlr_ocssd_cmd: initialize mutex 2021-02-04 08:38:27 +00:00
nvme_ctrlr.c lib/nvme: Remove qpair from all lists before freeing it. 2021-02-08 16:13:59 +00:00
nvme_ns_cmd.c nvme: add support for ZNS zone append vector variant 2021-02-17 10:17:22 +00:00
nvme_ns_ocssd_cmd.c test/unit/lib/nvme: Add unit test stubs 2020-11-19 09:49:41 +00:00
nvme_ns.c log: simplify SPDK_LOG_REGISTER_COMPONENT 2020-10-14 08:00:35 +00:00
nvme_pcie.c nvme: add set_nvme_pcie_set_hotplug_filter 2021-02-09 11:27:19 +00:00
nvme_poll_group.c nvme: Add the interface to get the optimal polling group 2021-02-04 08:30:54 +00:00
nvme_qpair.c nvme: Don't log an error when we can't resubmit all requests 2020-10-26 11:48:46 +00:00
nvme_quirks.c log: simplify SPDK_LOG_REGISTER_COMPONENT 2020-10-14 08:00:35 +00:00
nvme_rdma.c unittest/nvmf_rdma: increase code coverage for nvme_rdma_alloc_rsps 2021-02-09 11:27:55 +00:00
nvme_tcp.c test/nvme_tcp: nvme tcp UT cases 2021-02-10 08:32:30 +00:00
nvme_uevent.c nvme: read all uevents 2020-08-24 07:38:33 +00:00
nvme.c unittest/nvme: initialize mutex for portability 2021-02-04 08:38:44 +00:00
Makefile test/unit: add poll_group unit tests. 2020-04-07 08:38:40 +00:00