Commit fb1ace67 authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8932


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 1d6adfb0
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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
	 */
+4 −0
Original line number Diff line number Diff line
@@ -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);