nvmf/tcp: Pass nvmf_request to nvmf_tcp_req_fill_buffers
Most variables related with I/O buffer are in struct spdk_nvmf_request now. So we can pass nvmf_request instead of nvmf_tcp_req to nvmf_tcp_req_fill_buffers and do it in this patch. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I00eff578a98891e99fcb9a3aafa3d99126d6f1c1 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466089 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
This commit is contained in:
parent
90a2be2006
commit
b4778363b4
@ -2186,25 +2186,25 @@ spdk_nvmf_tcp_req_get_xfer(struct spdk_nvmf_tcp_req *tcp_req) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_tcp_req_fill_buffers(struct spdk_nvmf_tcp_req *tcp_req,
|
spdk_nvmf_tcp_req_fill_buffers(struct spdk_nvmf_request *req,
|
||||||
struct spdk_nvmf_transport *transport,
|
struct spdk_nvmf_transport *transport,
|
||||||
uint32_t length)
|
uint32_t length)
|
||||||
{
|
{
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
|
|
||||||
tcp_req->req.iovcnt = 0;
|
req->iovcnt = 0;
|
||||||
while (length) {
|
while (length) {
|
||||||
i = tcp_req->req.iovcnt;
|
i = req->iovcnt;
|
||||||
tcp_req->req.iov[i].iov_base = (void *)((uintptr_t)(tcp_req->req.buffers[i] +
|
req->iov[i].iov_base = (void *)((uintptr_t)(req->buffers[i] +
|
||||||
NVMF_DATA_BUFFER_MASK) &
|
NVMF_DATA_BUFFER_MASK) &
|
||||||
~NVMF_DATA_BUFFER_MASK);
|
~NVMF_DATA_BUFFER_MASK);
|
||||||
tcp_req->req.iov[i].iov_len = spdk_min(length, transport->opts.io_unit_size);
|
req->iov[i].iov_len = spdk_min(length, transport->opts.io_unit_size);
|
||||||
tcp_req->req.iovcnt++;
|
req->iovcnt++;
|
||||||
length -= tcp_req->req.iov[i].iov_len;
|
length -= req->iov[i].iov_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(tcp_req->req.iovcnt <= SPDK_NVMF_MAX_SGL_ENTRIES);
|
assert(req->iovcnt <= SPDK_NVMF_MAX_SGL_ENTRIES);
|
||||||
tcp_req->req.data_from_pool = true;
|
req->data_from_pool = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -2225,7 +2225,7 @@ spdk_nvmf_tcp_req_fill_iovs(struct spdk_nvmf_tcp_transport *ttransport,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
spdk_nvmf_tcp_req_fill_buffers(tcp_req, &ttransport->transport, length);
|
spdk_nvmf_tcp_req_fill_buffers(&tcp_req->req, &ttransport->transport, length);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user