nvmf: In zcopy, delay setting req->data until end of start operation

The data buffer isn't available at the beginning.

Change-Id: Ieeb1a297ff52dfdc6cd999d04862a0cd96483650
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8932
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Ben Walker 2021-07-26 10:19:45 -07:00 committed by Tomasz Zawadzki
parent 1d6adfb09c
commit fb1ace6700
2 changed files with 4 additions and 3 deletions

View File

@ -3601,9 +3601,6 @@ spdk_nvmf_request_zcopy_start(struct spdk_nvmf_request *req)
goto end;
}
/* backward compatible */
req->data = req->iov[0].iov_base;
/* Set iovcnt to be the maximum number of
* iovs that the ZCOPY can use
*/

View File

@ -816,11 +816,15 @@ nvmf_bdev_ctrlr_start_zcopy_complete(struct spdk_bdev_io *bdev_io, bool success,
spdk_bdev_io_get_iovec(bdev_io, &iov, &iovcnt);
assert(iovcnt <= NVMF_REQ_MAX_BUFFERS);
assert(iovcnt > 0);
req->iovcnt = iovcnt;
assert(req->iov == iov);
/* backward compatible */
req->data = req->iov[0].iov_base;
req->zcopy_bdev_io = bdev_io; /* Preserve the bdev_io for the end zcopy */
spdk_nvmf_request_complete(req);