Commit 3aac18b2 authored by Krzysztof Goreczny's avatar Krzysztof Goreczny Committed by Jim Harris
Browse files

nvmf: set the data_from_pool when it actually happens



This fixes the iobuf based request queuing introduced in the c7d22538.
Before it was enough to set the data_from_pool at the very end of the
nvmf_request_get_buffers but now it might happen that all request
buffers are set via the nvmf_request_iobuf_get_cb callbacks. In such
case we won't set that flag and won't release buffers to the iobuf pool
when request is completed.

Change-Id: Ifa991ab5a64287ea0512dcb7fbb987740a853994
Signed-off-by: default avatarKrzysztof Goreczny <krzysztof.goreczny@dell.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/25784


Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@nutanix.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Reviewed-by: default avatarGangCao <gang.cao@intel.com>
Community-CI: Mellanox Build Bot
parent 165bfeef
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -879,6 +879,7 @@ nvmf_request_set_buffer(struct spdk_nvmf_request *req, void *buf, uint32_t lengt
	req->iov[req->iovcnt].iov_len  = spdk_min(length, io_unit_size);
	length -= req->iov[req->iovcnt].iov_len;
	req->iovcnt++;
	req->data_from_pool = true;

	return length;
}
@@ -893,6 +894,7 @@ nvmf_request_set_stripped_buffer(struct spdk_nvmf_request *req, void *buf, uint3
	data->iov[data->iovcnt].iov_len  = spdk_min(length, io_unit_size);
	length -= data->iov[data->iovcnt].iov_len;
	data->iovcnt++;
	req->data_from_pool = true;

	return length;
}
@@ -940,7 +942,6 @@ nvmf_request_get_buffers(struct spdk_nvmf_request *req,
	}

	assert(length == 0);
	req->data_from_pool = true;

	return 0;
}