Commit e067f330 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: pass nvmf_request to nvmf_post_rdma_read()



Make nvmf_post_rdma_read() interface generic (don't require a tx_desc).

Change-Id: I331a93eed4bb1912a47a88bb904cf392fcc364c6
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent a435e9ee
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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;