rdma: Move rdma WR setup to spdk_nvmf_rdma_request_fill_iovs

This change helps to avoid passing the number of additional WRs to
spdk_nvmf_rdma_request_fill_iovs in the following commits and minimizes
changes in spdk_nvmf_rdma_request_parse_sgl

Change-Id: Id530d0996af661051d94930e3f776bad2dcc5771
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470473
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Alexey Marchuk 2019-10-03 06:01:59 +00:00 committed by Tomasz Zawadzki
parent 0a04c076ea
commit 838c45c856

View File

@ -1680,6 +1680,9 @@ spdk_nvmf_rdma_request_fill_iovs(struct spdk_nvmf_rdma_transport *rtransport,
rqpair = SPDK_CONTAINEROF(req->qpair, struct spdk_nvmf_rdma_qpair, qpair);
rgroup = rqpair->poller->group;
/* rdma wr specifics */
nvmf_rdma_setup_request(rdma_req);
rc = spdk_nvmf_request_get_buffers(req, &rgroup->group, &rtransport->transport,
length);
if (rc != 0) {
@ -1695,6 +1698,9 @@ spdk_nvmf_rdma_request_fill_iovs(struct spdk_nvmf_rdma_transport *rtransport,
goto err_exit;
}
/* set the number of outstanding data WRs for this request. */
rdma_req->num_outstanding_data_wr = 1;
return rc;
err_exit:
@ -1861,12 +1867,6 @@ spdk_nvmf_rdma_request_parse_sgl(struct spdk_nvmf_rdma_transport *rtransport,
/* backward compatible */
req->data = req->iov[0].iov_base;
/* rdma wr specifics */
nvmf_rdma_setup_request(rdma_req);
/* set the number of outstanding data WRs for this request. */
rdma_req->num_outstanding_data_wr = 1;
SPDK_DEBUGLOG(SPDK_LOG_RDMA, "Request %p took %d buffer/s from central pool\n", rdma_req,
req->iovcnt);