diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index de546bc4d..c9c77db24 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -286,11 +286,12 @@ nvmf_ibv_send_wr_init(struct ibv_send_wr *wr, int nvmf_post_rdma_read(struct spdk_nvmf_conn *conn, - struct nvme_qp_tx_desc *tx_desc) + struct nvmf_request *req) { struct ibv_send_wr wr, *bad_wr = NULL; - struct nvme_qp_rx_desc *rx_desc = tx_desc->req_state.rx_desc; - struct nvmf_request *req = &tx_desc->req_state; + struct nvme_qp_tx_desc *tx_desc = req->tx_desc; + struct nvme_qp_rx_desc *rx_desc = req->rx_desc; + int rc; if (rx_desc == NULL) { @@ -1090,7 +1091,7 @@ nvmf_process_pending_rdma(struct spdk_nvmf_conn *conn) SPDK_TRACELOG(SPDK_TRACE_RDMA, "Issue rdma read from pending queue: tx_desc %p\n", tx_desc); - rc = nvmf_post_rdma_read(conn, tx_desc); + rc = nvmf_post_rdma_read(conn, &tx_desc->req_state); if (rc) { SPDK_ERRLOG("Unable to post pending rdma read descriptor\n"); return -1; diff --git a/lib/nvmf/rdma.h b/lib/nvmf/rdma.h index 3f7ee74a8..ecc44c468 100644 --- a/lib/nvmf/rdma.h +++ b/lib/nvmf/rdma.h @@ -80,7 +80,7 @@ struct nvme_qp_tx_desc { }; int nvmf_post_rdma_read(struct spdk_nvmf_conn *conn, - struct nvme_qp_tx_desc *tx_desc); + struct nvmf_request *req); int nvmf_post_rdma_write(struct spdk_nvmf_conn *conn, struct nvme_qp_tx_desc *tx_desc); int nvmf_post_rdma_recv(struct spdk_nvmf_conn *conn, diff --git a/lib/nvmf/request.c b/lib/nvmf/request.c index ff45f8e27..22f997c69 100644 --- a/lib/nvmf/request.c +++ b/lib/nvmf/request.c @@ -738,7 +738,7 @@ spdk_nvmf_request_prep_data(struct nvmf_request *req, if (xfer == SPDK_NVME_DATA_HOST_TO_CONTROLLER) { if (sgl->generic.type == SPDK_NVME_SGL_TYPE_KEYED_DATA_BLOCK) { SPDK_TRACELOG(SPDK_TRACE_RDMA, "Issuing RDMA Read to get host data\n"); - ret = nvmf_post_rdma_read(conn, tx_desc); + ret = nvmf_post_rdma_read(conn, req); if (ret) { SPDK_ERRLOG("Unable to post rdma read tx descriptor\n"); return -1;