Commit 2a3e39a1 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: add spdk_ prefix to struct nvmf_request



Also finish up the req_state -> req conversion.

Change-Id: I131dd52dcd36a790b942e06f0207a3274cc04ffc
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 9bc34acd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ static int nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
	struct nvme_qp_rx_desc *rx_desc;
	struct nvme_qp_tx_desc *tx_desc;
	struct spdk_nvmf_capsule_cmd *cap_hdr;
	struct nvmf_request *req;
	struct spdk_nvmf_request *req;
	int ret;

	rx_desc = (struct nvme_qp_rx_desc *)wc->wr_id;
@@ -450,7 +450,7 @@ static int nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
	tx_desc = STAILQ_FIRST(&conn->rdma.qp_tx_desc);
	nvmf_active_tx_desc(tx_desc);

	req = &tx_desc->req_state;
	req = &tx_desc->req;
	req->conn = conn;
	req->tx_desc = tx_desc;
	req->rx_desc = rx_desc;
@@ -490,7 +490,7 @@ static int nvmf_check_rdma_completions(struct spdk_nvmf_conn *conn)
{
	struct ibv_wc wc;
	struct nvme_qp_tx_desc *tx_desc;
	struct nvmf_request *req;
	struct spdk_nvmf_request *req;
	int rc;
	int cq_count = 0;
	int i;
@@ -531,14 +531,14 @@ static int nvmf_check_rdma_completions(struct spdk_nvmf_conn *conn)
			 */
			SPDK_TRACELOG(SPDK_TRACE_RDMA, "\nCQ rdma write completion\n");
			tx_desc = (struct nvme_qp_tx_desc *)wc.wr_id;
			req = &tx_desc->req_state;
			req = &tx_desc->req;
			spdk_trace_record(TRACE_RDMA_WRITE_COMPLETE, 0, 0, (uint64_t)req, 0);
			break;

		case IBV_WC_RDMA_READ:
			SPDK_TRACELOG(SPDK_TRACE_RDMA, "\nCQ rdma read completion\n");
			tx_desc = (struct nvme_qp_tx_desc *)wc.wr_id;
			req = &tx_desc->req_state;
			req = &tx_desc->req;
			spdk_trace_record(TRACE_RDMA_READ_COMPLETE, 0, 0, (uint64_t)req, 0);
			rc = spdk_nvmf_request_exec(req);
			if (rc) {
+5 −5
Original line number Diff line number Diff line
@@ -77,15 +77,15 @@ spdk_nvmf_complete_ctrlr_aer(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nv

			subsystem = g_whitelist[i].subsystem;
			TAILQ_FOREACH(sess, &subsystem->sessions, entries) {
				if (sess->aer_req_state == NULL) {
				if (sess->aer_req == NULL) {
					continue;
				}

				SPDK_TRACELOG(SPDK_TRACE_NVMF, "Process session AER request, sess %p, req_state %p\n",
					      sess, sess->aer_req_state);
				nvmf_complete_cmd(sess->aer_req_state, cpl);
				SPDK_TRACELOG(SPDK_TRACE_NVMF, "Process session AER request, sess %p, req %p\n",
					      sess, sess->aer_req);
				nvmf_complete_cmd(sess->aer_req, cpl);
				/* clear this AER from the session */
				sess->aer_req_state = NULL;
				sess->aer_req = NULL;
			}
		}
	}
+11 −11
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ nvmf_trace_ibv_sge(struct ibv_sge *sg_list)

static void
nvmf_ibv_send_wr_init(struct ibv_send_wr *wr,
		      struct nvmf_request *req,
		      struct spdk_nvmf_request *req,
		      struct ibv_sge *sg_list,
		      uint64_t wr_id,
		      enum ibv_wr_opcode opcode,
@@ -286,7 +286,7 @@ nvmf_ibv_send_wr_init(struct ibv_send_wr *wr,

int
nvmf_post_rdma_read(struct spdk_nvmf_conn *conn,
		    struct nvmf_request *req)
		    struct spdk_nvmf_request *req)
{
	struct ibv_send_wr wr, *bad_wr = NULL;
	struct nvme_qp_tx_desc *tx_desc = req->tx_desc;
@@ -328,7 +328,7 @@ nvmf_post_rdma_read(struct spdk_nvmf_conn *conn,

static int
nvmf_post_rdma_write(struct spdk_nvmf_conn *conn,
		     struct nvmf_request *req)
		     struct spdk_nvmf_request *req)
{
	struct ibv_send_wr wr, *bad_wr = NULL;
	struct nvme_qp_tx_desc *tx_desc = req->tx_desc;
@@ -356,7 +356,7 @@ nvmf_post_rdma_write(struct spdk_nvmf_conn *conn,

static int
nvmf_post_rdma_send(struct spdk_nvmf_conn *conn,
		    struct nvmf_request *req)
		    struct spdk_nvmf_request *req)
{
	struct ibv_send_wr wr, *bad_wr = NULL;
	struct nvme_qp_tx_desc *tx_desc = req->tx_desc;
@@ -377,7 +377,7 @@ nvmf_post_rdma_send(struct spdk_nvmf_conn *conn,
	nvmf_ibv_send_wr_init(&wr, NULL, &tx_desc->send_sgl, (uint64_t)tx_desc,
			      IBV_WR_SEND, IBV_SEND_SIGNALED);

	SPDK_TRACELOG(SPDK_TRACE_RDMA, "tx_desc %p: req_state %p, rsp %p\n",
	SPDK_TRACELOG(SPDK_TRACE_RDMA, "tx_desc %p: req %p, rsp %p\n",
		      tx_desc, req, req->rsp);

	spdk_trace_record(TRACE_NVMF_IO_COMPLETE, 0, 0, (uint64_t)req, 0);
@@ -389,7 +389,7 @@ nvmf_post_rdma_send(struct spdk_nvmf_conn *conn,
}

int
spdk_nvmf_rdma_request_complete(struct spdk_nvmf_conn *conn, struct nvmf_request *req)
spdk_nvmf_rdma_request_complete(struct spdk_nvmf_conn *conn, struct spdk_nvmf_request *req)
{
	struct nvme_qp_tx_desc *tx_desc = req->tx_desc;
	struct spdk_nvme_cpl *rsp = &req->rsp->nvme_cpl;
@@ -1070,10 +1070,10 @@ alloc_qp_tx_desc(struct spdk_nvmf_conn *conn)
		tx_desc->send_sgl.lkey = tx_desc->rsp_mr->lkey;

		/* init request state associated with each tx_desc */
		tx_desc->req_state.rsp = &tx_desc->rsp;
		SPDK_TRACELOG(SPDK_TRACE_DEBUG, "tx_desc %p: req_state %p, rsp %p\n",
			      tx_desc, &tx_desc->req_state,
			      tx_desc->req_state.rsp);
		tx_desc->req.rsp = &tx_desc->rsp;
		SPDK_TRACELOG(SPDK_TRACE_DEBUG, "tx_desc %p: req %p, rsp %p\n",
			      tx_desc, &tx_desc->req,
			      tx_desc->req.rsp);

		STAILQ_INSERT_TAIL(&conn->rdma.qp_tx_desc, tx_desc, link);
	}
@@ -1122,7 +1122,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->req_state);
		rc = nvmf_post_rdma_read(conn, &tx_desc->req);
		if (rc) {
			SPDK_ERRLOG("Unable to post pending rdma read descriptor\n");
			return -1;
+7 −7
Original line number Diff line number Diff line
@@ -78,18 +78,18 @@ struct nvme_qp_rx_desc {
struct nvme_qp_tx_desc {
	union nvmf_c2h_msg		rsp;
	struct spdk_nvmf_conn		*conn;
	struct nvmf_request	req_state;
	struct spdk_nvmf_request	req;
	struct ibv_mr			*rsp_mr;
	struct ibv_sge			send_sgl;
	STAILQ_ENTRY(nvme_qp_tx_desc) link;
};

int nvmf_post_rdma_read(struct spdk_nvmf_conn *conn,
			struct nvmf_request *req);
			struct spdk_nvmf_request *req);
int nvmf_post_rdma_recv(struct spdk_nvmf_conn *conn,
			struct nvme_qp_rx_desc *rx_desc);
int spdk_nvmf_rdma_request_complete(struct spdk_nvmf_conn *conn,
				    struct nvmf_request *req);
				    struct spdk_nvmf_request *req);
int nvmf_process_pending_rdma(struct spdk_nvmf_conn *conn);
int nvmf_rdma_init(void);
void nvmf_rdma_conn_cleanup(struct spdk_nvmf_conn *conn);
+13 −13
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
#include "spdk/trace.h"

int
spdk_nvmf_request_complete(struct nvmf_request *req)
spdk_nvmf_request_complete(struct spdk_nvmf_request *req)
{
	struct spdk_nvme_cpl *response = &req->rsp->nvme_cpl;

@@ -73,7 +73,7 @@ spdk_nvmf_request_complete(struct nvmf_request *req)
}

static int
nvmf_process_admin_cmd(struct nvmf_request *req)
nvmf_process_admin_cmd(struct spdk_nvmf_request *req)
{
	struct nvmf_session *session = req->conn->sess;
	struct spdk_nvme_cmd *cmd = &req->cmd->nvme_cmd;
@@ -207,8 +207,8 @@ nvmf_process_admin_cmd(struct nvmf_request *req)
		  Trap request here and save in the session context
		  until NVMe library indicates some event.
		*/
		if (session->aer_req_state == NULL) {
			session->aer_req_state = req;
		if (session->aer_req == NULL) {
			session->aer_req = req;
		} else {
			/* AER already recorded, send error response */
			SPDK_TRACELOG(SPDK_TRACE_NVMF, "AER already active!\n");
@@ -260,7 +260,7 @@ passthrough:
}

static int
nvmf_process_admin_command(struct nvmf_request *req)
nvmf_process_admin_command(struct spdk_nvmf_request *req)
{
	int	ret;

@@ -280,7 +280,7 @@ nvmf_process_admin_command(struct nvmf_request *req)
}

static int
nvmf_process_io_cmd(struct nvmf_request *req)
nvmf_process_io_cmd(struct spdk_nvmf_request *req)
{
	struct nvmf_session *session = req->conn->sess;
	struct spdk_nvme_cmd *cmd = &req->cmd->nvme_cmd;
@@ -378,7 +378,7 @@ nvmf_process_io_cmd(struct nvmf_request *req)
}

static int
nvmf_process_io_command(struct nvmf_request *req)
nvmf_process_io_command(struct spdk_nvmf_request *req)
{
	int	ret;

@@ -399,7 +399,7 @@ nvmf_process_io_command(struct nvmf_request *req)
}

static int
nvmf_process_property_get(struct nvmf_request *req)
nvmf_process_property_get(struct spdk_nvmf_request *req)
{
	struct spdk_nvmf_fabric_prop_get_rsp *response;
	struct spdk_nvmf_fabric_prop_get_cmd *cmd;
@@ -422,7 +422,7 @@ nvmf_process_property_get(struct nvmf_request *req)
}

static int
nvmf_process_property_set(struct nvmf_request *req)
nvmf_process_property_set(struct spdk_nvmf_request *req)
{
	struct spdk_nvmf_fabric_prop_set_rsp *response;
	struct spdk_nvmf_fabric_prop_set_cmd *cmd;
@@ -453,7 +453,7 @@ nvmf_process_property_set(struct nvmf_request *req)
}

static int
nvmf_process_connect(struct nvmf_request *req)
nvmf_process_connect(struct spdk_nvmf_request *req)
{
	struct spdk_nvmf_fabric_connect_cmd *connect;
	struct spdk_nvmf_fabric_connect_data *connect_data;
@@ -522,7 +522,7 @@ nvmf_process_connect(struct nvmf_request *req)
}

static int
nvmf_process_fabrics_command(struct nvmf_request *req)
nvmf_process_fabrics_command(struct spdk_nvmf_request *req)
{
	struct spdk_nvmf_capsule_cmd *cap_hdr;

@@ -544,7 +544,7 @@ nvmf_process_fabrics_command(struct nvmf_request *req)
}

int
spdk_nvmf_request_prep_data(struct nvmf_request *req,
spdk_nvmf_request_prep_data(struct spdk_nvmf_request *req,
			    void *in_cap_data, uint32_t in_cap_len,
			    void *bb, uint32_t bb_len)
{
@@ -659,7 +659,7 @@ spdk_nvmf_request_prep_data(struct nvmf_request *req,
}

int
spdk_nvmf_request_exec(struct nvmf_request *req)
spdk_nvmf_request_exec(struct spdk_nvmf_request *req)
{
	struct spdk_nvme_cmd *cmd = &req->cmd->nvme_cmd;

Loading